<s> package org . eclipse . jdt . core . search ; import org . eclipse . core . resources . IResource ; import org . eclipse . core . runtime . * ; import org . eclipse . jdt . internal . core . JavaModel ; import org . eclipse . jdt . internal . core . JavaModelManager ; import org . eclipse . jdt . internal . core . search . indexing . IndexManager ; public abstract class SearchParticipant { private IPath lastIndexLocation ; protected SearchParticipant ( ) { } public void beginSearching ( ) { } public void doneSearching ( ) { } public String getDescription ( ) { return "" ; } public abstract SearchDocument getDocument ( String documentPath ) ; public abstract void indexDocument ( SearchDocument document , IPath indexLocation ) ; public abstract void locateMatches ( SearchDocument [ ] documents , SearchPattern pattern , IJavaSearchScope scope , SearchRequestor requestor , IProgressMonitor monitor ) throws CoreException ; public void removeIndex ( IPath indexLocation ) { IndexManager manager = JavaModelManager . getIndexManager ( ) ; manager . removeIndexPath ( indexLocation ) ; } public final void scheduleDocumentIndexing ( SearchDocument document , IPath indexLocation ) { IPath documentPath = new Path ( document . getPath ( ) ) ; Object file = JavaModel . getTarget ( documentPath , true ) ; IPath containerPath = documentPath ; if ( file instanceof IResource ) { containerPath = ( ( IResource ) file ) . getProject ( ) . getFullPath ( ) ; } else if ( file == null ) { containerPath = documentPath . removeLastSegments ( documentPath . segmentCount ( ) - 1 ) ; } IndexManager manager = JavaModelManager . getIndexManager ( ) ; manager . ensureIndexExists ( indexLocation , containerPath ) ; manager . scheduleDocumentIndexing ( document , containerPath , indexLocation , this ) ; if ( ! indexLocation . equals ( this . lastIndexLocation ) ) { manager . updateParticipant ( indexLocation , containerPath ) ; this . lastIndexLocation = indexLocation ; } } public abstract IPath [ ] selectIndexes ( SearchPattern query , IJavaSearchScope scope ) ; } </s>