public class HierarchyScope extends AbstractSearchScope implements SuffixConstants
| Modifier and Type | Field and Description |
|---|---|
protected int |
elementCount |
protected IResource[] |
elements |
IType |
focusType |
boolean |
needsRefresh |
EXTENSION_aj, EXTENSION_AJ, EXTENSION_class, EXTENSION_CLASS, EXTENSION_java, EXTENSION_JAVA, SUFFIX_aj, SUFFIX_AJ, SUFFIX_class, SUFFIX_CLASS, SUFFIX_java, SUFFIX_JAVA, SUFFIX_STRING_aj, SUFFIX_STRING_AJ, SUFFIX_STRING_class, SUFFIX_STRING_CLASS, SUFFIX_STRING_java, SUFFIX_STRING_JAVAAPPLICATION_LIBRARIES, JAR_FILE_ENTRY_SEPARATOR, REFERENCED_PROJECTS, SOURCES, SYSTEM_LIBRARIES| Constructor and Description |
|---|
HierarchyScope(IJavaProject project,
IType type,
WorkingCopyOwner owner,
boolean onlySubtypes,
boolean noMembersOrEnclosingTypes,
boolean includeFocusType)
Creates a new hierarchy scope for the given type with the given configuration options.
|
HierarchyScope(IType type,
WorkingCopyOwner owner) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(IResource element) |
boolean |
encloses(IJavaElement element)
Checks whether this scope encloses the given element.
|
boolean |
encloses(IJavaElement element,
IProgressMonitor progressMonitor) |
boolean |
encloses(java.lang.String resourcePath)
Checks whether the resource at the given path is enclosed by this scope.
|
boolean |
encloses(java.lang.String resourcePath,
IProgressMonitor progressMonitor) |
boolean |
enclosesFineGrained(IJavaElement element)
Optionally perform additional checks after element has already passed matching based on index/documents.
|
IPath[] |
enclosingProjectsAndJars()
Returns the paths to the enclosing projects and JARs for this search scope.
|
protected void |
initialize() |
protected void |
initialize(IProgressMonitor progressMonitor) |
void |
processDelta(IJavaElementDelta delta,
int eventType) |
protected void |
refresh() |
protected void |
refresh(IProgressMonitor progressMonitor) |
java.lang.String |
toString() |
includesBinaries, includesClasspaths, setIncludesBinaries, setIncludesClasspathspublic IType focusType
protected IResource[] elements
protected int elementCount
public boolean needsRefresh
public HierarchyScope(IJavaProject project, IType type, WorkingCopyOwner owner, boolean onlySubtypes, boolean noMembersOrEnclosingTypes, boolean includeFocusType) throws JavaModelException
project - constrain the search result to this project,
or null if search should consider all types in the workspacetype - the focus type of the hierarchyowner - the owner of working copies that take precedence over original compilation units,
or null if the primary working copy owner should be usedonlySubtypes - if true search only subtypes of 'type'noMembersOrEnclosingTypes - if true the hierarchy is strict,
i.e., no additional member types or enclosing types of types spanning the hierarchy are included,
otherwise all member and enclosing types of types in the hierarchy are included.includeFocusType - if true the focus type type is included in the resulting scope, otherwise it is excludedJavaModelExceptionpublic HierarchyScope(IType type, WorkingCopyOwner owner) throws JavaModelException
JavaModelExceptionpublic void add(IResource element)
public boolean encloses(java.lang.String resourcePath)
IJavaSearchScopeencloses in interface IJavaSearchScoperesourcePath - 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.public boolean encloses(java.lang.String resourcePath,
IProgressMonitor progressMonitor)
public boolean enclosesFineGrained(IJavaElement element)
element - the given elementtrue if the element is enclosed or if no fine grained checking
(regarding subtypes and members) is requestedpublic boolean encloses(IJavaElement element)
IJavaSearchScopeencloses in interface IJavaSearchScopeelement - the given elementtrue if the element is in this scopepublic boolean encloses(IJavaElement element, IProgressMonitor progressMonitor)
public IPath[] enclosingProjectsAndJars()
IJavaSearchScopeIResource.getFullPath()).
For example, /MyProject
IResource.getFullPath()).
For example, /MyProject/mylib.jar
enclosingProjectsAndJars in interface IJavaSearchScopeprotected void initialize()
throws JavaModelException
JavaModelExceptionprotected void initialize(IProgressMonitor progressMonitor)
throws JavaModelException
JavaModelExceptionpublic void processDelta(IJavaElementDelta delta, int eventType)
processDelta in class AbstractSearchScopeprotected void refresh()
throws JavaModelException
JavaModelExceptionprotected void refresh(IProgressMonitor progressMonitor)
throws JavaModelException
JavaModelExceptionpublic java.lang.String toString()
toString in class java.lang.Object