org.eclipse.wst.jsdt.web.core.javascript.search
Class JsSearchScope
java.lang.Object
org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchScope
- All Implemented Interfaces:
- IJavaScriptSearchScope
public class JsSearchScope
- extends java.lang.Object
- implements IJavaScriptSearchScope
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)
Used to constrain JSP/java search to certain paths and elements.
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JsSearchScope
public JsSearchScope()
JsSearchScope
public JsSearchScope(java.lang.String[] resourceStringPath)
JsSearchScope
public JsSearchScope(IJavaScriptElement[] javaElement)
encloses
public boolean encloses(java.lang.String resourcePathString)
- Description copied from interface:
IJavaScriptSearchScope
- Checks whether the resource at the given path is enclosed by this scope.
- Specified by:
encloses
in interface IJavaScriptSearchScope
- Parameters:
resourcePathString
- 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.
- Returns:
- whether the resource is enclosed by this scope
encloses
public boolean encloses(IJavaScriptElement element)
- Description copied from interface:
IJavaScriptSearchScope
- Checks whether this scope encloses the given element.
- Specified by:
encloses
in interface IJavaScriptSearchScope
- Parameters:
element
- the given element
- Returns:
true
if the element is in this scope
addPath
public void addPath(java.lang.String path)
addElement
public void addElement(IJavaScriptElement element)
getDescription
public java.lang.String getDescription()
enclosingProjectsAndJars
public IPath[] enclosingProjectsAndJars()
- Description copied from interface:
IJavaScriptSearchScope
- Returns the paths to the enclosing projects and JARs for this search scope.
- If the path is a project path, this is the full path of the project
(see
IResource.getFullPath()
).
For example, /MyProject
- If the path is a JAR path and this JAR is internal to the workspace,
this is the full path of the JAR file (see
IResource.getFullPath()
).
For example, /MyProject/mylib.jar
- If the path is a JAR path and this JAR is external to the workspace,
this is the full OS path to the JAR file on the file system.
For example, d:\libs\mylib.jar
- Specified by:
enclosingProjectsAndJars
in interface IJavaScriptSearchScope
- Returns:
- an array of paths to the enclosing projects and JARS.
shouldExclude
public boolean shouldExclude(java.lang.String container,
java.lang.String resourceName)
- Specified by:
shouldExclude
in interface IJavaScriptSearchScope