Class AbstractWorkingSet

java.lang.Object
org.eclipse.ui.internal.AbstractWorkingSet
All Implemented Interfaces:
Cloneable, IAdaptable, IPersistable, IPersistableElement, IWorkingSet
Direct Known Subclasses:
AggregateWorkingSet, WorkingSet

public abstract class AbstractWorkingSet extends Object implements IAdaptable, IWorkingSet, Cloneable
Abstract baseclass for IWorkingSet implementations.
Since:
3.2
  • Field Details

  • Constructor Details

    • AbstractWorkingSet

      public AbstractWorkingSet(String name, String label)
      Create a new instance of this class
      Parameters:
      name - the unique name for this working set
      label - the user-friendly name for this working set
  • Method Details

    • getAdapter

      public <T> T getAdapter(Class<T> adapter)
      Returns the receiver if the requested type is either IWorkingSet or IPersistableElement.
      Specified by:
      getAdapter in interface IAdaptable
      Type Parameters:
      T - the class type
      Parameters:
      adapter - the requested type
      Returns:
      the receiver if the requested type is either IWorkingSet or IPersistableElement.
    • getName

      public String getName()
      Description copied from interface: IWorkingSet
      Returns the name of the working set.
      Specified by:
      getName in interface IWorkingSet
      Returns:
      the name of the working set
    • setName

      public void setName(String newName)
      Description copied from interface: IWorkingSet
      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.
      Specified by:
      setName in interface IWorkingSet
      Parameters:
      newName - the name of the working set
    • connect

      public void connect(IWorkingSetManager manager)
      Connect this working set to a manger.
      Parameters:
      manager - the manager to connect to
    • disconnect

      public void disconnect()
      Disconnect this working set from its manager, if any.
    • fireWorkingSetChanged

      protected void fireWorkingSetChanged(String property, Object oldValue)
    • internalSetElements

      protected void internalSetElements(IAdaptable[] newElements)
      Create a copy of the elements to store in the receiver.
      Parameters:
      newElements - the elements to store a copy of in the receiver.
    • getElements

      public IAdaptable[] getElements()
      Description copied from interface: IWorkingSet
      Returns the elements that are contained in this working set.

      This method might throw an IllegalStateException if the working set is invalid.

      Specified by:
      getElements in interface IWorkingSet
      Returns:
      the working set's elements
    • getElementsArray

      protected List<IAdaptable> getElementsArray()
      Returns the elements array list. Lazily restores the elements from persistence memento.
      Returns:
      the elements array list
    • getManager

      protected IWorkingSetManager getManager()
    • getFactoryId

      public String getFactoryId()
      Description copied from interface: IPersistableElement
      Returns the id of the element factory which should be used to re-create this object.

      Factory ids are declared in extensions to the standard extension point "org.eclipse.ui.elementFactories".

      Specified by:
      getFactoryId in interface IPersistableElement
      Returns:
      the element factory id
      See Also:
    • getLabel

      public String getLabel()
      Description copied from interface: IWorkingSet
      Return the name of this working set, formated for the end user. Often this value is the same as the one returned from IWorkingSet.getName().
      Specified by:
      getLabel in interface IWorkingSet
      Returns:
      the name of this working set, formated for the end user
    • setLabel

      public void setLabel(String label)
      Description copied from interface: IWorkingSet
      Set the name of this working set, formated for the end user.
      Specified by:
      setLabel in interface IWorkingSet
      Parameters:
      label - the label for this working set. If null is supplied then the value of IWorkingSet.getName() will be used.
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: IWorkingSet
      Returns whether this working set is currently empty (has no elements).
      Specified by:
      isEmpty in interface IWorkingSet
      Returns:
      whether this working set is currently empty
    • getImage

      public final ImageDescriptor getImage()
      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 by getId(). Returns null if no icon has been specified in the extension or if getId() returns null.
      Specified by:
      getImage in interface IWorkingSet
      Returns:
      the working set icon or null.
    • clone

      protected AbstractWorkingSet clone()
      Overrides:
      clone in class Object