Package org.eclipse.ui
Interface IWorkingSetManager
- All Known Subinterfaces:
ILocalWorkingSetManager
- All Known Implementing Classes:
AbstractWorkingSetManager
,LocalWorkingSetManager
,WorkingSetManager
public interface IWorkingSetManager
A working set manager stores working sets and provides property change
notification when a working set is added or removed.
The workbench working set manager can be accessed using
IWorkbench#getWorkingSetManager()
This interface is not intended to be implemented by clients.
- Since:
- 2.0 initial version, 3.0 added createWorkingSet(IMemento)
- See Also:
- Restriction:
- This interface is not intended to be implemented by clients.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Change event id when a working set is added newValue of the PropertyChangeEvent will be the added working set. oldValue will be null.static final String
Change event id when the working set contents changed newValue of the PropertyChangeEvent will be the changed working set.static final String
Change event id when the working set label changed. newValue of the PropertyChangeEvent will be the changed working set.static final String
Change event id when the working set name changed. newValue of the PropertyChangeEvent will be the changed working set.static final String
Change event id when a working set is removed newValue of the PropertyChangeEvent will be null. oldValue will be the removed working set.static final String
Change event id when a working set updater got installed.static final String
Change event id when a working set updater got uninstalled. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a property change listener.void
addRecentWorkingSet
(IWorkingSet workingSet) Adds a working set to the top of the list of most recently used working sets, making it the most recently used working set.void
addToWorkingSets
(IAdaptable element, IWorkingSet[] workingSets) Utility method that will add theelement
to each given working set inworkingSets
if possible.void
addWorkingSet
(IWorkingSet workingSet) Adds a working set to the receiver.createAggregateWorkingSet
(String name, String label, IWorkingSet[] components) Create a working set that is the union of a collection of other working sets.createWorkingSet
(String name, IAdaptable[] elements) Creates a new working set.createWorkingSet
(IMemento memento) Re-creates and returns a working set from the state captured within the given memento.createWorkingSetEditWizard
(IWorkingSet workingSet) Creates a working set edit wizard for the specified working set.createWorkingSetNewWizard
(String[] workingSetIds) Creates a working set new wizard.createWorkingSetSelectionDialog
(Shell parent) Deprecated.use createWorkingSetSelectionDialog(parent, true) insteadcreateWorkingSetSelectionDialog
(Shell parentShell, boolean multi) Creates a working set selection dialog that lists all working sets and allows the user to add, remove and edit working sets.createWorkingSetSelectionDialog
(Shell parentShell, boolean multi, String[] workingsSetIds) Creates a working set selection dialog that lists all working sets with the specified ids and allows the user to add, remove and edit working sets with the specified ids.void
dispose()
Disposes the working set manager.Returns an array of all working sets stored in the receiver including those that are marked as being not visible.Returns the list of most recently used working sets.int
Returns the maximum length of the recent working sets list.getWorkingSet
(String name) Returns the working set with the specified name.Returns an array of all working sets stored in the receiver.void
Removes the property change listener.void
removeWorkingSet
(IWorkingSet workingSet) Removes the working setvoid
setRecentWorkingSetsLength
(int length) Sets maximum length of the recent working sets list.
-
Field Details
-
CHANGE_WORKING_SET_ADD
Change event id when a working set is added newValue of the PropertyChangeEvent will be the added working set. oldValue will be null.- See Also:
-
CHANGE_WORKING_SET_REMOVE
Change event id when a working set is removed newValue of the PropertyChangeEvent will be null. oldValue will be the removed working set.- See Also:
-
CHANGE_WORKING_SET_CONTENT_CHANGE
Change event id when the working set contents changed newValue of the PropertyChangeEvent will be the changed working set.- See Also:
-
CHANGE_WORKING_SET_NAME_CHANGE
Change event id when the working set name changed. newValue of the PropertyChangeEvent will be the changed working set.- See Also:
-
CHANGE_WORKING_SET_LABEL_CHANGE
Change event id when the working set label changed. newValue of the PropertyChangeEvent will be the changed working set.- Since:
- 3.2
- See Also:
-
CHANGE_WORKING_SET_UPDATER_INSTALLED
Change event id when a working set updater got installed. NewValue of the PropertyChangeEvent will be the installed updater. OldValue will benull
- Since:
- 3.1
- See Also:
-
CHANGE_WORKING_SET_UPDATER_UNINSTALLED
Change event id when a working set updater got uninstalled. NewValue will benull
OldValue of the PropertyChangeEvent will be the uninstalled updater.- Since:
- 3.3
- See Also:
-
-
Method Details
-
addPropertyChangeListener
Adds a property change listener.- Parameters:
listener
- the property change listener to add
-
addRecentWorkingSet
Adds a working set to the top of the list of most recently used working sets, making it the most recently used working set. The last (oldest) item will be deleted if the list exceeds the size limit.- Parameters:
workingSet
- the working set to add to the list of most recently used working sets.
-
addWorkingSet
Adds a working set to the receiver. The working set must not exist yet.- Parameters:
workingSet
- the working set to add
-
createWorkingSet
Creates a new working set. The working set is not added to the working set manager.- Parameters:
name
- the name of the new working set. Should not have leading or trailing whitespace.elements
- the working set contents- Returns:
- a new working set with the specified name and content
-
createAggregateWorkingSet
Create a working set that is the union of a collection of other working sets. One connected (viaaddWorkingSet(IWorkingSet)
this working set will be automatically updated to reflect the contents of the component sets, should they themselves change.- Parameters:
name
- the name of the new working set. Should not have leading or trailing whitespace.label
- the user-friendly label the working setcomponents
- the component working sets- Returns:
- a new working set with the specified name and content
- Since:
- 3.2
-
createWorkingSet
Re-creates and returns a working set from the state captured within the given memento.- Parameters:
memento
- a memento containing the state for the working set- Returns:
- the restored working set, or
null
if it could not be created - Since:
- 3.0
-
createWorkingSetEditWizard
Creates a working set edit wizard for the specified working set. The working set will already be set in the wizard. The caller is responsible for creating and opening a wizard dialog. Example:IWorkingSetEditWizard wizard = workingSetManager.createWorkingSetEditWizard(workingSet); if (wizard != null) { WizardDialog dialog = new WizardDialog(shell, wizard); dialog.create(); if (dialog.open() == Window.OK) { workingSet = wizard.getSelection(); } }
- Parameters:
workingSet
- working set to create a working set edit wizard for.- Returns:
- a working set edit wizard to edit the specified working set or
null
if no edit wizard has been defined for the working set. If the defined edit wizard for the working set could not be loaded a default IResource based wizard will be returned. If the default edit wizard can not be loadednull
is returned. - Since:
- 2.1
-
createWorkingSetNewWizard
Creates a working set new wizard. The wizard will allow creating new working sets. Returnsnull
if there aren't any working set definitions that support creation of working sets.Example:
IWorkingSetNewWizard wizard= workingSetManager.createWorkingSetNewWizard(null); if (wizard != null) { WizardDialog dialog = new WizardDialog(shell, wizard); dialog.create(); if (dialog.open() == Window.OK) { ... } }
- Parameters:
workingSetIds
- a list of working set ids which are valid workings sets to be created ornull
if all currently available working set types are valid- Returns:
- the working set new wizard or
null
- Since:
- 3.1
-
createWorkingSetSelectionDialog
Deprecated.use createWorkingSetSelectionDialog(parent, true) instead- Parameters:
parent
- the parent shell- Returns:
- the dialog
-
createWorkingSetSelectionDialog
Creates a working set selection dialog that lists all working sets and allows the user to add, remove and edit working sets. The caller is responsible for opening the dialog withIWorkingSetSelectionDialog#open
, and subsequently extracting the selected working sets usingIWorkingSetSelectionDialog#getSelection
.- Parameters:
parentShell
- the parent shell of the working set selection dialogmulti
- true=IWorkingSetSelectionDialog#getSelection()
returns the working sets chosen in the dialog as an array of working set. false=IWorkingSetSelectionDialog#getSelection()
returns an array having a single aggregate working set of all working sets selected in the dialog.- Returns:
- a working set selection dialog
-
createWorkingSetSelectionDialog
IWorkingSetSelectionDialog createWorkingSetSelectionDialog(Shell parentShell, boolean multi, String[] workingsSetIds) Creates a working set selection dialog that lists all working sets with the specified ids and allows the user to add, remove and edit working sets with the specified ids. The caller is responsible for opening the dialog withIWorkingSetSelectionDialog#open
, and subsequently extracting the selected working sets usingIWorkingSetSelectionDialog#getSelection
.- Parameters:
parentShell
- the parent shell of the working set selection dialogmulti
- true=IWorkingSetSelectionDialog#getSelection()
returns the working sets chosen in the dialog as an array of working set. false=IWorkingSetSelectionDialog#getSelection()
returns an array having a single aggregate working set of all working sets selected in the dialog.workingsSetIds
- a list of working set ids which are valid workings sets to be selected, created, removed or edited, ornull
if all currently available working set types are valid- Returns:
- a working set selection dialog
- Since:
- 3.1
-
getRecentWorkingSets
IWorkingSet[] getRecentWorkingSets()Returns the list of most recently used working sets. The most recently used working set appears first in the list.- Returns:
- the list of most recently used working sets
-
getWorkingSet
Returns the working set with the specified name. Returns null if there is no working set with that name.- Parameters:
name
- the name of the working set to return- Returns:
- the working set with the specified name.
-
getWorkingSets
IWorkingSet[] getWorkingSets()Returns an array of all working sets stored in the receiver. The array is sorted by names. Any working set whoseIWorkingSet.isVisible()
method returns false will not be included in this array. For a complete list of working sets please usegetAllWorkingSets()
.- Returns:
- the working sets stored in the receiver
-
getAllWorkingSets
IWorkingSet[] getAllWorkingSets()Returns an array of all working sets stored in the receiver including those that are marked as being not visible.- Returns:
- the working sets stored in the receiver
- Since:
- 3.2
- See Also:
-
removePropertyChangeListener
Removes the property change listener.- Parameters:
listener
- the property change listener to remove
-
removeWorkingSet
Removes the working set- Parameters:
workingSet
- the working set to remove
-
dispose
void dispose()Disposes the working set manager.- Since:
- 3.1
-
addToWorkingSets
Utility method that will add theelement
to each given working set inworkingSets
if possible. This method will invokeIWorkingSet.adaptElements(IAdaptable[])
for the element on each working set and the result of this method will be used rather than the original element in the addition operation.- Parameters:
element
- the element to adapt and then add to the working setsworkingSets
- the working sets to add the element to- Since:
- 3.4
-
setRecentWorkingSetsLength
void setRecentWorkingSetsLength(int length) Sets maximum length of the recent working sets list.- Parameters:
length
- maximum number of recent working sets to be kept in the list- Since:
- 3.7
-
getRecentWorkingSetsLength
int getRecentWorkingSetsLength()Returns the maximum length of the recent working sets list.- Returns:
- the maximum length of the recent working sets list.
- Since:
- 3.7
-