bibliothek.gui.dock.common
Class CWorkingArea

java.lang.Object
  extended by bibliothek.gui.dock.common.intern.AbstractCDockable
      extended by bibliothek.gui.dock.common.intern.AbstractDockableCStation<SplitDockStation>
          extended by bibliothek.gui.dock.common.CGridArea
              extended by bibliothek.gui.dock.common.CWorkingArea
All Implemented Interfaces:
CStation<SplitDockStation>, CDockable, SingleCDockable

public class CWorkingArea
extends CGridArea

A working area is an element which is always visible and contains some CDockables which can't be dragged out of it. Also no CDockable can be dropped in a CWorkingArea.
There can be more than one CWorkingArea, and the working areas can be nested.

Author:
Benjamin Sigg

Field Summary
static Path TYPE_ID
          The result of getTypeId()
 
Fields inherited from class bibliothek.gui.dock.common.intern.AbstractCDockable
listenerCollection
 
Fields inherited from interface bibliothek.gui.dock.common.intern.CDockable
ACTION_KEY_CLOSE, ACTION_KEY_EXTERNALIZE, ACTION_KEY_MAXIMIZE, ACTION_KEY_MINIMIZE, ACTION_KEY_NORMALIZE, ACTION_KEY_UNEXTERNALIZE, ACTION_KEY_UNMAXIMIZE_EXTERNALIZED
 
Constructor Summary
CWorkingArea(CControl control, java.lang.String uniqueId)
          Creates a new area.
 
Method Summary
<F extends MultipleCDockable>
F
add(F dockable)
          Ensures that this is the parent of dockable and adds dockable to the CControl which is associated with this CWorkingArea.
<F extends SingleCDockable>
F
add(F dockable)
          Ensures that this is the parent of dockable and adds dockable to the CControl which is associated with this CWorkingArea.
 CWorkingPerspective createPerspective()
          Returns a new CStationPerspective that represents this station.
 void deploy(CGrid grid)
          Exchanges all the CDockables on this area with the elements of grid.
 CLocation getStationLocation()
          Gets a location which represents directly CStation.getStation().
 Path getTypeId()
          Gets a unique path denoting the type of this station.
 boolean isSuppressTitle()
          Deprecated. use AbstractCDockable.isTitleShown() instead
 boolean isWorkingArea()
          Tells whether this station is a special working area or not.
 void setSuppressTitle(boolean suppressTitle)
          Deprecated. use AbstractCDockable.setTitleShown(boolean) instead
 
Methods inherited from class bibliothek.gui.dock.common.CGridArea
asDockable, createCommonDockable, getComponent, getStation, getTitleIcon, getTitleText, getUniqueId, init, install, isCloseable, isExternalizable, isMaximizable, isMaximizingArea, isMinimizable, isStackable, setMaximizingArea, setTitleIcon, setTitleText, suppressTitle, uninstall
 
Methods inherited from class bibliothek.gui.dock.common.intern.AbstractDockableCStation
asStation, init, setControl
 
Methods inherited from class bibliothek.gui.dock.common.intern.AbstractCDockable
addCDockableLocationListener, addCDockablePropertyListener, addCDockableStateListener, addDoubleClickListener, addFocusListener, addKeyboardListener, addVetoClosingListener, control, getAction, getAndClearResizeRequest, getBaseLocation, getClose, getColors, getControl, getDefaultLocation, getExtendedMode, getFocusComponent, getFonts, getMinimizedSize, getWorkingArea, hasParent, init, intern, isDockableVisible, isMinimizedHold, isResizeLocked, isResizeLockedHorizontally, isResizeLockedVertically, isSingleTabShown, isTitleShown, isVisible, propertyListeners, putAction, removeCDockableLocationListener, removeCDockablePropertyListener, removeCDockableStateListener, removeDoubleClickListener, removeFocusListener, removeKeyboardListener, removeVetoClosingListener, setDefaultLocation, setExtendedMode, setFocusComponent, setLocation, setMinimizedHold, setMinimizedSize, setResizeLocked, setResizeLockedHorizontally, setResizeLockedVertically, setResizeRequest, setResizeRequest, setSingleTabShown, setTitleShown, setVisible, setWorkingArea, stateListeners, toFront
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface bibliothek.gui.dock.common.intern.CDockable
addCDockableLocationListener, addCDockablePropertyListener, addCDockableStateListener, addDoubleClickListener, addFocusListener, addKeyboardListener, addVetoClosingListener, asStation, getAction, getAndClearResizeRequest, getBaseLocation, getColors, getControl, getExtendedMode, getFocusComponent, getFonts, getMinimizedSize, getWorkingArea, hasParent, intern, isDockableVisible, isMinimizedHold, isResizeLockedHorizontally, isResizeLockedVertically, isSingleTabShown, isTitleShown, isVisible, removeCDockableLocationListener, removeCDockablePropertyListener, removeCDockableStateListener, removeDoubleClickListener, removeFocusListener, removeKeyboardListener, removeVetoClosingListener, setControl, setExtendedMode, setLocation, setMinimizedHold, setMinimizedSize, setVisible, setWorkingArea
 

