use of org.eclipse.jst.jsp.ui.internal.java.search.JSPSearchRequestor in project webtools.sourceediting by eclipse.
the class JSPQueryParticipant method search.
/**
* @see org.eclipse.jdt.ui.search.IQueryParticipant#search(org.eclipse.jdt.ui.search.ISearchRequestor, org.eclipse.jdt.ui.search.QuerySpecification, org.eclipse.core.runtime.IProgressMonitor)
*/
public void search(ISearchRequestor requestor, QuerySpecification querySpecification, IProgressMonitor monitor) throws CoreException {
if (shouldSupplyJSPSearchResultsToJavaSearch()) {
// 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;
IJavaElement element = elementQuery.getElement();
if (DEBUG)
// $NON-NLS-1$
System.out.println("JSP Query Participant searching on ELEMENT: " + element);
SearchRequestor jspRequestor = new JSPSearchRequestor(requestor);
// pa_TODO need to adapt JavaSearchScope to a JSPSearchScope
JSPSearchSupport.getInstance().search(element, new JSPSearchScope(), jspRequestor, monitor);
} else if (querySpecification instanceof PatternQuerySpecification) {
// pattern search (eg. from Java search page)
PatternQuerySpecification patternQuery = (PatternQuerySpecification) querySpecification;
String pattern = patternQuery.getPattern();
if (DEBUG)
// $NON-NLS-1$
System.out.println("JSP Query Participant searching on PATTERN: " + pattern);
SearchRequestor jspRequestor = new JSPSearchRequestor(requestor);
JSPSearchSupport.getInstance().search(pattern, new JSPSearchScope(), patternQuery.getSearchFor(), patternQuery.getLimitTo(), SearchPattern.R_PATTERN_MATCH, false, jspRequestor, monitor);
}
}
}
Aggregations