org.eclipse.wst.jsdt.ui.search
Interface IQueryParticipant


public interface IQueryParticipant

This is the interface expected of extensions to the extension point org.eclipse.wst.jsdt.ui.queryParticipants.

A IQueryParticipant is called during the execution of a JavaScript search query. It can report matches via an ISearchRequestor and may contribute a IMatchPresentation to help render the elements it contributes.

Clients may implement this interface.

Provisional API: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.


Method Summary
 int estimateTicks(QuerySpecification specification)
          Returns the number of units of work estimated.
 IMatchPresentation getUIParticipant()
          Gets the UI participant responsible for handling the display of elements not known to the JavaScript search UI.
 void search(ISearchRequestor requestor, QuerySpecification querySpecification, IProgressMonitor monitor)
          Executes the search described by the given querySpecification.
 

Method Detail

search

void search(ISearchRequestor requestor,
            QuerySpecification querySpecification,
            IProgressMonitor monitor)
            throws CoreException
Executes the search described by the given querySpecification. Matches are reported to the given requester. The interpretation of what a given JavaScript search (e.g. "References to class Foo") means is up to the participant.

Parameters:
requestor - The requester to report matches to.
querySpecification - The specification of the query to run.
monitor - A monitor to report progress on.
Throws:
CoreException - Thrown when the search can not be executed

estimateTicks

int estimateTicks(QuerySpecification specification)
Returns the number of units of work estimated. The returned number should be normalized such that the number of ticks for the original JavaScript search job is 1000. For example if the participant uses the same amount of time as the JavaScript search, it should return 1000, if it uses half the time, it should return 500, etc. This method is supposed to give a quick estimate of the work to be done and is assumed to be much faster than the actual query.

Parameters:
specification - the specification to estimate.
Returns:
The number of ticks estimated.

getUIParticipant

IMatchPresentation getUIParticipant()
Gets the UI participant responsible for handling the display of elements not known to the JavaScript search UI. The JavaScript search UI knows elements are of type IJavaScriptElement and IResource. A participant may return null if matches are only reported against elements of type IResource and IJavaScriptElement.

Returns:
The UI participant for this query participant or null.