Field Detail

TYPE_ID

public static final Path TYPE_ID
The result of getTypeId()

Constructor Detail

CWorkingArea

public CWorkingArea(CControl control,
                    java.lang.String uniqueId)
Creates a new area.

Parameters:
control - the owner of this station
uniqueId - a unique identifier
Method Detail

isWorkingArea

public boolean isWorkingArea()
Description copied from interface: CStation
Tells whether this station is a special working area or not. It is not possible drag a child from a working area if it is registered there, or to drop a child onto a working area if it is not registered there.
Working areas must either be registered as root-station (see CControl.addStation(CStation, boolean)) or must be a SingleCDockable.

Specified by:
isWorkingArea in interface CStation<SplitDockStation>
Overrides:
isWorkingArea in class CGridArea
Returns:
true if this is a working area, false otherwise

getStationLocation

public CLocation getStationLocation()
Description copied from interface: CStation
Gets a location which represents directly CStation.getStation().

Specified by:
getStationLocation in interface CStation<SplitDockStation>
Overrides:
getStationLocation in class CGridArea
Returns:
the location that will always represent the station

createPerspective

public CWorkingPerspective createPerspective()
Description copied from interface: CStation
Returns a new CStationPerspective that represents this station. This method does not need to set any content of the new perspective. Basically this method just needs to tell the framework what type of CStationPerspective is needed, not what its content is.

Specified by:
createPerspective in interface CStation<SplitDockStation>
Overrides:
createPerspective in class CGridArea
Returns:
the new, empty perspective
See Also:
CStation.getTypeId()

deploy

public void deploy(CGrid grid)
Exchanges all the CDockables on this area with the elements of grid. This method also calls CDockable.setWorkingArea(CStation) for each dockable in grid.

Overrides:
deploy in class CGridArea
Parameters:
grid - a grid containing some new Dockables

add

public <F extends SingleCDockable> F add(F dockable)
Ensures that this is the parent of dockable and adds dockable to the CControl which is associated with this CWorkingArea. If there is no CControl, then the dockable is added nowhere.

Type Parameters:
F - the type of element to add
Parameters:
dockable - the new element
Returns:
dockable

add

public <F extends MultipleCDockable> F add(F dockable)
Ensures that this is the parent of dockable and adds dockable to the CControl which is associated with this CWorkingArea. If there is no CControl, then the dockable is added nowhere.

Type Parameters:
F - the type of element to add
Parameters:
dockable - the new element
Returns:
dockable

setSuppressTitle

@Deprecated
@Todo(compatibility=BREAK_MAJOR,
      priority=MINOR,
      target=VERSION_1_1_1,
      description="remove this method")
public void setSuppressTitle(boolean suppressTitle)
Deprecated. use AbstractCDockable.setTitleShown(boolean) instead

Sets whether this working-area should suppress its title or not.

Parameters:
suppressTitle - true if this area should try not to have a title.

isSuppressTitle

@Deprecated
@Todo(compatibility=BREAK_MAJOR,
      priority=MINOR,
      target=VERSION_1_1_1,
      description="remove this method")
public boolean isSuppressTitle()
Deprecated. use AbstractCDockable.isTitleShown() instead

Tells whether this working-area suppresses its title.

Returns:
true if this area normally has no title

getTypeId

public Path getTypeId()
Description copied from interface: CStation
Gets a unique path denoting the type of this station. This path will be given to MissingPerspectiveStrategy.createRoot(String, Path) when loading a layout as a CPerspective.

Specified by:
getTypeId in interface CStation<SplitDockStation>
Overrides:
getTypeId in class CGridArea
Returns:
the type of this station. Paths starting with "dock." are reserved for the framework. A value of null will just be ignored.