Package org.eclipse.ui.internal
Class AggregateWorkingSet
java.lang.Object
org.eclipse.ui.internal.AbstractWorkingSet
org.eclipse.ui.internal.AggregateWorkingSet
- All Implemented Interfaces:
Cloneable
,EventListener
,IAdaptable
,IPropertyChangeListener
,IAggregateWorkingSet
,IPersistable
,IPersistableElement
,IWorkingSet
public class AggregateWorkingSet
extends AbstractWorkingSet
implements IAggregateWorkingSet, IPropertyChangeListener
- Since:
- 3.2
-
Field Summary
Fields inherited from class org.eclipse.ui.internal.AbstractWorkingSet
elements, FACTORY_ID, workingSetMemento
-
Constructor Summary
ConstructorDescriptionAggregateWorkingSet
(String name, String label, IMemento memento) AggregateWorkingSet
(String name, String label, IWorkingSet[] components) -
Method Summary
Modifier and TypeMethodDescriptionadaptElements
(IAdaptable[] objects) Transforms the supplied elements into elements that are suitable for containment in this working set.void
connect
(IWorkingSetManager manager) Connect this working set to a manger.void
Disconnect this working set from its manager, if any.boolean
Return the component working sets.getId()
Returns the working set id.Returns the working set icon.int
hashCode()
boolean
Returns whether this working set is an aggregate working set or not.boolean
Aggregates are not editable.boolean
Returnstrue
if this working set is capable of updating itself and reacting to changes in the state of its members.boolean
Aggregates should not generally be visible in the UI.void
Notification that a property has changed.void
Saves the state of the object in the given memento.void
setElements
(IAdaptable[] elements) A no-op for aggregates - their contents should be derived.void
Sets the working set id.toString()
Methods inherited from class org.eclipse.ui.internal.AbstractWorkingSet
clone, fireWorkingSetChanged, getAdapter, getElements, getElementsArray, getFactoryId, getImage, getLabel, getManager, getName, internalSetElements, isEmpty, setLabel, setName
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
Methods inherited from interface org.eclipse.ui.IPersistableElement
getFactoryId
Methods inherited from interface org.eclipse.ui.IWorkingSet
getElements, getImage, getLabel, getName, isEmpty, setLabel, setName
-
Constructor Details
-
AggregateWorkingSet
-
AggregateWorkingSet
-
-
Method Details
-
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
.- Specified by:
getId
in interfaceIWorkingSet
- 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
.- Specified by:
getImageDescriptor
in interfaceIWorkingSet
- Returns:
- the working set icon or
null
.
-
setElements
A no-op for aggregates - their contents should be derived.- Specified by:
setElements
in interfaceIWorkingSet
- Parameters:
elements
- 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
.- Specified by:
setId
in interfaceIWorkingSet
- Parameters:
id
- the working set id. May benull
-
isEditable
public boolean isEditable()Aggregates are not editable.- Specified by:
isEditable
in interfaceIWorkingSet
- Returns:
true
if the working set can be edited; otherwisefalse
-
isVisible
public boolean isVisible()Aggregates should not generally be visible in the UI.- Specified by:
isVisible
in interfaceIWorkingSet
- Returns:
true
if the working set should be shown in the user interface; otherwisefalse
-
saveState
Description copied from interface:IPersistable
Saves the state of the object in the given memento.- Specified by:
saveState
in interfaceIPersistable
- Parameters:
memento
- the storage area for object's state
-
connect
Description copied from class:AbstractWorkingSet
Connect this working set to a manger.- Overrides:
connect
in classAbstractWorkingSet
- Parameters:
manager
- the manager to connect to
-
disconnect
public void disconnect()Description copied from class:AbstractWorkingSet
Disconnect this working set from its manager, if any.- Overrides:
disconnect
in classAbstractWorkingSet
-
getComponents
Return the component working sets.- Specified by:
getComponents
in interfaceIAggregateWorkingSet
- Returns:
- the component working sets
-
propertyChange
Description copied from interface:IPropertyChangeListener
Notification that a property has changed.This method gets called when the observed object fires a property change event.
- Specified by:
propertyChange
in interfaceIPropertyChangeListener
- Parameters:
event
- the property change event object describing which property changed and how
-
equals
-
hashCode
public int hashCode() -
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
.- Specified by:
isSelfUpdating
in interfaceIWorkingSet
- 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
- Specified by:
isAggregateWorkingSet
in interfaceIWorkingSet
- 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.- Specified by:
adaptElements
in interfaceIWorkingSet
- 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:
-
toString
-