use of org.eclipse.wst.jsdt.core.search.SearchRequestor in project webtools.sourceediting by eclipse.
the class JsQueryParticipant method search.
/**
* @see org.eclipse.wst.jsdt.ui.search.IQueryParticipant#search(org.eclipse.wst.jsdt.ui.search.ISearchRequestor,
* org.eclipse.wst.jsdt.ui.search.QuerySpecification,
* org.eclipse.core.runtime.IProgressMonitor)
*/
public void search(ISearchRequestor requestor, QuerySpecification querySpecification, IProgressMonitor monitor) throws CoreException {
// do search based on the particular Java query
if (querySpecification instanceof ElementQuerySpecification) {
// element search (eg. from global find references in Java file)
ElementQuerySpecification elementQuery = (ElementQuerySpecification) querySpecification;
IJavaScriptElement element = elementQuery.getElement();
if (JsQueryParticipant.DEBUG) {
// $NON-NLS-1$
System.out.println("JSP Query Participant searching on ELEMENT: " + element);
}
SearchRequestor jspRequestor = new JsSearchRequestor(requestor);
// pa_TODO need to adapt JavaSearchScope to a JSPSearchScope
JsSearchSupport.getInstance().search(element, new JsSearchScope(), jspRequestor);
} else if (querySpecification instanceof PatternQuerySpecification) {
// pattern search (eg. from Java search page)
PatternQuerySpecification patternQuery = (PatternQuerySpecification) querySpecification;
String pattern = patternQuery.getPattern();
if (JsQueryParticipant.DEBUG) {
// $NON-NLS-1$
System.out.println("JSP Query Participant searching on PATTERN: " + pattern);
}
SearchRequestor jspRequestor = new JsSearchRequestor(requestor);
JsSearchSupport.getInstance().search(pattern, new JsSearchScope(), patternQuery.getSearchFor(), patternQuery.getLimitTo(), SearchPattern.R_PATTERN_MATCH, false, jspRequestor);
}
}
Aggregations