Package org.eclipse.ui.internal
Class AbstractWorkingSetManager
java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.ui.internal.AbstractWorkingSetManager
- All Implemented Interfaces:
- EventListener,- IExtensionChangeHandler,- IWorkingSetManager,- BundleListener
- Direct Known Subclasses:
- LocalWorkingSetManager,- WorkingSetManager
public abstract class AbstractWorkingSetManager
extends EventManager
implements IWorkingSetManager, BundleListener, IExtensionChangeHandler
Abstract implementation of 
IWorkingSetManager.- 
Field SummaryFields inherited from interface org.eclipse.ui.IWorkingSetManagerCHANGE_WORKING_SET_ADD, CHANGE_WORKING_SET_CONTENT_CHANGE, CHANGE_WORKING_SET_LABEL_CHANGE, CHANGE_WORKING_SET_NAME_CHANGE, CHANGE_WORKING_SET_REMOVE, CHANGE_WORKING_SET_UPDATER_INSTALLED, CHANGE_WORKING_SET_UPDATER_UNINSTALLED
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddExtension(IExtensionTracker tracker, IExtension extension) This method is called whenever an extension conforming to the extension point filter is being added to the registry.voidAdds a property change listener.voidaddToWorkingSets(IAdaptable element, IWorkingSet[] workingSets) Utility method that will add theelementto each given working set inworkingSetsif possible.voidaddWorkingSet(IWorkingSet workingSet) Adds a working set to the receiver.voidbundleChanged(BundleEvent event) 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 parent, 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 parent, 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.voiddispose()Disposes the working set manager.booleanTests the receiver and the object for equalityprotected voidfirePropertyChange(String changeId, Object oldValue, Object newValue) Notify property change listeners about a change to the list of working sets.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.intReturns 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.inthashCode()Returns the hash code.protected voidinternalAddRecentWorkingSet(IWorkingSet workingSet) Adds the specified working set to the list of recently used working sets.protected booleaninternalRemoveWorkingSet(IWorkingSet workingSet) voidremoveExtension(IExtension extension, Object[] objects) This method is called after the removal of an extension.voidRemoves the property change listener.protected voidrestoreMruList(IMemento memento) Restores the list of most recently used working sets from the persistence store.protected IWorkingSetrestoreWorkingSet(IMemento memento) Recreates a working set from the persistence store.protected voidrestoreWorkingSetState(IMemento memento) Recreates all working sets from the persistence store and adds them to the receiver.protected voidsaveMruList(IMemento memento) Saves the list of most recently used working sets in the persistence store.voidSave the state to the state file.voidsaveWorkingSetState(IMemento memento) Saves all persistable working sets in the persistence store.voidsetRecentWorkingSetsLength(int length) Sets maximum length of the recent working sets list.voidworkingSetChanged(IWorkingSet changedWorkingSet, String propertyChangeId, Object oldValue) Fires a property change event for the changed working set.Methods inherited from class org.eclipse.core.commands.common.EventManageraddListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObjectMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.ui.IWorkingSetManageraddRecentWorkingSet, removeWorkingSet
- 
Constructor Details- 
AbstractWorkingSetManager
 
- 
- 
Method Details- 
disposepublic void dispose()Description copied from interface:IWorkingSetManagerDisposes the working set manager.- Specified by:
- disposein interface- IWorkingSetManager
 
- 
createWorkingSetDescription copied from interface:IWorkingSetManagerCreates a new working set. The working set is not added to the working set manager.- Specified by:
- createWorkingSetin interface- IWorkingSetManager
- 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
 
