Package org.eclipse.ui.internal
Class WorkingSet
java.lang.Object
org.eclipse.ui.internal.AbstractWorkingSet
org.eclipse.ui.internal.WorkingSet
- All Implemented Interfaces:
Cloneable
,IAdaptable
,IPersistable
,IPersistableElement
,IWorkingSet
A working set holds a number of IAdaptable elements. A working set is
intended to group elements for presentation to the user or for operations on
a set of elements.
- Since:
- 2.0
- See Also:
-
Field Summary
Fields inherited from class org.eclipse.ui.internal.AbstractWorkingSet
elements, FACTORY_ID, workingSetMemento
-
Constructor Summary
ModifierConstructorDescriptionWorkingSet
(String name, String label, IAdaptable[] elements) Creates a new working set.protected
WorkingSet
(String name, String label, IMemento memento) Creates a new working set from a memento. -
Method Summary
Modifier and TypeMethodDescriptionadaptElements
(IAdaptable[] objects) Transforms the supplied elements into elements that are suitable for containment in this working set.boolean
Tests the receiver and the object for equalitygetId()
Returns the working set id.Returns the working set icon.int
hashCode()
Returns the hash code.boolean
Returns whether this working set is an aggregate working set or not.boolean
Returns whether this working set can be edited or not.boolean
Returnstrue
if this working set is capable of updating itself and reacting to changes in the state of its members.boolean
Returns whether this working set should be shown in user interface components that list working sets by name.void
Implements IPersistableElement.void
setElements
(IAdaptable[] newElements) Sets the elements that are contained in this working set.void
Sets the working set id.toString()
Methods inherited from class org.eclipse.ui.internal.AbstractWorkingSet
clone, connect, disconnect, fireWorkingSetChanged, getAdapter, getElements, getElementsArray, getFactoryId, getImage, getLabel, getManager, getName, internalSetElements, isEmpty, setLabel, setName
-
Constructor Details
-
WorkingSet
Creates a new working set.- Parameters:
name
- the name of the new working set. Should not have leading or trailing whitespace.label
- the label of the new working setelements
- the content of the new working set. May be empty but notnull
.
-
WorkingSet
Creates a new working set from a memento.- Parameters:
name
- the name of the new working set. Should not have leading or trailing whitespace.memento
- persistence memento containing the elements of the working set.
-
-
Method Details
-
equals
Tests the receiver and the object for equality -
toString
-
isEditable
public boolean isEditable()Returns whether this working set can be edited or not. To make a working set editable the attributepageClass
of the extension defining a working set must be provided.- Returns:
true
if the working set can be edited; otherwisefalse
-
getId
Description copied from interface:IWorkingSet
Returns the working set id. Returnsnull
if no working set id has been set. This is one of the ids defined by extensions of the org.eclipse.ui.workingSets extension point. It is used by the workbench to determine the page to use in the working set edit wizard. The default resource edit page is used if this value isnull
.- Returns:
- the working set id. May be
null
-
getImageDescriptor
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
.- Returns:
- the working set icon or
null
.
-
hashCode
public int hashCode()Returns the hash code. -
saveState
Implements IPersistableElement. Persist the working set name and working set contents. The contents has to be either IPersistableElements or provide adapters for it to be persistent.- Parameters:
memento
- the storage area for object's state- See Also:
-
setElements
Description copied from interface:IWorkingSet
Sets the elements that are contained in this working set.- Parameters:
newElements
- the elements to set in this working set
-
setId
Description copied from interface:IWorkingSet
Sets the working set id. This is one of the ids defined by extensions of the org.eclipse.ui.workingSets extension point. It is used by the workbench to determine the page to use in the working set edit wizard. The default resource edit page is used if this value isnull
.- Parameters:
pageId
- the working set id. May benull
-
isVisible
public boolean isVisible()Description copied from interface:IWorkingSet
Returns whether this working set should be shown in user interface components that list working sets by name.- Returns:
true
if the working set should be shown in the user interface; otherwisefalse
-
isSelfUpdating
public boolean isSelfUpdating()Description copied from interface:IWorkingSet
Returnstrue
if this working set is capable of updating itself and reacting to changes in the state of its members. For non-aggregate working sets this means that the working set has anIWorkingSetUpdater
installed while for aggregates it means that all component sets haveIWorkingSetUpdater
s installed. Otherwise returnsfalse
.- Returns:
- whether the set is self-updating or not
-
isAggregateWorkingSet
public boolean isAggregateWorkingSet()Description copied from interface:IWorkingSet
Returns whether this working set is an aggregate working set or not.It is recommended that clients of aggregate working sets treat them in a specific way. Please see the documentation for
IWorkbenchPage.getAggregateWorkingSet()
for details.If this is true, you can cast this working set to an
IAggregateWorkingSet
- Returns:
- whether this working set is an aggregate working set or not
-
adaptElements
Description copied from interface:IWorkingSet
Transforms the supplied elements into elements that are suitable for containment in this working set. This is useful for UI elements which wish to filter contributions to working sets based on applicability. This is a hint, however, and is not considered when theIWorkingSet.setElements(IAdaptable[])
method is invoked.- Parameters:
objects
- the objects to transform- Returns:
- an array of transformed elements that be empty if no elements from the original array are suitable
- See Also:
-