public interface ISearchQuery
Represents a particular search query (in a Java example, a query might be "find all occurrences of 'foo' in workspace"). When its run method is called, the query places any results it finds in the
ISearchResultthat can be accessed via getSearchResult(). Note that
getSearchResultmay be called at any time, even before the
run()method has been called. An empty search result should be returned in that case.
Clients may implement this interface.
Method SummaryModifier and TypeMethodDescription
canRerun()Returns whether the query can be run more than once.
booleanReturns whether this query can be run in the background.
getLabel()Returns a user readable label for this query.Returns the search result associated with this query.This is the method that actually does the work, i.e. finds the results of the search query.
runThis is the method that actually does the work, i.e. finds the results of the search query.
monitor- the progress monitor to be used
- the status after completion of the search job.
OperationCanceledException- Thrown when the search query has been canceled.
getLabelString getLabel()Returns a user readable label for this query. This will be used, for example to set the
Jobname if this query is executed in the background. Note that progress notification (for example, the number of matches found) should be done via the progress monitor passed into the
- the user readable label of this query
canRerunboolean canRerun()Returns whether the query can be run more than once. Some queries may depend on transient information and return
- whether this query can be run more than once
canRunInBackgroundboolean canRunInBackground()Returns whether this query can be run in the background. Note that queries must do proper locking when they are run in the background (e.g. get the appropriate workspace locks).
- whether this query can be run in the background
getSearchResultISearchResult getSearchResult()Returns the search result associated with this query. This method can be called before run is called.
- this query's search result