Klasse JavaSearchParticipant
- Alle implementierten Schnittstellen:
IParallelizable
-
Konstruktorübersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
Notification that this participant's help is needed in a search.void
Notification that this participant's help is no longer needed.Returns a displayable name of this search participant.getDocument
(String documentPath) Returns a search document for the given path.void
indexDocument
(SearchDocument document, org.eclipse.core.runtime.IPath indexPath) Indexes the given document in the given index.void
indexResolvedDocument
(SearchDocument document, org.eclipse.core.runtime.IPath indexPath) Indexes the given resolved document in the given index.boolean
Answerstrue
if the current instance supports parallel index searchvoid
locateMatches
(SearchDocument[] indexMatches, SearchPattern pattern, IJavaSearchScope scope, SearchRequestor requestor, org.eclipse.core.runtime.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.org.eclipse.core.runtime.IPath[]
selectIndexes
(SearchPattern pattern, IJavaSearchScope scope) Returns the collection of index locations to consider when performing the given search query in the given scope.selectIndexURLs
(SearchPattern pattern, IJavaSearchScope scope) Von Klasse geerbte Methoden org.aspectj.org.eclipse.jdt.core.search.SearchParticipant
removeIndex, scheduleDocumentIndexing
Von Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Von Schnittstelle geerbte Methoden org.aspectj.org.eclipse.jdt.core.search.IParallelizable
initBeforeSearch
-
Konstruktordetails
-
JavaSearchParticipant
public JavaSearchParticipant()
-
-
Methodendetails
-
beginSearching
public void beginSearching()Beschreibung aus Klasse kopiert:SearchParticipant
Notification that this participant's help is needed in a search.This method should be re-implemented in subclasses that need to do something when the participant is needed in a search.
- Setzt außer Kraft:
beginSearching
in KlasseSearchParticipant
-
doneSearching
public void doneSearching()Beschreibung aus Klasse kopiert:SearchParticipant
Notification that this participant's help is no longer needed.This method should be re-implemented in subclasses that need to do something when the participant is no longer needed in a search.
- Setzt außer Kraft:
doneSearching
in KlasseSearchParticipant
-
getDescription
Beschreibung aus Klasse kopiert:SearchParticipant
Returns a displayable name of this search participant.This method should be re-implemented in subclasses that need to display a meaningful name.
- Setzt außer Kraft:
getDescription
in KlasseSearchParticipant
- Gibt zurück:
- the displayable name of this search participant
-
getDocument
Beschreibung aus Klasse kopiert:SearchParticipant
Returns a search document for the given path. The given document path is a string that uniquely identifies the document. Most of the time it is a workspace-relative path, but it can also be a file system path, or a path inside a zip file.Implementors of this method can either create an instance of their own subclass of
SearchDocument
or return an existing instance of such a subclass.- Angegeben von:
getDocument
in KlasseSearchParticipant
- Parameter:
documentPath
- the path of the document.- Gibt zurück:
- a search document
-
indexDocument
Beschreibung aus Klasse kopiert:SearchParticipant
Indexes the given document in the given index. A search participant asked to index a document should parse it and callSearchDocument.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 (seeSearchEngine.getDefaultSearchParticipant()
), the provided document's path must be a path ending with one of theJava-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.
- Angegeben von:
indexDocument
in KlasseSearchParticipant
- Parameter:
document
- the document to indexindexPath
- the location in the file system to the index
-
indexResolvedDocument
public void indexResolvedDocument(SearchDocument document, org.eclipse.core.runtime.IPath indexPath) Beschreibung aus Klasse kopiert:SearchParticipant
Indexes the given resolved document in the given index. A search participant asked to index a resolved document should process it and callSearchDocument.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 toSearchParticipant.indexDocument(org.aspectj.org.eclipse.jdt.core.search.SearchDocument, org.eclipse.core.runtime.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 (seeSearchEngine.getDefaultSearchParticipant()
), the provided document's path must be a path ending with one of theJava-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.
- Setzt außer Kraft:
indexResolvedDocument
in KlasseSearchParticipant
- Parameter:
document
- the document to indexindexPath
- the location in the file system to the index
-
resolveDocument
Beschreibung aus Klasse kopiert:SearchParticipant
Resolves the given document. A search participant asked to resolve a document should parse it and resolve the types and preserve enough state to be able to tend to a indexResolvedDocument call subsequently. This API is invoked without holding any index related locks or monitors.Clients are not expected to call this method.
- Setzt außer Kraft:
resolveDocument
in KlasseSearchParticipant
- Parameter:
document
- the document to resolve- Siehe auch:
-
locateMatches
public void locateMatches(SearchDocument[] indexMatches, SearchPattern pattern, IJavaSearchScope scope, SearchRequestor requestor, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException Beschreibung aus Klasse kopiert:SearchParticipant
Locates the matches in the given documents using the given search pattern and search scope, and reports them to the given search requestor. This method is called by the search engine once it has search documents matching the given pattern in the given search scope.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 ownSearchRequestor
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
.- Angegeben von:
locateMatches
in KlasseSearchParticipant
- Parameter:
indexMatches
- 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, ornull
if no progress should be reported- Löst aus:
org.eclipse.core.runtime.CoreException
- if the requestor had problem accepting one of the matches
-
selectIndexes
public org.eclipse.core.runtime.IPath[] selectIndexes(SearchPattern pattern, IJavaSearchScope scope) Beschreibung aus Klasse kopiert:SearchParticipant
Returns the collection of index locations to consider when performing the given search query in the given scope. The search engine calls this method before locating matches.An index location represents a path in the file system to a file that holds index information.
Clients are not expected to call this method.
- Angegeben von:
selectIndexes
in KlasseSearchParticipant
- Parameter:
pattern
- the search pattern to considerscope
- the given search scope- Gibt zurück:
- the collection of index paths to consider
-
selectIndexURLs
-
isParallelSearchSupported
public boolean isParallelSearchSupported()Beschreibung aus Schnittstelle kopiert:IParallelizable
Answerstrue
if the current instance supports parallel index search- Angegeben von:
isParallelSearchSupported
in SchnittstelleIParallelizable
- Gibt zurück:
- Returns
true
if the implementation is safe to be used in a parallel search.
-