public abstract class AbstractWorkingSetElementAdapter
extends java.lang.Object
implements org.eclipse.ui.IWorkingSetElementAdapter
IWorkingSetElementAdapter
.
Instances of this class are capable of transforming possible
working set content into the most applicable form.
Each model may opt to provide an element adapter for its working sets
(via the elementAdapterClass
attribute of the
org.eclipse.ui.workingSets
extension point).
That adapter will then be used by the workbench to help manage addition
of elements to working sets for the model.
Constructor and Description |
---|
AbstractWorkingSetElementAdapter() |
Modifier and Type | Method and Description |
---|---|
org.eclipse.core.runtime.IAdaptable[] |
adaptElements(org.eclipse.ui.IWorkingSet ws,
org.eclipse.core.runtime.IAdaptable[] elements) |
protected abstract org.eclipse.core.runtime.IAdaptable |
adaptFromResource(org.eclipse.core.resources.IResource resource)
Tries to adapt the given resource to the corresponding element of the model.
|
void |
dispose() |
protected abstract boolean |
isModelElement(org.eclipse.core.runtime.IAdaptable element)
Returns whether the given element is native to the model.
|
protected void |
postProcess(java.util.Collection<org.eclipse.core.runtime.IAdaptable> result)
Post-processes the collection of elements to be returned by
adaptElements(org.eclipse.ui.IWorkingSet, org.eclipse.core.runtime.IAdaptable[]) method. |
public org.eclipse.core.runtime.IAdaptable[] adaptElements(org.eclipse.ui.IWorkingSet ws, org.eclipse.core.runtime.IAdaptable[] elements)
adaptElements
in interface org.eclipse.ui.IWorkingSetElementAdapter
public void dispose()
dispose
in interface org.eclipse.ui.IWorkingSetElementAdapter
protected abstract boolean isModelElement(org.eclipse.core.runtime.IAdaptable element)
element
- (never null
)true
if the given element is native to the model;
false
otherwiseprotected abstract org.eclipse.core.runtime.IAdaptable adaptFromResource(org.eclipse.core.resources.IResource resource)
resource
- the resource to adapt (never null
)protected void postProcess(java.util.Collection<org.eclipse.core.runtime.IAdaptable> result)
adaptElements(org.eclipse.ui.IWorkingSet, org.eclipse.core.runtime.IAdaptable[])
method.
Default implementation does nothing. Subclasses may override.
result
- the collection of elements to post-process