Class CWorkingPerspective

All Implemented Interfaces:
CDockablePerspective, CElementPerspective, CStationPerspective

public class CWorkingPerspective extends CGridPerspective
A representation of a CWorkingArea. When using this perspective to handle the children of a CWorkingArea the following rules must be followed:
  • Adding or removing a CDockablePerspective to this station may trigger a call to CDockablePerspective.setWorkingArea(CStationPerspective), clients can however first add/remove a dockable and then alter the working-area of the dockable to their likings.
  • Adding: the working-area of a child is only set to this if the working-area had a value of null
  • Removing: the working-area of a child is only set to null if the working-area had a value of this and if isAutoUnset() returns true.
  • This perspective recursively visits all dockables and stations when adding or removing a child.
  • MultipleCDockablePerspective: if the working-area is set, then it is automatically set in the MultipleCDockable as well.
  • SingleCDockablePerspective: if the working-area is set, then it is automatically set in the SingleCDockable as well.
  • This perspective does not track changes on children. If some PerspectiveStation was added and then some children are added to that station, then this CworkingPerspective will not set the working-area property of the new children.
Author:
Benjamin Sigg
  • Constructor Details

    • CWorkingPerspective

      public CWorkingPerspective(String id)
      Creates a new working area.
      Parameters:
      id - the unique identifier of this area
    • CWorkingPerspective

      public CWorkingPerspective(String id, Path typeId)
      Creates a new working area.
      Parameters:
      id - the unique identifier of this area
      typeId - the type of this station, can be null
  • Method Details

    • setAutoUnset

      public void setAutoUnset(boolean autoUnset)
      Tells this station to set the working-area to null when a child of this station is removed. The default value of this property is false.
      Parameters:
      autoUnset - whether the working-area should be automatically set to null
    • isAutoUnset

      public boolean isAutoUnset()
      Tells whether the working-area of children is automatically set to null when the children are removed from this station.
      Returns:
      whether the working-area is set to null
    • create

      Description copied from class: SingleCDockablePerspective
      Called the first time SingleCDockablePerspective.intern() is called, this method creates the intern representation of this SingleCDockablePerspective.
      Overrides:
      create in class CGridPerspective
      Returns:
      the internal representation of this