- 
createAggregateWorkingSetDescription copied from interface:IWorkingSetManagerCreate a working set that is the union of a collection of other working sets. One connected (viaIWorkingSetManager.addWorkingSet(IWorkingSet)this working set will be automatically updated to reflect the contents of the component sets, should they themselves change.- Specified by:
- createAggregateWorkingSetin interface- IWorkingSetManager
- Parameters:
- name- the name of the new working set. Should not have leading or trailing whitespace.
- label- the user-friendly label the working set
- components- the component working sets
- Returns:
- a new working set with the specified name and content
 
- 
createWorkingSetDescription copied from interface:IWorkingSetManagerRe-creates and returns a working set from the state captured within the given memento.- Specified by:
- createWorkingSetin interface- IWorkingSetManager
- Parameters:
- memento- a memento containing the state for the working set
- Returns:
- the restored working set, or nullif it could not be created
 
- 
addWorkingSetDescription copied from interface:IWorkingSetManagerAdds a working set to the receiver. The working set must not exist yet.- Specified by:
- addWorkingSetin interface- IWorkingSetManager
- Parameters:
- workingSet- the working set to add
 
- 
internalRemoveWorkingSet
- 
getWorkingSetsDescription copied from interface:IWorkingSetManagerReturns 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 useIWorkingSetManager.getAllWorkingSets().- Specified by:
- getWorkingSetsin interface- IWorkingSetManager
- Returns:
- the working sets stored in the receiver
 
- 
getAllWorkingSetsDescription copied from interface:IWorkingSetManagerReturns an array of all working sets stored in the receiver including those that are marked as being not visible.- Specified by:
- getAllWorkingSetsin interface- IWorkingSetManager
- Returns:
- the working sets stored in the receiver
- See Also:
 
- 
getWorkingSetDescription copied from interface:IWorkingSetManagerReturns the working set with the specified name. Returns null if there is no working set with that name.- Specified by:
- getWorkingSetin interface- IWorkingSetManager
- Parameters:
- name- the name of the working set to return
- Returns:
- the working set with the specified name.
 
- 
getRecentWorkingSetsDescription copied from interface:IWorkingSetManagerReturns the list of most recently used working sets. The most recently used working set appears first in the list.- Specified by:
- getRecentWorkingSetsin interface- IWorkingSetManager
- Returns:
- the list of most recently used working sets
 
- 
internalAddRecentWorkingSetAdds the specified working set to the list of recently used working sets.- Parameters:
- workingSet- working set to added to the list of recently used working sets.
 
- 
equalsTests the receiver and the object for equality
- 
hashCodepublic int hashCode()Returns the hash code.
- 
addPropertyChangeListenerDescription copied from interface:IWorkingSetManagerAdds a property change listener.- Specified by:
- addPropertyChangeListenerin interface- IWorkingSetManager
- Parameters:
- listener- the property change listener to add
 
- 
removePropertyChangeListenerDescription copied from interface:IWorkingSetManagerRemoves the property change listener.- Specified by:
- removePropertyChangeListenerin interface- IWorkingSetManager
- Parameters:
- listener- the property change listener to remove
 
- 
firePropertyChangeNotify property change listeners about a change to the list of working sets.- Parameters:
- changeId- one of IWorkingSetManager#CHANGE_WORKING_SET_ADD IWorkingSetManager#CHANGE_WORKING_SET_REMOVE IWorkingSetManager#CHANGE_WORKING_SET_CONTENT_CHANGE IWorkingSetManager#CHANGE_WORKING_SET_NAME_CHANGE
- oldValue- the removed working set or null if a working set was added or changed.
- newValue- the new or changed working set or null if a working set was removed.
 
- 
workingSetChangedpublic void workingSetChanged(IWorkingSet changedWorkingSet, String propertyChangeId, Object oldValue) Fires a property change event for the changed working set. Should only be called by org.eclipse.ui.internal.WorkingSet.- Parameters:
- changedWorkingSet- the working set that has changed
- propertyChangeId- the changed property. one of CHANGE_WORKING_SET_CONTENT_CHANGE, CHANGE_WORKING_SET_LABEL_CHANGE, and CHANGE_WORKING_SET_NAME_CHANGE
- oldValue- the old value
 
- 
saveWorkingSetStateSaves all persistable working sets in the persistence store.- Parameters:
- memento- the persistence store
- See Also:
 
- 
restoreWorkingSetStateRecreates all working sets from the persistence store and adds them to the receiver.- Parameters:
- memento- the persistence store
 
- 
restoreWorkingSetRecreates a working set from the persistence store.- Parameters:
- memento- the persistence store
- Returns:
- the working set created from the memento or null if creation failed.
 
- 
saveMruListSaves the list of most recently used working sets in the persistence store.- Parameters:
- memento- the persistence store
 
- 
restoreMruListRestores the list of most recently used working sets from the persistence store.- Parameters:
- memento- the persistence store
 
- 
createWorkingSetEditWizardDescription copied from interface:IWorkingSetManagerCreates 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(); } }- Specified by:
- createWorkingSetEditWizardin interface- IWorkingSetManager
- 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
         nullif 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 loadednullis returned.
