Lines 64-70
Link Here
|
64 |
import org.eclipse.jdt.core.search.IJavaSearchConstants; |
64 |
import org.eclipse.jdt.core.search.IJavaSearchConstants; |
65 |
import org.eclipse.jdt.core.search.IJavaSearchScope; |
65 |
import org.eclipse.jdt.core.search.IJavaSearchScope; |
66 |
import org.eclipse.jdt.core.search.SearchEngine; |
66 |
import org.eclipse.jdt.core.search.SearchEngine; |
|
|
67 |
import org.eclipse.jdt.core.search.SearchMatch; |
67 |
import org.eclipse.jdt.core.search.SearchPattern; |
68 |
import org.eclipse.jdt.core.search.SearchPattern; |
|
|
69 |
import org.eclipse.jdt.core.search.TypeDeclarationNameMatch; |
68 |
import org.eclipse.jdt.core.search.TypeNameRequestor; |
70 |
import org.eclipse.jdt.core.search.TypeNameRequestor; |
69 |
|
71 |
|
70 |
import org.eclipse.jdt.internal.corext.util.Messages; |
72 |
import org.eclipse.jdt.internal.corext.util.Messages; |
Lines 136-141
Link Here
|
136 |
} |
138 |
} |
137 |
} |
139 |
} |
138 |
|
140 |
|
|
|
141 |
private static class NewSearchRequestor extends org.eclipse.jdt.core.search.SearchRequestor { |
142 |
private volatile boolean fStop; |
143 |
|
144 |
private Set fHistory; |
145 |
|
146 |
private TypeInfoFilter fFilter; |
147 |
private TypeInfoFactory fFactory= new TypeInfoFactory(); |
148 |
private List fResult; |
149 |
|
150 |
public NewSearchRequestor(TypeInfoFilter filter) { |
151 |
super(); |
152 |
fResult= new ArrayList(2048); |
153 |
fFilter= filter; |
154 |
} |
155 |
public TypeInfo[] getResult() { |
156 |
return (TypeInfo[])fResult.toArray(new TypeInfo[fResult.size()]); |
157 |
} |
158 |
public void cancel() { |
159 |
fStop= true; |
160 |
} |
161 |
public void setHistory(Set history) { |
162 |
fHistory= history; |
163 |
} |
164 |
public void acceptSearchMatch(SearchMatch match) throws CoreException { |
165 |
TypeDeclarationNameMatch typeNameMatch = (TypeDeclarationNameMatch) match; |
166 |
if (fStop) |
167 |
return; |
168 |
char[] packageName = typeNameMatch.getPackageName(); |
169 |
char[] typeName = typeNameMatch.getTypeName(); |
170 |
if (TypeFilter.isFiltered(packageName, typeName)) |
171 |
return; |
172 |
TypeInfo type= fFactory.create(packageName, typeName, typeNameMatch.getEnclosingTypeNames(), typeNameMatch.getModifiers(), typeNameMatch.getPath()); |
173 |
type.match = typeNameMatch; |
174 |
if (fHistory.contains(type)) |
175 |
return; |
176 |
if (fFilter.matchesFilterExtension(type)) |
177 |
fResult.add(type); |
178 |
} |
179 |
} |
180 |
|
139 |
protected static class TypeInfoComparator implements Comparator { |
181 |
protected static class TypeInfoComparator implements Comparator { |
140 |
private TypeInfoLabelProvider fLabelProvider; |
182 |
private TypeInfoLabelProvider fLabelProvider; |
141 |
private TypeInfoFilter fFilter; |
183 |
private TypeInfoFilter fFilter; |
Lines 626-639
Link Here
|
626 |
private static class SearchEngineJob extends AbstractSearchJob { |
668 |
private static class SearchEngineJob extends AbstractSearchJob { |
627 |
private IJavaSearchScope fScope; |
669 |
private IJavaSearchScope fScope; |
628 |
private int fElementKind; |
670 |
private int fElementKind; |
629 |
private SearchRequestor fReqestor; |
671 |
private NewSearchRequestor fReqestor; |
630 |
|
672 |
|
631 |
public SearchEngineJob(int ticket, TypeInfoViewer viewer, TypeInfoFilter filter, OpenTypeHistory history, int numberOfVisibleItems, int mode, |
673 |
public SearchEngineJob(int ticket, TypeInfoViewer viewer, TypeInfoFilter filter, OpenTypeHistory history, int numberOfVisibleItems, int mode, |
632 |
IJavaSearchScope scope, int elementKind) { |
674 |
IJavaSearchScope scope, int elementKind) { |
633 |
super(ticket, viewer, filter, history, numberOfVisibleItems, mode); |
675 |
super(ticket, viewer, filter, history, numberOfVisibleItems, mode); |
634 |
fScope= scope; |
676 |
fScope= scope; |
635 |
fElementKind= elementKind; |
677 |
fElementKind= elementKind; |
636 |
fReqestor= new SearchRequestor(filter); |
678 |
fReqestor= new NewSearchRequestor(filter); |
637 |
} |
679 |
} |
638 |
public void stop() { |
680 |
public void stop() { |
639 |
fReqestor.cancel(); |
681 |
fReqestor.cancel(); |