org.eclipse.xtext.common.types.ui.query
Class QueryParticipant

java.lang.Object
  extended by org.eclipse.xtext.common.types.ui.query.QueryParticipant
All Implemented Interfaces:
org.eclipse.jdt.ui.search.IQueryParticipant

public class QueryParticipant
extends java.lang.Object
implements org.eclipse.jdt.ui.search.IQueryParticipant

Author:
Sebastian Zarnekow - Initial contribution and API

Constructor Summary
QueryParticipant(com.google.inject.Provider<IResourceDescriptions> resourceDescriptionsProvider, UIParticipant uiParticipant)
           
 
Method Summary
protected  JavaSearchHelper createSearchHelper(org.eclipse.jdt.ui.search.ISearchRequestor requestor)
           
 int estimateTicks(org.eclipse.jdt.ui.search.QuerySpecification query)
          Returns the number of units of work estimated.
 org.eclipse.jdt.ui.search.IMatchPresentation getUIParticipant()
          Gets the UI participant responsible for handling the display of elements not known to the Java search UI.
 void search(org.eclipse.jdt.ui.search.ISearchRequestor requestor, org.eclipse.jdt.ui.search.QuerySpecification query, org.eclipse.core.runtime.IProgressMonitor monitor)
          Executes the search described by the given querySpecification.
protected  void waitForBuild()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryParticipant

@Inject
public QueryParticipant(com.google.inject.Provider<IResourceDescriptions> resourceDescriptionsProvider,
                               UIParticipant uiParticipant)
Method Detail

search

public void search(org.eclipse.jdt.ui.search.ISearchRequestor requestor,
                   org.eclipse.jdt.ui.search.QuerySpecification query,
                   org.eclipse.core.runtime.IProgressMonitor monitor)
            throws org.eclipse.core.runtime.CoreException
Description copied from interface: org.eclipse.jdt.ui.search.IQueryParticipant
Executes the search described by the given querySpecification. Matches are reported to the given requester. The interpretation of what a given Java search (e.g. "References to class Foo") means is up to the participant.

Specified by:
search in interface org.eclipse.jdt.ui.search.IQueryParticipant
Parameters:
requestor - The requester to report matches to.
query - The specification of the query to run.
monitor - A monitor to report progress on.
Throws:
org.eclipse.core.runtime.CoreException - Thrown when the search can not be executed

createSearchHelper

protected JavaSearchHelper createSearchHelper(org.eclipse.jdt.ui.search.ISearchRequestor requestor)

waitForBuild

protected void waitForBuild()

estimateTicks

public int estimateTicks(org.eclipse.jdt.ui.search.QuerySpecification query)
Description copied from interface: org.eclipse.jdt.ui.search.IQueryParticipant
Returns the number of units of work estimated. The returned number should be normalized such that the number of ticks for the original Java search job is 1000. For example if the participant uses the same amount of time as the Java 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.

Specified by:
estimateTicks in interface org.eclipse.jdt.ui.search.IQueryParticipant
Parameters:
query - the specification to estimate.
Returns:
The number of ticks estimated.

getUIParticipant

public org.eclipse.jdt.ui.search.IMatchPresentation getUIParticipant()
Description copied from interface: org.eclipse.jdt.ui.search.IQueryParticipant
Gets the UI participant responsible for handling the display of elements not known to the Java search UI. The Java search UI knows elements are of type IJavaElement and IResource. A participant may return null if matches are only reported against elements of type IResource and IJavaElement.

Specified by:
getUIParticipant in interface org.eclipse.jdt.ui.search.IQueryParticipant
Returns:
The UI participant for this query participant or null.