com.adobe.flexbuilder.codemodel.search
Class SearchScope

java.lang.Object
  extended bycom.adobe.flexbuilder.codemodel.search.SearchScope

public class SearchScope
extends java.lang.Object

SearcScopes tell the ISearchIndex the context of what the should search. They relate the base file in which to begin our search and the context in which to constrain our search

Author:
david

Nested Class Summary
static class SearchScope.SearchContext
          Tells the ISearchIndex the context in which to search
 
Field Summary
static SearchScope.SearchContext FILE_CONTEXT
          Context that specifies we should only search in a given file
static SearchScope.SearchContext PROJECT_CONTEXT
          Context that specifies we should only search in a given project, including class path entries
static SearchScope.SearchContext PROJECT_CONTEXT_NO_CLASSPATH
          Unit test only
static SearchScope.SearchContext WORKSPACE_CONTEXT
          Context that specifies we should search across the entire workspace
 
Method Summary
static SearchScope createFileScope(org.eclipse.core.resources.IFile file)
          Creates a SearchScope that only searches across a specific file
static SearchScope createProjectScope(org.eclipse.core.resources.IFile file)
          Creates a SearchScope that only searches across a given project where the IFile is located
static SearchScope createWorkspaceScope(org.eclipse.core.resources.IFile file)
          Creates a SearchScope that searches across the entire workspace
 SearchScope.SearchContext getContext()
           
 org.eclipse.core.resources.IFile getFile()
           
 org.eclipse.core.runtime.IPath getPath()
           
 void setIPath(org.eclipse.core.runtime.IPath path)
          Sets the IPath of the base location of our scope
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILE_CONTEXT

public static final SearchScope.SearchContext FILE_CONTEXT
Context that specifies we should only search in a given file


PROJECT_CONTEXT

public static final SearchScope.SearchContext PROJECT_CONTEXT
Context that specifies we should only search in a given project, including class path entries


WORKSPACE_CONTEXT

public static final SearchScope.SearchContext WORKSPACE_CONTEXT
Context that specifies we should search across the entire workspace


PROJECT_CONTEXT_NO_CLASSPATH

public static final SearchScope.SearchContext PROJECT_CONTEXT_NO_CLASSPATH
Unit test only

Method Detail

getFile

public org.eclipse.core.resources.IFile getFile()
Returns:
the IFile we began our search in

setIPath

public void setIPath(org.eclipse.core.runtime.IPath path)
Sets the IPath of the base location of our scope

Parameters:
path -

getPath

public org.eclipse.core.runtime.IPath getPath()
Returns:
the IPath of our base search location

getContext

public SearchScope.SearchContext getContext()
Returns:
the SearchScope.SearchContext for this search

createFileScope

public static SearchScope createFileScope(org.eclipse.core.resources.IFile file)
Creates a SearchScope that only searches across a specific file

Parameters:
file - the IFile we should search in
Returns:
a new SearchScope

createProjectScope

public static SearchScope createProjectScope(org.eclipse.core.resources.IFile file)
Creates a SearchScope that only searches across a given project where the IFile is located

Parameters:
file - the IFile we should determine our project from
Returns:
a new SearchScope

createWorkspaceScope

public static SearchScope createWorkspaceScope(org.eclipse.core.resources.IFile file)
Creates a SearchScope that searches across the entire workspace

Parameters:
file - the IFile we should begin our search in
Returns:
a new SearchScope