public interface IJavaScriptSearchScope
IJavaScriptSearchScope
defines where search result should be found by a
SearchEngine
. Clients must pass an instance of this interface
to the search(...)
methods. Such an instance can be created using the
following factory methods on SearchEngine
: createHierarchyScope(IType)
,
createJavaSearchScope(IResource[])
, createWorkspaceScope()
, or
clients may choose to 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.Modifier and Type | Field and Description |
---|---|
static int |
APPLICATION_LIBRARIES
Include type constant (bit mask) indicating that application libraries should be considered in the search scope.
|
static java.lang.String |
JAR_FILE_ENTRY_SEPARATOR
This constant defines the separator of the resourcePath string of the
encloses(String)
method. |
static int |
REFERENCED_PROJECTS
Include type constant (bit mask) indicating that referenced projects should be considered in the search scope.
|
static int |
SOURCES
Include type constant (bit mask) indicating that source folders should be considered in the search scope.
|
static int |
SYSTEM_LIBRARIES
Include type constant (bit mask) indicating that system libraries should be considered in the search scope.
|
Modifier and Type | Method and Description |
---|---|
boolean |
encloses(IJavaScriptElement element)
Checks whether this scope encloses the given element.
|
boolean |
encloses(java.lang.String resourcePath)
Checks whether the resource at the given path is enclosed by this scope.
|
IPath[] |
enclosingProjectsAndJars()
Returns the paths to the enclosing projects and JARs for this search scope.
|
boolean |
shouldExclude(java.lang.String container,
java.lang.String resourceName) |
static final java.lang.String JAR_FILE_ENTRY_SEPARATOR
encloses(String)
method. If present in the string, it separates the path to the jar file from the path
to the .class file in the jar.static final int SOURCES
static final int APPLICATION_LIBRARIES
static final int SYSTEM_LIBRARIES
static final int REFERENCED_PROJECTS
boolean encloses(java.lang.String resourcePath)
resourcePath
- if the resource is contained in
a JAR file, the path is composed of 2 paths separated
by JAR_FILE_ENTRY_SEPARATOR
: the first path is the full OS path
to the JAR (if it is an external JAR), or the workspace relative IPath
to the JAR (if it is an internal JAR),
the second path is the path to the resource inside the JAR.boolean encloses(IJavaScriptElement element)
element
- the given elementtrue
if the element is in this scopeIPath[] enclosingProjectsAndJars()
IResource.getFullPath()
).
For example, /MyProject
IResource.getFullPath()
).
For example, /MyProject/mylib.jar
boolean shouldExclude(java.lang.String container, java.lang.String resourceName)
Copyright (c) IBM Corp. and others 2000, 2010. All Rights Reserved.