use of org.eclipse.wst.common.core.search.scope.WorkingSetSearchScope in project webtools.sourceediting by eclipse.
the class FindReferencesInWorkingSetAction method run.
public void run() {
IWorkingSet[] workingSets = queryWorkingSets();
if (workingSets == null || workingSets.length == 0)
// The user chooses nothing, no point to continue.
return;
String pattern = "";
XSDNamedComponent component = getXSDNamedComponent();
IFile file = getCurrentFile();
if (file != null && component != null) {
QualifiedName metaName = determineMetaName(component);
QualifiedName elementQName = new QualifiedName(component.getTargetNamespace(), component.getName());
// Create a scope from the selected working sets
WorkingSetSearchScope scope = new WorkingSetSearchScope();
for (int i = 0; i < workingSets.length; i++) {
IAdaptable[] elements = workingSets[i].getElements();
scope.addAWorkingSetToScope(elements);
}
String scopeDescription = "Working Set";
XSDSearchQuery searchQuery = new XSDSearchQuery(pattern, file, elementQName, metaName, XSDSearchQuery.LIMIT_TO_REFERENCES, scope, scopeDescription);
NewSearchUI.activateSearchResultView();
NewSearchUI.runQueryInBackground(searchQuery);
}
}
Aggregations