public abstract class AbstractContainmentAdapter
extends java.lang.Object
implements org.eclipse.ui.IContainmentAdapter
IContainmentAdapter
for Handly-based models.
Each model may provide a containment adapter for its elements (via
an adapter factory). That adapter will then be used by the workbench
to test if a given resource is part of a working set for the model.
For instance, it will be used by ResourceWorkingSetFilter
.
getElementFor(IResource)
Constructor and Description |
---|
AbstractContainmentAdapter() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
check(IElement ancestor,
IElement descendent) |
protected boolean |
check(org.eclipse.core.resources.IResource ancestor,
org.eclipse.core.resources.IResource descendent) |
protected static boolean |
checkContext(int flags) |
protected static boolean |
checkIfAncestor(int flags) |
protected static boolean |
checkIfChild(int flags) |
protected static boolean |
checkIfDescendant(int flags) |
protected boolean |
contains(IElement workingSetElement,
IElement element,
int flags) |
protected boolean |
contains(IElement workingSetElement,
org.eclipse.core.resources.IResource resource,
int flags) |
boolean |
contains(java.lang.Object workingSetElement,
java.lang.Object element,
int flags) |
protected IContentAdapter |
getContentAdapter()
Returns the content adapter that defines a mapping between elements
of a Handly based model and the working set's content.
|
protected abstract IElement |
getElementFor(org.eclipse.core.resources.IResource resource)
Returns the model element corresponding to the given resource,
or
null if no such element can be found. |
public boolean contains(java.lang.Object workingSetElement, java.lang.Object element, int flags)
contains
in interface org.eclipse.ui.IContainmentAdapter
protected abstract IElement getElementFor(org.eclipse.core.resources.IResource resource)
null
if no such element can be found.resource
- the underlying resource (never null
)null
if no such element can be foundprotected IContentAdapter getContentAdapter()
Default implementation returns a NullContentAdapter
.
Subclasses may override.
IContentAdapter
(never null
)protected boolean contains(IElement workingSetElement, org.eclipse.core.resources.IResource resource, int flags)
protected boolean check(org.eclipse.core.resources.IResource ancestor, org.eclipse.core.resources.IResource descendent)
protected static boolean checkContext(int flags)
protected static boolean checkIfChild(int flags)
protected static boolean checkIfAncestor(int flags)
protected static boolean checkIfDescendant(int flags)