Search in sources :

Example 1 with ProjectSearchScope

use of org.eclipse.wst.common.core.search.scope.ProjectSearchScope in project webtools.sourceediting by eclipse.

the class FindReferencesInProjectAction method run.

public void run() {
    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());
        IPath fullPath = file.getFullPath();
        ProjectSearchScope scope = new ProjectSearchScope(fullPath);
        String scopeDescription = "Project";
        XSDSearchQuery searchQuery = new XSDSearchQuery(pattern, file, elementQName, metaName, XSDSearchQuery.LIMIT_TO_REFERENCES, scope, scopeDescription);
        NewSearchUI.activateSearchResultView();
        NewSearchUI.runQueryInBackground(searchQuery);
    }
}
Also used : XSDNamedComponent(org.eclipse.xsd.XSDNamedComponent) IFile(org.eclipse.core.resources.IFile) IPath(org.eclipse.core.runtime.IPath) QualifiedName(org.eclipse.wst.common.core.search.pattern.QualifiedName) ProjectSearchScope(org.eclipse.wst.common.core.search.scope.ProjectSearchScope) XSDSearchQuery(org.eclipse.wst.xsd.ui.internal.search.XSDSearchQuery)

Aggregations

IFile (org.eclipse.core.resources.IFile)1 IPath (org.eclipse.core.runtime.IPath)1 QualifiedName (org.eclipse.wst.common.core.search.pattern.QualifiedName)1 ProjectSearchScope (org.eclipse.wst.common.core.search.scope.ProjectSearchScope)1 XSDSearchQuery (org.eclipse.wst.xsd.ui.internal.search.XSDSearchQuery)1 XSDNamedComponent (org.eclipse.xsd.XSDNamedComponent)1