public class JavaSearchParticipant extends SearchParticipant
| Constructor and Description |
|---|
JavaSearchParticipant() |
| Modifier and Type | Method and Description |
|---|---|
void |
beginSearching()
Notification that this participant's help is needed in a search.
|
void |
doneSearching()
Notification that this participant's help is no longer needed.
|
java.lang.String |
getDescription()
Returns a displayable name of this search participant.
|
SearchDocument |
getDocument(java.lang.String documentPath)
Returns a search document for the given path.
|
void |
indexDocument(SearchDocument document,
IPath indexPath)
Indexes the given document in the given index.
|
void |
indexResolvedDocument(SearchDocument document,
IPath indexPath)
Indexes the given resolved document in the given index.
|
void |
locateMatches(SearchDocument[] indexMatches,
SearchPattern pattern,
IJavaSearchScope scope,
SearchRequestor requestor,
IProgressMonitor monitor)
Locates the matches in the given documents using the given search pattern
and search scope, and reports them to the given search requestor.
|
void |
resolveDocument(SearchDocument document)
Resolves the given document.
|
IPath[] |
selectIndexes(SearchPattern pattern,
IJavaSearchScope scope)
Returns the collection of index locations to consider when performing the
given search query in the given scope.
|
IndexLocation[] |
selectIndexURLs(SearchPattern pattern,
IJavaSearchScope scope) |
removeIndex, scheduleDocumentIndexingpublic void beginSearching()
SearchParticipantThis method should be re-implemented in subclasses that need to do something when the participant is needed in a search.
beginSearching in class SearchParticipantpublic void doneSearching()
SearchParticipantThis method should be re-implemented in subclasses that need to do something when the participant is no longer needed in a search.
doneSearching in class SearchParticipantpublic java.lang.String getDescription()
SearchParticipantThis method should be re-implemented in subclasses that need to display a meaningful name.
getDescription in class SearchParticipantpublic SearchDocument getDocument(java.lang.String documentPath)
SearchParticipant
Implementors of this method can either create an instance of their own subclass of
SearchDocument or return an existing instance of such a subclass.
getDocument in class SearchParticipantdocumentPath - the path of the document.public void indexDocument(SearchDocument document, IPath indexPath)
SearchParticipantSearchDocument.addIndexEntry(char[], char[]) as many times as
needed to add index entries to the index. If delegating to another
participant, it should use the original index location (and not the
delegatee's one). In the particular case of delegating to the default
search participant (see SearchEngine.getDefaultSearchParticipant()),
the provided document's path must be a path ending with one of the
Java-like extensions
or with '.class'.
The given index location must represent a path in the file system to a file that either already exists or is going to be created. If it exists, it must be an index file, otherwise its data might be overwritten.
Clients are not expected to call this method.
indexDocument in class SearchParticipantdocument - the document to indexindexPath - the location in the file system to the indexpublic void indexResolvedDocument(SearchDocument document, IPath indexPath)
SearchParticipantSearchDocument.addIndexEntry(char[], char[]) as many times as
needed to add only those additional index entries which could not have been originally added
to the index during a call to SearchParticipant.indexDocument(org.aspectj.org.eclipse.jdt.core.search.SearchDocument, IPath). If delegating to another
participant, it should use the original index location (and not the
delegatee's one). In the particular case of delegating to the default
search participant (see SearchEngine.getDefaultSearchParticipant()),
the provided document's path must be a path ending with one of the
Java-like extensions
or with '.class'.
The given index location must represent a path in the file system to a file that either already exists or is going to be created. If it exists, it must be an index file, otherwise its data might be overwritten.
Clients are not expected to call this method.
indexResolvedDocument in class SearchParticipantdocument - the document to indexindexPath - the location in the file system to the indexpublic void resolveDocument(SearchDocument document)
SearchParticipantClients are not expected to call this method.
resolveDocument in class SearchParticipantdocument - the document to resolveSearchParticipant.indexResolvedDocument(org.aspectj.org.eclipse.jdt.core.search.SearchDocument, IPath),
SearchDocument.requireIndexingResolvedDocument()public void locateMatches(SearchDocument[] indexMatches, SearchPattern pattern, IJavaSearchScope scope, SearchRequestor requestor, IProgressMonitor monitor) throws CoreException
SearchParticipant
Note that a participant (e.g. a JSP participant) can pre-process the contents of the given documents,
create its own documents whose contents are Java compilation units and delegate the match location
to the default participant (see SearchEngine.getDefaultSearchParticipant()). Passing its own
SearchRequestor this participant can then map the match positions back to the original
contents, create its own matches and report them to the original requestor.
Implementors of this method should check the progress monitor
for cancelation when it is safe and appropriate to do so. The cancelation
request should be propagated to the caller by throwing
OperationCanceledException.
locateMatches in class SearchParticipantindexMatches - the documents to locate matches inpattern - the search pattern to use when locating matchesscope - the scope to limit the search torequestor - the requestor to report matches tomonitor - the progress monitor to report progress to,
or null if no progress should be reportedCoreException - if the requestor had problem accepting one of the matchespublic IPath[] selectIndexes(SearchPattern pattern, IJavaSearchScope scope)
SearchParticipantAn index location represents a path in the file system to a file that holds index information.
Clients are not expected to call this method.
selectIndexes in class SearchParticipantpattern - the search pattern to considerscope - the given search scopepublic IndexLocation[] selectIndexURLs(SearchPattern pattern, IJavaSearchScope scope)