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
FieldsModifier and TypeFieldDescriptionprotected List<IAdaptable> protected static final Stringprotected IMemento -
Constructor Summary
ConstructorsConstructorDescriptionAbstractWorkingSet(String name, String label) Create a new instance of this class -
Method Summary
Modifier and TypeMethodDescriptionprotected AbstractWorkingSetclone()voidconnect(IWorkingSetManager manager) Connect this working set to a manger.voidDisconnect this working set from its manager, if any.protected voidfireWorkingSetChanged(String property, Object oldValue) <T> TgetAdapter(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 ImageDescriptorgetImage()Returns the working set icon.getLabel()Return the name of this working set, formated for the end user.protected IWorkingSetManagergetName()Returns the name of the working set.protected voidinternalSetElements(IAdaptable[] newElements) Create a copy of the elements to store in the receiver.booleanisEmpty()Returns whether this working set is currently empty (has no elements).voidSet the name of this working set, formated for the end user.voidSets the name of the working set.Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.ui.IPersistable
saveStateMethods 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:
getAdapterin 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:IWorkingSetReturns the name of the working set.- Specified by:
getNamein interfaceIWorkingSet- Returns:
- the name of the working set
-
setName
Description copied from interface:IWorkingSetSets 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:
setNamein 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:IWorkingSetReturns the elements that are contained in this working set.This method might throw an
IllegalStateExceptionif the working set is invalid.- Specified by:
getElementsin 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:IPersistableElementReturns 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:
getFactoryIdin interfaceIPersistableElement- Returns:
- the element factory id
- See Also:
-
getLabel
Description copied from interface:IWorkingSetReturn 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:
getLabelin interfaceIWorkingSet- Returns:
- the name of this working set, formated for the end user
-
setLabel
Description copied from interface:IWorkingSetSet the name of this working set, formated for the end user.- Specified by:
setLabelin interfaceIWorkingSet- Parameters:
label- the label for this working set. Ifnullis supplied then the value ofIWorkingSet.getName()will be used.
-
isEmpty
public boolean isEmpty()Description copied from interface:IWorkingSetReturns whether this working set is currently empty (has no elements).- Specified by:
isEmptyin interfaceIWorkingSet- Returns:
- whether this working set is currently empty
-
getImage
Description copied from interface:IWorkingSetReturns 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(). Returnsnullif no icon has been specified in the extension or ifgetId()returnsnull.- Specified by:
getImagein interfaceIWorkingSet- Returns:
- the working set icon or
null.
-
clone
-