- Since:
- 2.1
- See Also:
 
- 
createWorkingSetSelectionDialogDeprecated.use createWorkingSetSelectionDialog(parent, true) instead- Specified by:
- createWorkingSetSelectionDialogin interface- IWorkingSetManager
- Parameters:
- parent- the parent shell
- Returns:
- the dialog
 
- 
createWorkingSetSelectionDialogDescription copied from interface:IWorkingSetManagerCreates 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.- Specified by:
- createWorkingSetSelectionDialogin interface- IWorkingSetManager
- Parameters:
- parent- the parent shell of the working set selection dialog
- multi- 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
 
- 
createWorkingSetNewWizardCreates a working set new wizard. The wizard will allow creating new working sets. Returnsnullif 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) { ... } }- Specified by:
- createWorkingSetNewWizardin interface- IWorkingSetManager
- Parameters:
- workingSetIds- a list of working set ids which are valid workings sets to be created or- nullif all currently available working set types are valid
- Returns:
- the working set new wizard or null
 
- 
bundleChanged- Specified by:
- bundleChangedin interface- BundleListener
 
- 
createWorkingSetSelectionDialogpublic IWorkingSetSelectionDialog createWorkingSetSelectionDialog(Shell parent, boolean multi, String[] workingsSetIds) Description copied from interface:IWorkingSetManagerCreates 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.- Specified by:
- createWorkingSetSelectionDialogin interface- IWorkingSetManager
- Parameters:
- parent- the parent shell of the working set selection dialog
- multi- 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, or- nullif all currently available working set types are valid
- Returns:
- a working set selection dialog
 
- 
saveStateSave the state to the state file.- Throws:
- IOException
 
- 
addExtensionDescription copied from interface:IExtensionChangeHandlerThis method is called whenever an extension conforming to the extension point filter is being added to the registry. This method does not automatically register objects to the tracker.- Specified by:
- addExtensionin interface- IExtensionChangeHandler
- Parameters:
- tracker- a tracker to which the handler has been registered
- extension- the extension being added
 
- 
removeExtensionDescription copied from interface:IExtensionChangeHandlerThis method is called after the removal of an extension.- Specified by:
- removeExtensionin interface- IExtensionChangeHandler
- Parameters:
- extension- the extension being removed
- objects- the objects that were associated with the removed extension
 
- 
addToWorkingSetsDescription copied from interface:IWorkingSetManagerUtility method that will add theelementto each given working set inworkingSetsif 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.- Specified by:
- addToWorkingSetsin interface- IWorkingSetManager
- Parameters:
- element- the element to adapt and then add to the working sets
- workingSets- the working sets to add the element to
 
- 
setRecentWorkingSetsLengthpublic void setRecentWorkingSetsLength(int length) Description copied from interface:IWorkingSetManagerSets maximum length of the recent working sets list.- Specified by:
- setRecentWorkingSetsLengthin interface- IWorkingSetManager
- Parameters:
- length- maximum number of recent working sets to be kept in the list
 
- 
getRecentWorkingSetsLengthpublic int getRecentWorkingSetsLength()Description copied from interface:IWorkingSetManagerReturns the maximum length of the recent working sets list.- Specified by:
- getRecentWorkingSetsLengthin interface- IWorkingSetManager
- Returns:
- the maximum length of the recent working sets list.
 
 
-