use of org.eclipse.jdt.internal.ui.search.JavaSearchQuery in project che by eclipse.
the class SearchTestHelper method runMethodRefQuery.
static JavaSearchQuery runMethodRefQuery(String methodName) {
JavaSearchQuery query = new JavaSearchQuery(new PatternQuerySpecification(methodName, IJavaSearchConstants.METHOD, true, IJavaSearchConstants.REFERENCES, JavaSearchScopeFactory.getInstance().createWorkspaceScope(true), "workspace scope"));
NewSearchUI.runQueryInForeground(null, query);
return query;
}
use of org.eclipse.jdt.internal.ui.search.JavaSearchQuery in project che by eclipse.
the class SearchTestHelper method countMethodRefs.
static int countMethodRefs(String methodName) {
JavaSearchQuery query = runMethodRefQuery(methodName);
JavaSearchResult result = (JavaSearchResult) query.getSearchResult();
return result.getMatchCount();
}
use of org.eclipse.jdt.internal.ui.search.JavaSearchQuery in project che by eclipse.
the class SearchTestHelper method runTypeRefQuery.
static JavaSearchQuery runTypeRefQuery(String typeName) throws JavaModelException {
IType type = getType(typeName);
JavaSearchQuery query = new JavaSearchQuery(new ElementQuerySpecification(type, IJavaSearchConstants.REFERENCES, JavaSearchScopeFactory.getInstance().createWorkspaceScope(true), "workspace scope"));
NewSearchUI.runQueryInForeground(null, query);
return query;
}
Aggregations