Package org.eclipse.ui
Interface IWorkingSet
-
- All Superinterfaces:
IAdaptable
,IPersistable
,IPersistableElement
- All Known Subinterfaces:
IAggregateWorkingSet
public interface IWorkingSet extends IPersistableElement, IAdaptable
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 initial version, 3.0 now extends
IPersistableElement
, 3.2 now extendsIAdaptable
- Restriction:
- This interface is not intended to be implemented by clients.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description IAdaptable[]
adaptElements(IAdaptable[] objects)
Transforms the supplied elements into elements that are suitable for containment in this working set.IAdaptable[]
getElements()
Returns the elements that are contained in this working set.String
getId()
Returns the working set id.ImageDescriptor
getImage()
Deprecated.usegetImageDescriptor()
insteadImageDescriptor
getImageDescriptor()
Returns the working set icon.String
getLabel()
Return the name of this working set, formated for the end user.String
getName()
Returns the name of the working set.boolean
isAggregateWorkingSet()
Returns whether this working set is an aggregate working set or not.boolean
isEditable()
Returns whether this working set can be edited or not.boolean
isEmpty()
Returns whether this working set is currently empty (has no elements).boolean
isSelfUpdating()
Returnstrue
if this working set is capable of updating itself and reacting to changes in the state of its members.boolean
isVisible()
Returns whether this working set should be shown in user interface components that list working sets by name.void
setElements(IAdaptable[] elements)
Sets the elements that are contained in this working set.void
setId(String id)
Sets the working set id.void
setLabel(String label)
Set the name of this working set, formated for the end user.void
setName(String name)
Sets the name of the working set.-
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
-
Methods inherited from interface org.eclipse.ui.IPersistable
saveState
-
Methods inherited from interface org.eclipse.ui.IPersistableElement
getFactoryId
-
-
-
-
Method Detail
-
getElements
IAdaptable[] getElements()
Returns the elements that are contained in this working set.This method might throw an
IllegalStateException
if the working set is invalid.- Returns:
- the working set's elements
-
getId
String getId()
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
- Since:
- 2.1
-
getImage
@Deprecated ImageDescriptor getImage()
Deprecated.usegetImageDescriptor()
insteadReturns 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
. - Since:
- 2.1
-
getImageDescriptor
ImageDescriptor getImageDescriptor()
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
. - Since:
- 3.3
-
getName
String getName()
Returns the name of the working set.- Returns:
- the name of the working set
-
setElements
void setElements(IAdaptable[] elements)
Sets the elements that are contained in this working set.- Parameters:
elements
- the elements to set in this working set- Since:
- 3.3 it is now recommended that all calls to this method pass through
the results from calling
adaptElements(IAdaptable[])
with the desired elements.
-
setId
void setId(String id)
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:
id
- the working set id. May benull
- Since:
- 2.1
-
setName
void setName(String name)
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.- Parameters:
name
- the name of the working set
-
isEditable
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
- Since:
- 3.1
-
isVisible
boolean isVisible()
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
- Since:
- 3.2
-
getLabel
String getLabel()
Return the name of this working set, formated for the end user. Often this value is the same as the one returned fromgetName()
.- Returns:
- the name of this working set, formated for the end user
- Since:
- 3.2
-
setLabel
void setLabel(String label)
Set the name of this working set, formated for the end user.- Parameters:
label
- the label for this working set. Ifnull
is supplied then the value ofgetName()
will be used.- Since:
- 3.2
-
isSelfUpdating
boolean isSelfUpdating()
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
- Since:
- 3.2
-
isAggregateWorkingSet
boolean isAggregateWorkingSet()
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
- Since:
- 3.2
-
isEmpty
boolean isEmpty()
Returns whether this working set is currently empty (has no elements).- Returns:
- whether this working set is currently empty
- Since:
- 3.2
-
adaptElements
IAdaptable[] adaptElements(IAdaptable[] objects)
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 thesetElements(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
- Since:
- 3.3
- See Also:
IWorkingSetElementAdapter
,BasicWorkingSetElementAdapter
-
-