Search in sources :

Example 1 with SearchParticipant

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

the class XSDSearchListProvider method findMatches.

protected void findMatches(SearchEngine searchEngine, SearchRequestor requestor, SearchScope scope, QualifiedName metaName) {
    try {
        XMLComponentDeclarationPattern pattern = new XMLComponentDeclarationPattern(new QualifiedName("*", "*"), metaName, SearchPattern.R_PATTERN_MATCH);
        // TODO (cs) revist this... we shouldn't be needing to hard-code partipant id's
        // All we're really doing here is trying to avoid finding matches in
        // wsdl's since we don't  ever want to import/include a wsdl from a schema!
        // Maybe we should just scope out any file types that aren't xsd's using a
        // custom SearchScope?
        // 
        SearchParticipant particpant = SearchPlugin.getDefault().getSearchParticipant("org.eclipse.wst.xsd.search.XSDSearchParticipant");
        Assert.isNotNull(particpant);
        SearchParticipant[] participants = { particpant };
        searchEngine.search(pattern, requestor, participants, scope, null, new NullProgressMonitor());
    } catch (CoreException e) {
        e.printStackTrace();
    }
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) CoreException(org.eclipse.core.runtime.CoreException) QualifiedName(org.eclipse.wst.common.core.search.pattern.QualifiedName) XMLComponentDeclarationPattern(org.eclipse.wst.xml.core.internal.search.XMLComponentDeclarationPattern) SearchParticipant(org.eclipse.wst.common.core.search.SearchParticipant)

Aggregations

CoreException (org.eclipse.core.runtime.CoreException)1 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1 SearchParticipant (org.eclipse.wst.common.core.search.SearchParticipant)1 QualifiedName (org.eclipse.wst.common.core.search.pattern.QualifiedName)1 XMLComponentDeclarationPattern (org.eclipse.wst.xml.core.internal.search.XMLComponentDeclarationPattern)1