Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.ui
Interface IWorkingSetManager

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:
  `IWorkingSet`

Field Summary
`static String` | `CHANGE_WORKING_SET_ADD` Change event id when a working set is added newValue of the PropertyChangeEvent will be the added working set.
`static String` | `CHANGE_WORKING_SET_CONTENT_CHANGE` Change event id when the working set contents changed newValue of the PropertyChangeEvent will be the changed working set.
`static String` | `CHANGE_WORKING_SET_NAME_CHANGE` Change event id when the working set name changed.
`static String` | `CHANGE_WORKING_SET_REMOVE` Change event id when a working set is removed newValue of the PropertyChangeEvent will be null.

Method Summary
`void` | `addPropertyChangeListener(IPropertyChangeListener listener)` 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` | `addWorkingSet(IWorkingSet workingSet)` Adds a working set to the receiver.
`IWorkingSet` | `createWorkingSet(IMemento memento)` Re-creates and returns a working set from the state captured within the given memento.
`IWorkingSet` | `createWorkingSet(String name, IAdaptable[] elements)` Creates a new working set.
`IWorkingSetEditWizard` | `createWorkingSetEditWizard(IWorkingSet workingSet)` Creates a working set edit wizard for the specified working set.
`IWorkingSetSelectionDialog` | `createWorkingSetSelectionDialog(Shell parent)` Deprecated. use createWorkingSetSelectionDialog(parent, true) instead
`IWorkingSetSelectionDialog` | `createWorkingSetSelectionDialog(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.
`IWorkingSet[]` | `getRecentWorkingSets()` Returns the list of most recently used working sets.
`IWorkingSet` | `getWorkingSet(String name)` Returns the working set with the specified name.
`IWorkingSet[]` | `getWorkingSets()` Returns an array of all working sets stored in the receiver.
`void` | `removePropertyChangeListener(IPropertyChangeListener listener)` Removes the property change listener.
`void` | `removeWorkingSet(IWorkingSet workingSet)` Removes the working set

Field Detail

### CHANGE_WORKING_SET_ADD

    public static final String 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:
    `IPropertyChangeListener`, Constant Field Values

### CHANGE_WORKING_SET_REMOVE

    public static final String 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:
    `IPropertyChangeListener`, Constant Field Values

### CHANGE_WORKING_SET_CONTENT_CHANGE

    public static final String CHANGE_WORKING_SET_CONTENT_CHANGE

  Change event id when the working set contents changed newValue of the PropertyChangeEvent will be the changed working set. oldValue will be null.

  See Also:
    `IPropertyChangeListener`, Constant Field Values

### CHANGE_WORKING_SET_NAME_CHANGE

    public static final String CHANGE_WORKING_SET_NAME_CHANGE

  Change event id when the working set name changed. newValue of the PropertyChangeEvent will be the changed working set. oldValue will be null.

  See Also:
    `IPropertyChangeListener`, Constant Field Values

Method Detail

### addPropertyChangeListener

    public void addPropertyChangeListener(IPropertyChangeListener listener)

  Adds a property change listener.

  Parameters:
    `listener` - the property change listener to add

### addRecentWorkingSet

    public 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. 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

    public void addWorkingSet(IWorkingSet workingSet)

  Adds a working set to the receiver. The working set must not exist yet.

  Parameters:
    `workingSet` - the working set to add

### createWorkingSet

    public IWorkingSet createWorkingSet(String name,
                                        IAdaptable[] elements)

  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

### createWorkingSet

    public IWorkingSet createWorkingSet(IMemento memento)

  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

    public IWorkingSetEditWizard createWorkingSetEditWizard(IWorkingSet workingSet)

  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); 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. If the specific 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 loaded null is returned.
  Since:
    2.1

### createWorkingSetSelectionDialog

    public IWorkingSetSelectionDialog createWorkingSetSelectionDialog(Shell parent)

  Deprecated. use createWorkingSetSelectionDialog(parent, true) instead

### createWorkingSetSelectionDialog

    public IWorkingSetSelectionDialog createWorkingSetSelectionDialog(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. The caller is responsible for opening the dialog with `IWorkingSetSelectionDialog#open`, and subsequently extracting the selected working sets using `IWorkingSetSelectionDialog#getSelection`.

  Parameters:
    `parentShell` - the parent shell of the working set selection dialog
    `multi` - true=more than one working set can be chosen in the dialog. false=only one working set can be chosen. Multiple working sets can still be selected and removed from the list but the dialog can only be closed when a single working set is selected.
  Returns:
    a working set selection dialog

### getRecentWorkingSets

    public 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

    public IWorkingSet getWorkingSet(String name)

  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

    public IWorkingSet[] getWorkingSets()

  Returns an array of all working sets stored in the receiver.

  Returns:
    the working sets stored in the receiver

### removePropertyChangeListener

    public void removePropertyChangeListener(IPropertyChangeListener listener)

  Removes the property change listener.

  Parameters:
    `listener` - the property change listener to remove

### removeWorkingSet

    public void removeWorkingSet(IWorkingSet workingSet)

  Removes the working set

  Parameters:
    `workingSet` - the working set to remove

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.