SearchRequestor replaces this interface.public interface IJavaSearchResultCollector
IJavaSearchResultCollector collects search results from a search
query to a SearchEngine. Clients must implement this interface and pass
an instance to the search(...) methods. When a search starts, the aboutToStart()
method is called, then 0 or more call to accept(...) are done, finally the
done() method is called.
Results provided to this collector may be accurate - in this case they have an EXACT_MATCH accuracy -
or they might be potential matches only - they have a POTENTIAL_MATCH accuracy. This last
case can occur when a problem prevented the SearchEngine from resolving the match.
The order of the results is unspecified. Clients must not rely on this order to display results, but they should sort these results (for example, in syntactical order).
The IJavaSearchResultCollector is also used to provide a progress monitor to the
SearchEngine.
Clients may implement this interface.
SearchEngine| Modifier and Type | Field and Description |
|---|---|
static int |
EXACT_MATCH
Deprecated.
Use
SearchMatch.A_ACCURATE instead. |
static int |
POTENTIAL_MATCH
Deprecated.
Use
SearchMatch.A_INACCURATE instead. |
| Modifier and Type | Method and Description |
|---|---|
void |
aboutToStart()
Deprecated.
Replaced by
SearchRequestor.beginReporting(). |
void |
accept(IResource resource,
int start,
int end,
IJavaElement enclosingElement,
int accuracy)
Deprecated.
Replaced by
SearchRequestor.acceptSearchMatch(SearchMatch). |
void |
done()
Deprecated.
Replaced by
SearchRequestor.endReporting(). |
IProgressMonitor |
getProgressMonitor()
Deprecated.
Returns the progress monitor used to report progress.
|
static final int EXACT_MATCH
SearchMatch.A_ACCURATE instead.static final int POTENTIAL_MATCH
SearchMatch.A_INACCURATE instead.void aboutToStart()
SearchRequestor.beginReporting().void accept(IResource resource, int start, int end, IJavaElement enclosingElement, int accuracy) throws CoreException
SearchRequestor.acceptSearchMatch(SearchMatch).resource - the resource in which the match has been foundstart - the start position of the match, -1 if it is unknownend - the end position of the match, -1 if it is unknown;
the ending offset is exclusive, meaning that the actual range of characters
covered is [start, end]enclosingElement - the Java element that contains the character range
[start, end]; the value can be null indicating that
no enclosing Java element has been foundaccuracy - the level of accuracy the search result has; either
EXACT_MATCH or POTENTIAL_MATCHCoreException - if this collector had a problem accepting the search resultvoid done()
SearchRequestor.endReporting().IProgressMonitor getProgressMonitor()
Copyright (c) IBM Corp. and others 2000, 2006. All Rights Reserved.