org.eclipse.wst.jsdt.web.core.javascript.search
Class JsSearchSupport

java.lang.Object
  extended by org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchSupport

public class JsSearchSupport
extends java.lang.Object

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. (copied from JSP) Central access to java indexing and search. All contact between JDT indexing and Searching should be done through here. Clients should access the methods of this class via the single instance via getInstance().


Method Summary
 SearchDocument addJspFile(IFile file)
          schedules a search document representing this JSP file for indexing (by the java indexer)
 IPath computeIndexLocation(IPath containerPath)
           
static JsSearchSupport getInstance()
          Clients should access the methods of this class via the single instance via getInstance()
 IPath getModelJspPluginWorkingLocation()
           
 IPath getModelJspPluginWorkingLocation(IProject project)
           
 IProgressMonitor getProgressMonitor()
          JSP Indexing and Search jobs check this
 SearchDocument getSearchDocument(java.lang.String searchDocPath)
          Centralized place to access JSPSearchDocuments (used by JSPSearchParticipant and JSPSearchRequestor)
 boolean isCanceled()
          JSP Indexing and Search jobs check this
static boolean isJsp(IFile file)
          Utility method to check if a file is a jsp file (since this is done frequently)
 void search(IJavaScriptElement element, IJavaScriptSearchScope scope, SearchRequestor requestor)
          Search for an IJavaScriptElement, constrained by the given parameters.
 void search(java.lang.String searchText, IJavaScriptSearchScope scope, int searchFor, int limitTo, int matchMode, boolean isCaseSensitive, SearchRequestor requestor)
          Perform a java search w/ the given parameters.
 void searchRunnable(IJavaScriptElement element, IJavaScriptSearchScope scope, SearchRequestor requestor)
          Search for an IJavaScriptElement, constrained by the given parameters.
 void setCanceled(boolean cancel)
          JSP Indexing and Search jobs check this
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static JsSearchSupport getInstance()
Clients should access the methods of this class via the single instance via getInstance()

Returns:

isJsp

public static boolean isJsp(IFile file)
Utility method to check if a file is a jsp file (since this is done frequently)


addJspFile

public SearchDocument addJspFile(IFile file)
schedules a search document representing this JSP file for indexing (by the java indexer)

Parameters:
file - the JSP file
Returns:
true if indexing was successful, false otherwise
Throws:
CoreException

search

public void search(java.lang.String searchText,
                   IJavaScriptSearchScope scope,
                   int searchFor,
                   int limitTo,
                   int matchMode,
                   boolean isCaseSensitive,
                   SearchRequestor requestor)
Perform a java search w/ the given parameters. Runs in a background Job (results may still come in after this method call)

Parameters:
searchText - the string of text to search on
searchFor - IJavaScriptSearchConstants.TYPE, METHOD, FIELD, PACKAGE, etc...
limitTo - IJavaScriptSearchConstants.DECLARATIONS, IJavaScriptSearchConstants.REFERENCES, IJavaScriptSearchConstants.IMPLEMENTORS, or IJavaScriptSearchConstants.ALL_OCCURRENCES
matchMode - allow * wildcards or not
isCaseSensitive -
requestor - passed in to accept search matches (and do "something" with them)

search

public void search(IJavaScriptElement element,
                   IJavaScriptSearchScope scope,
                   SearchRequestor requestor)
Search for an IJavaScriptElement, constrained by the given parameters. Runs in a background Job (results may still come in after this method call)

Parameters:
element -
scope -
requestor -

searchRunnable

public void searchRunnable(IJavaScriptElement element,
                           IJavaScriptSearchScope scope,
                           SearchRequestor requestor)
Search for an IJavaScriptElement, constrained by the given parameters. Runs in an IWorkspace runnable (results will be reported by the end of this method)

Parameters:
element -
scope -
requestor -

getSearchDocument

public SearchDocument getSearchDocument(java.lang.String searchDocPath)
Centralized place to access JSPSearchDocuments (used by JSPSearchParticipant and JSPSearchRequestor)

Parameters:
searchDocPath -
doc -
Returns:
the JSPSearchDocument or null if one is not found

computeIndexLocation

public final IPath computeIndexLocation(IPath containerPath)

getModelJspPluginWorkingLocation

public IPath getModelJspPluginWorkingLocation(IProject project)

getModelJspPluginWorkingLocation

public IPath getModelJspPluginWorkingLocation()

setCanceled

public final void setCanceled(boolean cancel)
JSP Indexing and Search jobs check this


isCanceled

public final boolean isCanceled()
JSP Indexing and Search jobs check this

Returns:

getProgressMonitor

public final IProgressMonitor getProgressMonitor()
JSP Indexing and Search jobs check this

Returns: