Package org.eclipse.ui.internal
Class AbstractWorkingSet
java.lang.Object
org.eclipse.ui.internal.AbstractWorkingSet
- All Implemented Interfaces:
Cloneable
,IAdaptable
,IPersistable
,IPersistableElement
,IWorkingSet
- Direct Known Subclasses:
AggregateWorkingSet
,WorkingSet
public abstract class AbstractWorkingSet
extends Object
implements IAdaptable, IWorkingSet, Cloneable
Abstract baseclass for IWorkingSet implementations.
- Since:
- 3.2
-
Field Summary
Modifier and TypeFieldDescriptionprotected List<IAdaptable>
protected static final String
protected IMemento
-
Constructor Summary
ConstructorDescriptionAbstractWorkingSet
(String name, String label) Create a new instance of this class -
Method Summary
Modifier and TypeMethodDescriptionprotected AbstractWorkingSet
clone()
void
connect
(IWorkingSetManager manager) Connect this working set to a manger.void
Disconnect this working set from its manager, if any.protected void
fireWorkingSetChanged
(String property, Object oldValue) <T> T
getAdapter
(Class<T> adapter) Returns the receiver if the requested type is either IWorkingSet or IPersistableElement.Returns the elements that are contained in this working set.protected List<IAdaptable>
Returns the elements array list.Returns the id of the element factory which should be used to re-create this object.final ImageDescriptor
getImage()
Returns the working set icon.getLabel()
Return the name of this working set, formated for the end user.protected IWorkingSetManager
getName()
Returns the name of the working set.protected void
internalSetElements
(IAdaptable[] newElements) Create a copy of the elements to store in the receiver.boolean
isEmpty()
Returns whether this working set is currently empty (has no elements).void
Set the name of this working set, formated for the end user.void
Sets the name of the working set.Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.ui.IPersistable
saveState
Methods inherited from interface org.eclipse.ui.IWorkingSet
adaptElements, getId, getImageDescriptor, isAggregateWorkingSet, isEditable, isSelfUpdating, isVisible, setElements, setId
-
Field Details
-
FACTORY_ID
- See Also:
-
elements
-
workingSetMemento
-
-
Constructor Details
-
AbstractWorkingSet
Create a new instance of this class- Parameters:
name
- the unique name for this working setlabel
- the user-friendly name for this working set
-
-
Method Details
-
getAdapter
Returns the receiver if the requested type is either IWorkingSet or IPersistableElement.- Specified by:
getAdapter
in interfaceIAdaptable
- Type Parameters:
T
- the class type- Parameters:
adapter
- the requested type- Returns:
- the receiver if the requested type is either IWorkingSet or IPersistableElement.
-
getName
Description copied from interface:IWorkingSet
Returns the name of the working set.- Specified by:
getName
in interfaceIWorkingSet
- Returns:
- the name of the working set
-
setName
Description copied from interface:IWorkingSet
Sets the name of the working set. The working set name should be unique. The working set name must not have leading or trailing whitespace.- Specified by:
setName
in interfaceIWorkingSet
- Parameters:
newName
- the name of the working set
-
connect
Connect this working set to a manger.- Parameters:
manager
- the manager to connect to
-
disconnect
public void disconnect()Disconnect this working set from its manager, if any. -
fireWorkingSetChanged
-
internalSetElements
Create a copy of the elements to store in the receiver.- Parameters:
newElements
- the elements to store a copy of in the receiver.
-
getElements
Description copied from interface:IWorkingSet
Returns the elements that are contained in this working set.This method might throw an
IllegalStateException
if the working set is invalid.- Specified by:
getElements
in interfaceIWorkingSet
- Returns:
- the working set's elements
-
getElementsArray
Returns the elements array list. Lazily restores the elements from persistence memento.- Returns:
- the elements array list
-
getManager
-
getFactoryId
Description copied from interface:IPersistableElement
Returns the id of the element factory which should be used to re-create this object.Factory ids are declared in extensions to the standard extension point
"org.eclipse.ui.elementFactories"
.- Specified by:
getFactoryId
in interfaceIPersistableElement
- Returns:
- the element factory id
- See Also:
-
getLabel
Description copied from interface:IWorkingSet
Return the name of this working set, formated for the end user. Often this value is the same as the one returned fromIWorkingSet.getName()
.- Specified by:
getLabel
in interfaceIWorkingSet
- Returns:
- the name of this working set, formated for the end user
-
setLabel
Description copied from interface:IWorkingSet
Set the name of this working set, formated for the end user.- Specified by:
setLabel
in interfaceIWorkingSet
- Parameters:
label
- the label for this working set. Ifnull
is supplied then the value ofIWorkingSet.getName()
will be used.
-
isEmpty
public boolean isEmpty()Description copied from interface:IWorkingSet
Returns whether this working set is currently empty (has no elements).- Specified by:
isEmpty
in interfaceIWorkingSet
- Returns:
- whether this working set is currently empty
-
getImage
Description copied from interface:IWorkingSet
Returns the working set icon. Currently, this is one of the icons specified in the extensions of the org.eclipse.ui.workingSets extension point. The extension is identified using the value returned bygetId()
. Returnsnull
if no icon has been specified in the extension or ifgetId()
returnsnull
.- Specified by:
getImage
in interfaceIWorkingSet
- Returns:
- the working set icon or
null
.
-
clone
-