bibliothek.gui.dock.common
Class CControl

java.lang.Object
  extended by bibliothek.gui.dock.common.CControl

public class CControl
extends Object

Manages the interaction between SingleCDockable, MultipleCDockable and CStations.
Clients which do no longer need a CControl can call destroy() to free resources.
A CControl is an interface between the application and the framework. The task of CControl is to provide access for actions that affect the entire realm. Such actions may include:

Author:
Benjamin Sigg

Field Summary
static PropertyKey<CControl> CCONTROL
          A key for this CControl.
static Path CCONTROL_EXTENSION
          Name of an ExtensionName that adds extensions to this control.
static String CONTENT_AREA_STATIONS_ID
          the unique id of the default-CContentArea created by this control
static String EXTENSION_PARAM
          name of a parameter of an ExtensionName that points to this
static String EXTERNALIZED_STATION_ID
          the unique id of the station that handles the externalized dockables
static PropertyKey<KeyStroke> KEY_CLOSE
          KeyStroke used to close a CDockable.
static PropertyKey<KeyStroke> KEY_GOTO_EXTERNALIZED
          KeyStroke used to change a CDockable into externalized-state.
static PropertyKey<KeyStroke> KEY_GOTO_MAXIMIZED
          KeyStroke used to change a CDockable into maximized-state.
static PropertyKey<KeyStroke> KEY_GOTO_MINIMIZED
          KeyStroke used to change a CDockable into minimized-state.
static PropertyKey<KeyStroke> KEY_GOTO_NORMALIZED
          KeyStroke used to change a CDockable into normalized-state.
static PropertyKey<KeyStroke> KEY_MAXIMIZE_CHANGE
          KeyStroke used to change a CDockable into maximized-state, or to go out of maximized-state when needed.
static PropertyKey<ConflictResolver<RequestDimension>> RESIZE_LOCK_CONFLICT_RESOLVER
          ConflictResolver used to determine what happens when there is a conflict between two resize requests on a SplitDockStation like CGridArea, CWorkingArea or CContentArea.
 
Constructor Summary
  CControl()
          Creates a new control.
  CControl(boolean restrictedEnvironment)
          Deprecated. it is not necessary to set the restrictedEnvironment parameter anymore, the framework will choose a fitting value itself
  CControl(JFrame frame)
          Creates a new control
  CControl(JFrame frame, boolean restrictedEnvironment)
          Deprecated. it is not necessary to set the restrictedEnvironment parameter anymore, the framework will choose a fitting value itself
  CControl(JFrame frame, CControlFactory factory)
          Creates a new control
  CControl(WindowProvider window)
          Creates a new control
  CControl(WindowProvider window, boolean restrictedEnvironment)
          Deprecated. it is not necessary to set the restrictedEnvironment parameter anymore, the framework will choose a fitting value itself
  CControl(WindowProvider window, CControlFactory factory)
          Creates a new control
protected CControl(WindowProvider window, CControlFactory factory, boolean init)
          Creates a new control
 
Method Summary
 void addControlListener(CControlListener listener)
          Adds a listener to this control.
 void addDestroyHook(DestroyHook hook)
          Adds a destroy-hook.
<M extends MultipleCDockable>
M
addDockable(M dockable)
          Adds a dockable to this control.
<S extends SingleCDockable>
S
addDockable(S dockable)
          Adds a dockable to this control.
<M extends MultipleCDockable>
M
addDockable(String uniqueId, M dockable)
          Adds a dockable to this control.
 void addDoubleClickListener(CDoubleClickListener listener)
          Adds a global mouse double click listener to this control.
 void addFocusListener(CFocusListener listener)
          Adds a new focus listener to this control.
 void addGlobalKeyListener(KeyListener listener)
          Adds a key listener to this control that will be informed about any KeyEvent that gets processed or analyzed by this control.
 void addKeyboardListener(CKeyboardListener listener)
          Adds a global keyboard listener to this control.
 void addMultipleDockableFactory(String id, MultipleCDockableFactory<?,?> factory)
          Adds a factory to this control.
 void addPropertyListener(CDockablePropertyListener listener)
          Adds a global property listener.
 void addResizeRequestListener(ResizeRequestListener listener)
          Adds a ResizeRequestListener to this CControl.
 void addSingleDockableFactory(Filter<String> ids, SingleCDockableFactory factory)
          Adds a factory to this control.
 void addSingleDockableFactory(String id, SingleCDockableFactory backupFactory)
          Adds a factory to this control.
 void addStateListener(CDockableStateListener listener)
          Adds a global state listener.
 void addStation(CStation<?> station)
          Adds an additional station to this control.
 void addStation(CStation<?> station, boolean root)
          Adds an additional station to this control.
 void addStationContainer(CStationContainer container)
          Adds container to this control.
 void addVetoClosingListener(CVetoClosingListener listener)
          Adds listener to this control, the listener will be informed whenever a set of CDockables is about to be closed.
CVetoClosingListeners added to the CControl are invoked before listeners that are added to a CDockable.
 void addVetoFocusListener(CVetoFocusListener listener)
          Adds a new veto focus listener to this control.
 CContentArea createContentArea(String uniqueId)
          Creates and adds a new CContentArea.
 CGridArea createGridArea(String uniqueId)
          Creates a new area where normalized CDockables can be stored.
 CMinimizeArea createMinimizeArea(String uniqueId)
          Creates a new area where minimized CDockables can be stored.
 CWorkingArea createWorkingArea(String uniqueId)
          Creates and adds a new CWorkingArea to this control.
 void delete(String name)
          Deletes a layout that has been stored earlier.
 void destroy()
          Frees as much resources as possible.
 CDockable getCDockable(int index)
          Gets the index'th dockable that is registered in this control
 int getCDockableCount()
          Gets the number of CDockables that are registered in this CControl.
 CContentArea getContentArea()
          Gets the element that should be in the center of the mainframe.
 List<CContentArea> getContentAreas()
          Deprecated. use getStationContainers() instead
 DockController getController()
          Gets the DockController which is used by this CControl.
 CLocation getDefaultLocation()
          Gets the location where CDockables are opened when nothing else is specified.
 CControlFactory getFactory()
          Gets the factory which is mainly used to create new elements for this control.
 CDockable getFocusedCDockable()
          Gets the currently focused CDockable.
 CGroupBehavior getGroupBehavior()
          Gets the currently used CGroupBehavior.
 IconManager getIcons()
          Grants access to all the Icons that are used within the realm of this CControl.
 CLocationModeManager getLocationManager()
          Gets the manager that is responsible to handle all changes of the modes (maximized, normalized, ...
 MissingPerspectiveStrategy getMissingPerspectiveStrategy()
          Gets the strategy that is used to create missing CStationPerspective.
 MissingCDockableStrategy getMissingStrategy()
          Gets the strategy that tells what to do if layout information of a missing CDockable is found.
 MultipleCDockable getMultipleDockable(String id)
          Searches and returns the one MultipleCDockable which uses the unique identifier id.
 MultipleCDockableFactory<?,?> getMultipleDockableFactory(String id)
          Searches for the MultipleCDockableFactory with the identifier id.
 CControlPerspective getPerspectives()
          Grants access to the perspective API which allows clients to build complex layouts without the need to create any dockables or stations.
 PreferenceModel getPreferenceModel()
          Gets the preference model which is used to translate between the preferences and this.
 PreferenceStorage getPreferences()
          Gets the storage container for PreferenceModels for this control.
<A> A
getProperty(PropertyKey<A> key)
          Gets the value of a property.
 CControlRegister getRegister()
          Gets the set of dockables, stations and other elemnts that are used by this control.
 ApplicationResourceManager getResources()
          Grants access to the manager that reads and stores configurations of the common-project.
Clients can add their own ApplicationResources to this manager, however clients are strongly discouraged from removing ApplicationResource which they did not add by themself.
 WindowProvider getRootWindow()
          Gets the root window of the application.
 SingleCDockable getSingleDockable(String id)
          Searches for the SingleCDockable which has the unique identifier id.
 SingleCDockableFactory getSingleDockableFactory(String id)
          Searches the SingleCDockableFactory which is responsible for creating the SingleCDockable with identifier id.
 CStation<?> getStation(DockStation intern)
          Searches the CStation whose internal representation is intern.
 CStation<?> getStation(String id)
          Searches the CStation with unique identifier id.
 List<CStationContainer> getStationContainers()
          Gets an unmodifiable list of all CStationContainers that are registered at this CControl.
 List<CStation<?>> getStations()
          Gets an unmodifiable list of all stations that are currently registered at this control.
 ThemeMap getThemes()
          Gets the list of installed themes.
 void handleResizeRequests()
          Informs all ResizeRequestListeners, that the resize request of all CDockables should be processed.
protected  void init(WindowProvider window, CControlFactory factory)
          Initializes the fields of this CControl.
protected  void initExtensions(DockController controller)
          Initializes additional Extensions and registers them at the ExtensionManager of controller.
protected  void initExternalizeArea()
          Called during construction of this CControl, this method creates a new CExternalizeArea and registers it as root-station using the unique identifier "external".
Subclasses may override this method and not create a CExternalizeArea or create a customized CExternalizeArea.
protected  void initFactories()
          Called during construction of this CControl, this method adds DockFactorys to the intern representation of this CControl.
protected  void initIcons()
          Sets up all the default icons used in the ralm of this CControl.
protected  void initPersistentStorage()
          Creates new ApplicationResources and registers them at the ApplicationResourceManager of this CControl.
protected  void initProperties()
          Sets up the default properties.
protected  void initTexts()
          Sets up all the default text that is used in the realm of this CControl
protected  void initTexts(Locale locale)
          Sets up all the default text that is used in the realm of this CControl
protected  void initTransferFocusOnMinimize(DockController controller)
          Adds a CDockableStateListener to this CControl, if a CDockable is minimized, another Dockable receives the focus.
 CDockFrontend intern()
          Gets the representation of the layer beneath the common-layer.
 boolean isRevertToBasicModes()
          Tells whether basic modes are forcibly applied when loading a persistent layout.
 boolean isRootStation(CStation<?> station)
          Tells whether station was added to this CControl with the root flag set to true.
 boolean isTransferFocusOnMinimize()
          If a CDockable is minimized, the focus can be automatically transfered to another Dockable.
 String[] layouts()
          Gets a list of all layouts that are currently known.
 void load(String name)
          Loads an earlier stored layout.
<A> void
putProperty(PropertyKey<A> key, A value)
          Changes the value of a property.
protected
<A> void
putProperty(PropertyKey<A> key, A value, Priority priority)
          Changes the value of a property.
 void read(DataInputStream in)
          Reads the current and other known layouts from in.
This is the same as calling getResources().readStream( in ).
 void read(File file)
          Reads the current and other known layouts from file.
This is the same as calling getResources().readFile( file ).
 void readXML(File file)
          Reads the current and other known layouts from file.
 void readXML(XElement element)
          Reads the current and other known layouts from element.
This is the same as calling getResources().readXML( element ).
 void remove(CStation<?> station)
          Deprecated. use removeStation(CStation) instead
 void remove(MultipleCDockable dockable)
          Deprecated. please use removeDockable(MultipleCDockable) instead, this method will be removed in a future release
 boolean remove(SingleCDockable dockable)
          Deprecated. Please use removeDockable(SingleCDockable) instead, this method will be removed in a future release
 void removeContentArea(CContentArea content)
          Deprecated. use removeStationContainer(CStationContainer) instead
 void removeControlListener(CControlListener listener)
          Removes a listener from this control.
 void removeDestroyHook(DestroyHook hook)
          Removes a destroy-hook from this CControl.
 void removeDockable(MultipleCDockable dockable)
          Removes a dockable from this control.
 boolean removeDockable(SingleCDockable dockable)
          Removes dockable from this control.
 void removeDoubleClickListener(CDoubleClickListener listener)
          Removes a listener from this control.
 void removeFocusListener(CFocusListener listener)
          Removes a listener from this control.
 void removeGlobalKeyListener(KeyListener listener)
          Removes a global KeyListener from this control.
 void removeKeyboardListener(CKeyboardListener listener)
          Removes a listener from this control.
 void removeMultipleDockableFactory(String id)
          Removes the MultipleCDockableFactory with identifier id from this control.
 void removePropertyListener(CDockablePropertyListener listener)
          Removes a global listener from this control.
 void removeResizeRequestListener(ResizeRequestListener listener)
          Removes a ResizeRequestListener from this CControl.
 boolean removeSingleDockable(String id)
          Removes the SingleCDockable with the identifier id.
 void removeSingleDockableFactory(SingleCDockableFactory factory)
          Removes all occurrences of factory.
 void removeSingleDockableFactory(String id)
          Removes a factory from this control.
 void removeStateListener(CDockableStateListener listener)
          Removes a global state listener.
 void removeStation(CStation<?> station)
          Removes a CStation from this control.
 void removeStationContainer(CStationContainer container)
          Removes container from the list of known CStationContainers.
 void removeVetoClosingListener(CVetoClosingListener listener)
          Removes a listener from this control.
 void removeVetoFocusListener(CVetoFocusListener listener)
          Removes a listener from this control.
 void replace(MultipleCDockable oldDockable, MultipleCDockable newDockable)
          Replaces oldDockable with newDockable.
 void save(String name)
          Stores the current layout with the given name.
 void setDefaultLocation(CLocation defaultLocation)
          Sets the location where CDockables are opened when there is nothing else specified for these CDockables.
 void setGroupBehavior(CGroupBehavior behavior)
          Sets the CGroupBehavior.
 void setIgnoreWorkingForEntry(boolean ignore)
          Informs this CControl whether location of CDockables that are associated with a working area should be stored when storing a layout.
This method installs a DockSituationIgnore on the intern DockFrontend, the filter is only used for "normal entries", "final entries" (does stored when the application shuts down) are not affected.
The default value for this property is true.
 void setLanguage(Locale locale)
          Re-initializes the default text that is used in the realm of this CControl.
 void setMaximizeArea(String id)
          Makes sure that all CDockables are maximized onto the area which is registered under the given unique id.
 void setMissingPerspectiveStrategy(MissingPerspectiveStrategy missingPerspectiveStrategy)
          Sets a strategy that creates missing CStationPerspectives.
 void setMissingStrategy(MissingCDockableStrategy missingStrategy)
          Sets the strategy that tells what to do if layout information of a missing CDockable is found.
 void setPreferenceModel(PreferenceModel preferenceModel)
          Sets the PreferenceModel which will be used to translate between this and the preferences.
 void setRevertToBasicModes(boolean revert)
          Tells this control whether basic modes like "normalized", "minimized" or "externalized" are forced upon Dockables after loading a persistent layout.
 void setRootWindow(WindowProvider window)
          Sets the root window of the application.
 void setTheme(DockTheme theme)
          Deprecated. replaced by setTheme(String). While this method still works, the theme will not get stored persistent and any module using the ThemeMap (getThemes()) will not be informed about the change.
 void setTheme(String theme)
          Sets the theme of the elements in the realm of this control.
 void setTransferFocusOnMinimize(boolean transferFocusOnMinimize)
          If a CDockable is minimized, the focus can be automatically transfered to another CDockable.
 void write(DataOutputStream out)
          Writes the current and all known layouts into out.
This is the same as calling getResources().writeStream( out ).
 void write(File file)
          Writes the current and all known layouts into file.
This is the same as calling getResources().writeFile( file ).
 void writeXML(File file)
          Writes the current and all known layouts into file in xml format.
 void writeXML(XElement element)
          Writes the current and all known layouts into element.
This is the same as calling getResources().writeXML( element ).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CCONTROL

public static final PropertyKey<CControl> CCONTROL
A key for this CControl. Will be set with the highest priority. To be used wherever a DockController but not a CControl is accessible.


CCONTROL_EXTENSION

public static final Path CCONTROL_EXTENSION
Name of an ExtensionName that adds extensions to this control. The extensions are of type Object and are not actually used. Rather this extension informs Extensions that a CControl has been created.


EXTENSION_PARAM

public static final String EXTENSION_PARAM
name of a parameter of an ExtensionName that points to this

See Also:
Constant Field Values

KEY_MAXIMIZE_CHANGE

public static final PropertyKey<KeyStroke> KEY_MAXIMIZE_CHANGE
KeyStroke used to change a CDockable into maximized-state, or to go out of maximized-state when needed.


KEY_GOTO_MAXIMIZED

public static final PropertyKey<KeyStroke> KEY_GOTO_MAXIMIZED
KeyStroke used to change a CDockable into maximized-state.


KEY_GOTO_NORMALIZED

public static final PropertyKey<KeyStroke> KEY_GOTO_NORMALIZED
KeyStroke used to change a CDockable into normalized-state.


KEY_GOTO_MINIMIZED

public static final PropertyKey<KeyStroke> KEY_GOTO_MINIMIZED
KeyStroke used to change a CDockable into minimized-state.


KEY_GOTO_EXTERNALIZED

public static final PropertyKey<KeyStroke> KEY_GOTO_EXTERNALIZED
KeyStroke used to change a CDockable into externalized-state.


KEY_CLOSE

public static final PropertyKey<KeyStroke> KEY_CLOSE
KeyStroke used to close a CDockable.


RESIZE_LOCK_CONFLICT_RESOLVER

public static final PropertyKey<ConflictResolver<RequestDimension>> RESIZE_LOCK_CONFLICT_RESOLVER
ConflictResolver used to determine what happens when there is a conflict between two resize requests on a SplitDockStation like CGridArea, CWorkingArea or CContentArea.

See Also:
DefaultConflictResolver, FullLockConflictResolver

EXTERNALIZED_STATION_ID

public static final String EXTERNALIZED_STATION_ID
the unique id of the station that handles the externalized dockables

See Also:
Constant Field Values

CONTENT_AREA_STATIONS_ID

public static final String CONTENT_AREA_STATIONS_ID
the unique id of the default-CContentArea created by this control

See Also:
Constant Field Values
Constructor Detail

CControl

public CControl()
Creates a new control. Note that a control should know the main window of the application, thus CControl(WindowProvider) would be the better choice than this constructor.


CControl

public CControl(JFrame frame)
Creates a new control

Parameters:
frame - the main frame of the application, needed to create dialogs for externalized CDockables

CControl

@Deprecated
public CControl(boolean restrictedEnvironment)
Deprecated. it is not necessary to set the restrictedEnvironment parameter anymore, the framework will choose a fitting value itself

Creates a new control

Parameters:
restrictedEnvironment - whether this application runs in a restricted environment and is not allowed to listen for global events.

CControl

public CControl(WindowProvider window)
Creates a new control

Parameters:
window - a provider for the main window of this application. Needed to create dialogs for externalized CDockables. Must not be null, but its search method may return null

CControl

@Deprecated
public CControl(JFrame frame,
                           boolean restrictedEnvironment)
Deprecated. it is not necessary to set the restrictedEnvironment parameter anymore, the framework will choose a fitting value itself

Creates a new control

Parameters:
frame - the main frame of the application, needed to create dialogs for externalized CDockables
restrictedEnvironment - whether this application runs in a restricted environment and is not allowed to listen for global events.

CControl

@Deprecated
public CControl(WindowProvider window,
                           boolean restrictedEnvironment)
Deprecated. it is not necessary to set the restrictedEnvironment parameter anymore, the framework will choose a fitting value itself

Creates a new control

Parameters:
window - a provider for the main window of this application. Needed to create dialogs for externalized CDockables. Must not be null, but its search method may return null
restrictedEnvironment - whether this application runs in a restricted environment and is not allowed to listen for global events.

CControl

public CControl(JFrame frame,
                CControlFactory factory)
Creates a new control

Parameters:
frame - the main frame of the application, needed to create dialogs for externalized CDockables
factory - a factory which is used to create new elements for this control.

CControl

public CControl(WindowProvider window,
                CControlFactory factory)
Creates a new control

Parameters:
window - a provider for the main window of this application. Needed to create dialogs for externalized CDockables. Must not be null, but its search method may return null
factory - a factory which is used to create new elements for this control.

CControl

protected CControl(WindowProvider window,
                   CControlFactory factory,
                   boolean init)
Creates a new control

Parameters:
window - a provider for the main window of this application. Needed to create dialogs for externalized CDockables. Must not be null, but its search method may return null
factory - a factory which is used to create new elements for this control.
init - if true then this constructor calls init(WindowProvider, CControlFactory), otherwise this constructor does nothing and returns immediately. Subclasses should call init(WindowProvider, CControlFactory) in that case.
Method Detail

init

protected void init(WindowProvider window,
                    CControlFactory factory)
Initializes the fields of this CControl. This method is called during construction of this CControl. Subclasses may use CControl(WindowProvider, CControlFactory, boolean) to create an uninitialized CControl and then call this method by themselves.

Parameters:
window - a provider for the main window of this application. Needed to create dialogs for externalized CDockables. Must not be null, but its search method may return null
factory - a factory which is used to create new elements for this control.

initExtensions

protected void initExtensions(DockController controller)
Initializes additional Extensions and registers them at the ExtensionManager of controller.

Parameters:
controller - the controller for which additional extensions should be loaded

initTransferFocusOnMinimize

protected void initTransferFocusOnMinimize(DockController controller)
Adds a CDockableStateListener to this CControl, if a CDockable is minimized, another Dockable receives the focus. Subclasses may override this method to disable or modify the feature.

Parameters:
controller - the controller used by this CControl
See Also:
setTransferFocusOnMinimize(boolean)

initExternalizeArea

protected void initExternalizeArea()
Called during construction of this CControl, this method creates a new CExternalizeArea and registers it as root-station using the unique identifier "external".
Subclasses may override this method and not create a CExternalizeArea or create a customized CExternalizeArea.


initFactories

protected void initFactories()
Called during construction of this CControl, this method adds DockFactorys to the intern representation of this CControl.


initProperties

protected void initProperties()
Sets up the default properties. While subclasses can override this method, they should call this method first. Some parts of this CControl will not work correctly if the wrong properties are set or if no properties are set at all.


initIcons

protected void initIcons()
Sets up all the default icons used in the ralm of this CControl.


initTexts

protected void initTexts()
Sets up all the default text that is used in the realm of this CControl


setLanguage

public void setLanguage(Locale locale)
Re-initializes the default text that is used in the realm of this CControl.

Parameters:
locale - the new language, must not be null

initTexts

protected void initTexts(Locale locale)
Sets up all the default text that is used in the realm of this CControl

Parameters:
locale - what language to use

initPersistentStorage

protected void initPersistentStorage()
Creates new ApplicationResources and registers them at the ApplicationResourceManager of this CControl. While subclasses can override this method, they should be aware that missing ApplicationResources will break persistent storage for the location and size of Dockables.


addControlListener

public void addControlListener(CControlListener listener)
Adds a listener to this control.

Parameters:
listener - the new listener

removeControlListener

public void removeControlListener(CControlListener listener)
Removes a listener from this control.

Parameters:
listener - the listener to remove

addFocusListener

public void addFocusListener(CFocusListener listener)
Adds a new focus listener to this control. The listener gets informed about changes in the focus.

Parameters:
listener - the new listener

removeFocusListener

public void removeFocusListener(CFocusListener listener)
Removes a listener from this control.

Parameters:
listener - the listener to remove

getFocusedCDockable

public CDockable getFocusedCDockable()
Gets the currently focused CDockable. This might be null if some Dockable that is not a CommonDockable has the focus.

Returns:
the currently focused CDockable, can be null
See Also:
addFocusListener(CFocusListener), DockController.getFocusedDockable()

addVetoFocusListener

public void addVetoFocusListener(CVetoFocusListener listener)
Adds a new veto focus listener to this control. The listener gets informed about pending changes in the focus.

Parameters:
listener - the new listener

removeVetoFocusListener

public void removeVetoFocusListener(CVetoFocusListener listener)
Removes a listener from this control.

Parameters:
listener - the listener to remove

addStateListener

public void addStateListener(CDockableStateListener listener)
Adds a global state listener. This has the same effect as adding a state listener to each CDockable that is known to this control.

Parameters:
listener - the new listener

removeStateListener

public void removeStateListener(CDockableStateListener listener)
Removes a global state listener.

Parameters:
listener - the listener to remove

addPropertyListener

public void addPropertyListener(CDockablePropertyListener listener)
Adds a global property listener. This has the same effect as adding a property listener to each CDockable that is known to this control.

Parameters:
listener - the new listener

removePropertyListener

public void removePropertyListener(CDockablePropertyListener listener)
Removes a global listener from this control.

Parameters:
listener - the listener to remove

addKeyboardListener

public void addKeyboardListener(CKeyboardListener listener)
Adds a global keyboard listener to this control. The listener gets informed whenever a key is touched on a Component which is a child of a CDockable.
Note: listeners directly added to a CDockable will always be informed first.
Note: if a listener processes the event, then the other listeners will not be informed.

Parameters:
listener - the new listener

removeKeyboardListener

public void removeKeyboardListener(CKeyboardListener listener)
Removes a listener from this control.

Parameters:
listener - the listener to remove

addGlobalKeyListener

public void addGlobalKeyListener(KeyListener listener)
Adds a key listener to this control that will be informed about any KeyEvent that gets processed or analyzed by this control. Especially any event that gets forwarded to a CKeyboardListener gets also forwarded to listener.

Parameters:
listener - the new listener

removeGlobalKeyListener

public void removeGlobalKeyListener(KeyListener listener)
Removes a global KeyListener from this control.

Parameters:
listener - the listener to remove

addDoubleClickListener

public void addDoubleClickListener(CDoubleClickListener listener)
Adds a global mouse double click listener to this control. The listener gets informed whenever the mouse is clicked twice on a Component which is a child of a CDockable.
Note: listeners directly added to a CDockable will always be informed first.
Note: if a listener processes the event, then the other listeners will not be informed.

Parameters:
listener - the new listener

removeDoubleClickListener

public void removeDoubleClickListener(CDoubleClickListener listener)
Removes a listener from this control.

Parameters:
listener - the listener to remove

addVetoClosingListener

public void addVetoClosingListener(CVetoClosingListener listener)
Adds listener to this control, the listener will be informed whenever a set of CDockables is about to be closed.
CVetoClosingListeners added to the CControl are invoked before listeners that are added to a CDockable.

Parameters:
listener - the new listener, not null

removeVetoClosingListener

public void removeVetoClosingListener(CVetoClosingListener listener)
Removes a listener from this control.

Parameters:
listener - the listener to remove

setIgnoreWorkingForEntry

public void setIgnoreWorkingForEntry(boolean ignore)
Informs this CControl whether location of CDockables that are associated with a working area should be stored when storing a layout.
This method installs a DockSituationIgnore on the intern DockFrontend, the filter is only used for "normal entries", "final entries" (does stored when the application shuts down) are not affected.
The default value for this property is true.

Parameters:
ignore - if true then some CDockables are filtered out, otherwise their location is stored.

destroy

public void destroy()
Frees as much resources as possible. This CControl will no longer work correctly after this method was called.


createWorkingArea

public CWorkingArea createWorkingArea(String uniqueId)
Creates and adds a new CWorkingArea to this control. The area is not made visible by this method.

Parameters:
uniqueId - the unique id of the area
Returns:
the new area

createMinimizeArea

public CMinimizeArea createMinimizeArea(String uniqueId)
Creates a new area where minimized CDockables can be stored. This method adds the new area directly as a root station to this control.

Parameters:
uniqueId - a unique identifier
Returns:
the new area

createGridArea

public CGridArea createGridArea(String uniqueId)
Creates a new area where normalized CDockables can be stored. This method adds the new area directly as a root station to this control

Parameters:
uniqueId - a unique identifier
Returns:
the new area

createContentArea

public CContentArea createContentArea(String uniqueId)
Creates and adds a new CContentArea.

Parameters:
uniqueId - the unique id of the new contentarea, the id must be unique in respect to all other contentareas which are registered at this control.
Returns:
the new contentarea
Throws:
IllegalArgumentException - if the id is not unique
NullPointerException - if the id is null

addStationContainer

public void addStationContainer(CStationContainer container)
Adds container to this control. All children CStations of container will be added as root station to this control.

Parameters:
container - the additional set of stations
Throws:
IllegalArgumentException - if container is already registered or if the unique identifier of container is already known
NullPointerException - if container is null

removeContentArea

@Deprecated
public void removeContentArea(CContentArea content)
Deprecated. use removeStationContainer(CStationContainer) instead

Removes content from the list of known contentareas. This also removes the stations of content from this control. Elements aboard the stations are made invisible, but not removed from this control.

Parameters:
content - the contentarea to remove
Throws:
IllegalArgumentException - if the default-contentarea equals content

removeStationContainer

public void removeStationContainer(CStationContainer container)
Removes container from the list of known CStationContainers. This also ensures that all child CStations of container are removed. Elements aboard the stations are made invisible, but not removed from this CControl.

Parameters:
container - the set of stations to remove
Throws:
IllegalArgumentException - if container is the default CContentArea

getRegister

public CControlRegister getRegister()
Gets the set of dockables, stations and other elemnts that are used by this control.

Returns:
the set of elements, never null

getContentAreas

@Deprecated
@Todo(compatibility=BREAK_MINOR,
      priority=MINOR,
      target=VERSION_1_1_2,
      description="remove this method, replace by \'getStationContainers\'")
public List<CContentArea> getContentAreas()
Deprecated. use getStationContainers() instead

Gets an unmodifiable list of all CContentAreas registered at this control

Returns:
the list of content-areas

getStationContainers

public List<CStationContainer> getStationContainers()
Gets an unmodifiable list of all CStationContainers that are registered at this CControl.

Returns:
the list of containers

getFactory

public CControlFactory getFactory()
Gets the factory which is mainly used to create new elements for this control.

Returns:
the factory

getLocationManager

public CLocationModeManager getLocationManager()
Gets the manager that is responsible to handle all changes of the modes (maximized, normalized, ... ) of Dockables.
Note: clients should be careful when working with the location manager. Changing the properties of the location manager might introduce failures that are not visible directly.

Returns:
the manager

addDestroyHook

public void addDestroyHook(DestroyHook hook)
Adds a destroy-hook. The hook is called when this CControl is destroyed through destroy().

Parameters:
hook - the new hook

removeDestroyHook

public void removeDestroyHook(DestroyHook hook)
Removes a destroy-hook from this CControl.

Parameters:
hook - the hook to remove

getResources

public ApplicationResourceManager getResources()
Grants access to the manager that reads and stores configurations of the common-project.
Clients can add their own ApplicationResources to this manager, however clients are strongly discouraged from removing ApplicationResource which they did not add by themself.

Returns:
the persistent storage

putProperty

public <A> void putProperty(PropertyKey<A> key,
                            A value)
Changes the value of a property. The incomplete list of properties, in alphabetical order, includes: (properties marked with '*' should not be changed by clients if using the Common project). BubbleTheme.ACTION_DISTRIBUTORFlatTheme.ACTION_DISTRIBUTOR
Default instance of a DockActionDistributor.
Default instance of a DockActionDistributor.
DockTheme.BACKGROUND_PAINT The default value of the BackgroundPaint.
BasicTheme.BASIC_COLOR_SCHEMEThe ColorScheme to use if the BasicTheme is installed.
DockTheme.BORDER_MODIFIER The default value of the BorderModifier.
ScreenDockStation.BOUNDARY_RESTRICTIONHow far the user can push a window with a Dockable out of the screen(s).
BubbleTheme.BUBBLE_COLOR_SCHEME The ColorScheme to use if the BubbleTheme is installed.
FlapDockStation.BUTTON_CONTENT Tells what content should be on the buttons that represent minimized Dockables.
FlapDockStation.BUTTON_CONTENT_FILTER Tells which DockActions should be shown on a button representing a minimized Dockable.
CCONTROL The CControl in whose realm the property is read, is a read-only property.
DockTheme.COMBINER Default value of the Combiner.
StackDockStation.COMPONENT_FACTORY The factory creating the "tabbed panes" of the StackDockStation.
DockTheme.DISPLAYER_FACTORY Default value of the DisplayerFactory.
PropertyKey.DOCK_STATION_ICON The default icon of DockStations.
PropertyKey.DOCK_STATION_TITLE The default title of DockStations.
PropertyKey.DOCK_STATION_TOOLTIP The default tooltip of DockStations.
PropertyKey.DOCKABLE_ICON The default icon of Dockables.
DockTheme.DOCKABLE_MOVING_IMAGE_FACTORY Default value of the DockableMovingImageFactory.
DockTheme.DOCKABLE_SELECTION Default value of the DockableSelection.
PropertyKey.DOCKABLE_TITLE The default title of Dockables.
PropertyKey.DOCKABLE_TOOLTIP The default tooltip of Dockables.
LocationModeManager.DOUBLE_CLICK_STRATEGY Tells what happens if the user double clicks on a DockTitle or a Dockable.
EclipseTheme.ECLIPSE_COLOR_SCHEME The ColorScheme to use if the EclipseTheme is installed.
ScreenDockStation.EXPAND_ON_DOUBLE_CLICK Whether a double click on a child of a ScreenDockStation should maximize the child.
FlatTheme.FLAT_COLOR_SCHEME The ColorScheme to use if the FlatTheme is installed.
ScreenDockStation.FULL_SCREEN_STRATEGY Defines when a floating Dockable is considered to be in fullscreen mode.
DockFrontend.HIDE_ACCELERATOR The KeyStroke that will call DockFrontend.hide(Dockable)
DockableSelector.INIT_SELECTION The KeyStroke that opens a window where the user can select a new Dockable.
StackDockStation.IMMUTABLE_SELECTION_INDEX Prevents the StackDockStation from switching the selected index on a drop operation (but does not prevent the FocusManager from switching the focus!).
KEY_CLOSE The KeyStroke that closes a CDockable.
KEY_GOTO_EXTERNALIZED The KeyStroke that externalizes a CDockable.
KEY_GOTO_MAXIMIZED The KeyStroke that maximizes a CDockable.
KEY_GOTO_MINIMIZED The KeyStroke that minimizes a CDockable.
KEY_GOTO_NORMALIZED The KeyStroke that normalizes a CDockable.
KEY_MAXIMIZE_CHANGE The KeyStroke that either maximizes or normalizes a CDockable.
FlapDockStation.LAYOUT_MANAGER Tells the FlapDockStation the size and the hold property of its children.
SplitDockStation.LAYOUT_MANAGER Logic of all SplitDockStations, used when dropping a Dockable or resizing the station.
TabPane.LAYOUT_MANAGER Defines the size and location of tabs of a stack.
SplitDockStation.MAXIMIZE_ACCELERATOR The KeyStroke that maximizes a child of a SplitDockStation.
CombinedMenuContent.MENU_CONTENT The menu that shows overflowing Dockables on a stack.
IconManager.MINIMUM_ICON_SIZEThe expected minimal size of all icons.
FlapDockStation.MINIMUM_SIZE The mimimum size of the Component that represents the FlapDockStation.
LocationModeManager.MODE_ENABLEMENT Tells which CDockable is allowed to have which ExtendedMode.
DockRelocatorMode.NO_COMBINATION_MASK What keys the user has to press during a drag and drop operation to prevent the framework from combining Dockables.
DockTitle.ORIENTATION_STRATEGY Tells how to rotate text on a DockTitle.
EclipseTheme.PAINT_ICONS_WHEN_DESELECTED Whether to paint icons on unselected tabs if using the EclipseTheme.
PlaceholderStrategy.PLACEHOLDER_STRATEGY A strategy that creates placeholders for Dockables, see CPlaceholderStrategy.
RESIZE_LOCK_CONFLICT_RESOLVER Tells what happens if two CDockables have a locked size and the user is resizing the parent of these two elements.
DockController.RESTRICTED_ENVIRONMENT Tells whether the application runs as applet/with webstart or as free or authenticated application.
DockRelocatorMode.SCREEN_MASK The keys the user has to press during a drag and drop operation to ensure that the Dockable is added to a ScreenDockStation.
SingleTabDecider.SINGLE_TAB_DECIDER Tells which Dockables should be presented with a single tab - even if there is no reason to show a tab.
DockTheme.STATION_PAINT The default value of StationPaint.
AWTComponentCaptureStrategy.STRATEGY How to make an image of an AWT component.
DisablingStrategy.STRATEGYWhich element to disable.
StackDockStation.TAB_CONTENT_FILTER A filter deciding what content to show on a tab of a StackDockStation.
EclipseTheme.TAB_PAINTER The look of tabs if using the EclipseTheme.
StackDockStation.TAB_PLACEMENT The location of the tabs on a StackDockStation.
EclipseTheme.THEME_CONNECTOR Detailed instructions how to present a Dockable if using the EclipseTheme.
FlapDockStation.WINDOW_FACTORY A factory creating FlapWindows for the FlapDockStation.
ScreenDockStation.WINDOW_FACTORY A factory creating ScreenDockWindows for the ScreenDockStation.

Type Parameters:
A - the type of the value
Parameters:
key - the name of the property
value - the new value, can be null

putProperty

protected <A> void putProperty(PropertyKey<A> key,
                               A value,
                               Priority priority)
Changes the value of a property.

Type Parameters:
A - the type of the value
Parameters:
key - the name of the property
priority - the priority of the new value
value - the new value, can be null
See Also:
putProperty(PropertyKey, Object)

getProperty

public <A> A getProperty(PropertyKey<A> key)
Gets the value of a property.

Type Parameters:
A - the type of the property
Parameters:
key - the name of the property
Returns:
the value or null

getContentArea

public CContentArea getContentArea()
Gets the element that should be in the center of the mainframe. The CContentArea is created the first time this method is called.

Returns:
the center of the mainframe of the application

addStation

public void addStation(CStation<?> station)
Adds an additional station to this control.

Parameters:
station - the new station

addStation

public void addStation(CStation<?> station,
                       boolean root)
Adds an additional station to this control. Most CStations should be root-stations, even if they are nested.

Parameters:
station - the new station
root - true if the station should be a root station. A root station may or may not have any parent station. The location of a CDockable is always relative to the first root station that can be found when travelling the tree upwards. For most stations this attribute should be true

isRootStation

public boolean isRootStation(CStation<?> station)
Tells whether station was added to this CControl with the root flag set to true.

Parameters:
station - the station whose root flag is asked
Returns:
the value of the root flag or false if station is not registered at all

remove

@Deprecated
@Todo(compatibility=BREAK_MINOR,
      priority=MINOR,
      target=VERSION_1_1_2,
      description="remove this method and replace by \'removeStation\'")
public void remove(CStation<?> station)
Deprecated. use removeStation(CStation) instead

Removes a CStation from this control. It is unspecified what happens with the children on station

Parameters:
station - the station to remove

removeStation

public void removeStation(CStation<?> station)
Removes a CStation from this control. It is unspecified what happens with the children on station

Parameters:
station - the station to remove

getStations

public List<CStation<?>> getStations()
Gets an unmodifiable list of all stations that are currently registered at this control.

Returns:
the list of stations

getStation

public CStation<?> getStation(DockStation intern)
Searches the CStation whose internal representation is intern.

Parameters:
intern - the internal representation
Returns:
the station or null

getStation

public CStation<?> getStation(String id)
Searches the CStation with unique identifier id.

Parameters:
id - the identifier
Returns:
the station or null

addDockable

public <S extends SingleCDockable> S addDockable(S dockable)
Adds a dockable to this control. The dockable can be made visible afterwards. This method will do nothing if dockable was already registered at this CControl.

Type Parameters:
S - the type of the new element
Parameters:
dockable - the new element to show
Returns:
dockable
Throws:
IllegalArgumentException - if dockable already is registered at another CControl or if the unique id of dockable already is used for another object

getSingleDockable

public SingleCDockable getSingleDockable(String id)
Searches for the SingleCDockable which has the unique identifier id.

Parameters:
id - the identifier to look out for
Returns:
the element with that identifier or null

removeSingleDockable

public boolean removeSingleDockable(String id)
Removes the SingleCDockable with the identifier id. This has the same effect as calling remove(SingleCDockable).

Parameters:
id - the id of the element to remove
Returns:
true if the element was removed, false otherwise

removeDockable

public boolean removeDockable(SingleCDockable dockable)
Removes dockable from this control. The location information for dockable remains stored if either there is a SingleCDockableFactory registered or the MissingCDockableStrategy tells to store the values.

Parameters:
dockable - the element to remove
Returns:
true if the element was removed, false otherwise

remove

@Deprecated
@Todo(compatibility=BREAK_MAJOR,
      priority=ENHANCEMENT,
      target=VERSION_1_1_2,
      description="remove this method")
public boolean remove(SingleCDockable dockable)
Deprecated. Please use removeDockable(SingleCDockable) instead, this method will be removed in a future release

Removes dockable from this control. The location information for dockable remains stored if either there is a SingleCDockableFactory registered or the MissingCDockableStrategy tells to store the values.

Parameters:
dockable - the element to remove
Returns:
true if the element was removed, false otherwise

addSingleDockableFactory

public void addSingleDockableFactory(String id,
                                     SingleCDockableFactory backupFactory)
Adds a factory to this control. The factory will be used to create and add a SingleCDockable when one is requested that is not yet in the cache.
If there is already information for id available and id should be visible, then the factory will be used instantaneously.
Factories added with a specific identifier always have higher priority than factories added with a filter, see addSingleDockableFactory(Filter, SingleCDockableFactory).

Parameters:
id - the id of the dockable that might be requested
backupFactory - the new factory

addSingleDockableFactory

public void addSingleDockableFactory(Filter<String> ids,
                                     SingleCDockableFactory factory)
Adds a factory to this control. The factory will be used to create and add a SingleCDockable when one is requested that is not yet in the cache.
If there is already information for identifiers that are included by ids available and if they should be visible, then the factory will be used instantaneously to create these elements. During this action factory has a higher priority than any other factory.
Factories added with a general filter always have lower priority than factories that were added with a specific identifier. The factories are stored in a list and a search starts at the front of that list, so a factory added early has higher priority than a factory that was added lately.

Parameters:
ids - a filter telling which dockables can be handled by factory
factory - the new factory

getSingleDockableFactory

public SingleCDockableFactory getSingleDockableFactory(String id)
Searches the SingleCDockableFactory which is responsible for creating the SingleCDockable with identifier id. This method first searches for a factory which was added with a specific identifier (addSingleDockableFactory(String, SingleCDockableFactory)), if nothing is found then the factories with a filter are searched (addSingleDockableFactory(Filter, SingleCDockableFactory)).

Parameters:
id - the identifier of some factory
Returns:
the factory or null

removeSingleDockableFactory

public void removeSingleDockableFactory(SingleCDockableFactory factory)
Removes all occurrences of factory. Any location information that was held because of the existence of factory will be removed as well.

Parameters:
factory - the factory to remove

removeSingleDockableFactory

public void removeSingleDockableFactory(String id)
Removes a factory from this control. Location information for id will be deleted if neither a SingleCDockable is added nor the MissingCDockableStrategy tells to store the information.

Parameters:
id - the name of the factory
See Also:
addSingleDockableFactory(String, SingleCDockableFactory)

addDockable

public <M extends MultipleCDockable> M addDockable(M dockable)
Adds a dockable to this control. The dockable can be made visible afterwards. A random identifier is assigned to dockable, clients can also use addDockable(String, MultipleCDockable) if they want to specify the identifier themselves.

Type Parameters:
M - the type of the new element
Parameters:
dockable - the new element to show
Returns:
dockable

addDockable

public <M extends MultipleCDockable> M addDockable(String uniqueId,
                                                   M dockable)
Adds a dockable to this control. The dockable can be made visible afterwards. This method will throw an exception when the unique identifier is already in use. Clients can also use addDockable(MultipleCDockable) if they want to assign a random identifier to dockable.

Type Parameters:
M - the type of the new element
Parameters:
uniqueId - id the unique id of the new element
dockable - the new element to show
Returns:
dockable
Throws:
IllegalArgumentException - if the unique identifier is already in use, if dockable is already used elsewhere, if there is no factory for dockable
NullPointerException - if any argument is null

replace

public void replace(MultipleCDockable oldDockable,
                    MultipleCDockable newDockable)
Replaces oldDockable with newDockable. The new dockable inherits settings and location of the old one.

Parameters:
oldDockable - the old dockable, not null
newDockable - the new dockable, not null

getMultipleDockable

public MultipleCDockable getMultipleDockable(String id)
Searches and returns the one MultipleCDockable which uses the unique identifier id.

Parameters:
id - the identifier to look out for
Returns:
the element using id or null if nothing was found

removeDockable

public void removeDockable(MultipleCDockable dockable)
Removes a dockable from this control. The dockable is made invisible.

Parameters:
dockable - the element to remove

remove

@Deprecated
@Todo(compatibility=BREAK_MAJOR,
      priority=ENHANCEMENT,
      target=VERSION_1_1_2,
      description="remove this method")
public void remove(MultipleCDockable dockable)
Deprecated. please use removeDockable(MultipleCDockable) instead, this method will be removed in a future release

Removes a dockable from this control. The dockable is made invisible.

Parameters:
dockable - the element to remove

getCDockableCount

public int getCDockableCount()
Gets the number of CDockables that are registered in this CControl.

Returns:
the number of dockables

getCDockable

public CDockable getCDockable(int index)
Gets the index'th dockable that is registered in this control

Parameters:
index - the index of the element
Returns:
the selected dockable

addMultipleDockableFactory

public void addMultipleDockableFactory(String id,
                                       MultipleCDockableFactory<?,?> factory)
Adds a factory to this control. The factory will create MultipleCDockables when a layout is loaded. The NullMultipleCDockableFactory will always be preinstalled using the empty identifier.

Parameters:
id - the unique id of the factory, must consist of at least one character
factory - the new factory

getMultipleDockableFactory

public MultipleCDockableFactory<?,?> getMultipleDockableFactory(String id)
Searches for the MultipleCDockableFactory with the identifier id.

Parameters:
id - the identifier to search for
Returns:
the factory or null

removeMultipleDockableFactory

public void removeMultipleDockableFactory(String id)
Removes the MultipleCDockableFactory with identifier id from this control. As a side effect all MultipleCDockables which use that factory are removed as well. Nothing happens if there is no factory registered with id.

Parameters:
id - the identifier of the factory to remove

setDefaultLocation

public void setDefaultLocation(CLocation defaultLocation)
Sets the location where CDockables are opened when there is nothing else specified for these CDockables.

Parameters:
defaultLocation - the location, can be null

getDefaultLocation

public CLocation getDefaultLocation()
Gets the location where CDockables are opened when nothing else is specified.

Returns:
the location, might be null
See Also:
setDefaultLocation(CLocation)

setMaximizeArea

public void setMaximizeArea(String id)
Makes sure that all CDockables are maximized onto the area which is registered under the given unique id.

Parameters:
id - the unique id of the area
See Also:
CGridArea.getUniqueId(), CContentArea.getCenterIdentifier()

setGroupBehavior

public void setGroupBehavior(CGroupBehavior behavior)
Sets the CGroupBehavior. The behavior decides what happens when the user wants to change the ExtendedMode of a CDockable.
To be exact: the group behavior is applied for a call to CDockable.setExtendedMode(ExtendedMode) respective a call to LocationModeManager.setMode(Dockable, ExtendedMode). The buttons that are visible to the user all link to these methods.

Parameters:
behavior - the new behavior, not null

getGroupBehavior

public CGroupBehavior getGroupBehavior()
Gets the currently used CGroupBehavior.

Returns:
the current behavior, not null
See Also:
setGroupBehavior(CGroupBehavior)

setTheme

@Deprecated
public void setTheme(DockTheme theme)
Deprecated. replaced by setTheme(String). While this method still works, the theme will not get stored persistent and any module using the ThemeMap (getThemes()) will not be informed about the change.

Sets the theme of the elements in the realm of this control.

Parameters:
theme - the new theme

setTheme

public void setTheme(String theme)
Sets the theme of the elements in the realm of this control. The String theme is used as key for ThemeMap.select(String).

Parameters:
theme - the name of the theme, this might be one of ThemeMap.KEY_BASIC_THEME, ThemeMap.KEY_BUBBLE_THEME, ThemeMap.KEY_ECLIPSE_THEME, ThemeMap.KEY_FLAT_THEME or ThemeMap.KEY_SMOOTH_THEME. This can also be a any other string which was used for ThemeMap.put(String, ThemeFactory), ThemeMap.add(String, ThemeFactory) or ThemeMap.insert(int, String, ThemeFactory).

getThemes

public ThemeMap getThemes()
Gets the list of installed themes.

Returns:
the list of themes

setMissingPerspectiveStrategy

public void setMissingPerspectiveStrategy(MissingPerspectiveStrategy missingPerspectiveStrategy)
Sets a strategy that creates missing CStationPerspectives.

Parameters:
missingPerspectiveStrategy - the strategy, not null

getMissingPerspectiveStrategy

public MissingPerspectiveStrategy getMissingPerspectiveStrategy()
Gets the strategy that is used to create missing CStationPerspective.

Returns:
the strategy, not null

getPerspectives

public CControlPerspective getPerspectives()
Grants access to the perspective API which allows clients to build complex layouts without the need to create any dockables or stations.

Returns:
access a wrapper around this CControl allowing to inspect and modify the layouts that are available
See Also:
load(String), save(String), setMissingPerspectiveStrategy(MissingPerspectiveStrategy)

setRootWindow

public void setRootWindow(WindowProvider window)
Sets the root window of the application. The root window is used as owner of any dialog that is created. Already existing dialogs may be closed and reopened in order to change the owner. Short living dialogs will not change their owner.

Parameters:
window - the new owner, can be null

getRootWindow

public WindowProvider getRootWindow()
Gets the root window of the application. Note that this method might not return the same object as given to setRootWindow(WindowProvider), however the provide returned by this method will return the same window as specified by setRootWindow(WindowProvider).

Returns:
the provider, never null

getPreferences

public PreferenceStorage getPreferences()
Gets the storage container for PreferenceModels for this control. The contents of this container are stored in the resource manager.

Returns:
the storage for preferences
See Also:
getResources()

setPreferenceModel

public void setPreferenceModel(PreferenceModel preferenceModel)
Sets the PreferenceModel which will be used to translate between this and the preferences. This model can be set to null.
The default value of this property is null.

Parameters:
preferenceModel - the new model, it will used to translate the contents of getPreferences() immediately, can be null

getPreferenceModel

public PreferenceModel getPreferenceModel()
Gets the preference model which is used to translate between the preferences and this.

Returns:
the model, can be null
See Also:
setPreferenceModel(PreferenceModel)

setMissingStrategy

public void setMissingStrategy(MissingCDockableStrategy missingStrategy)
Sets the strategy that tells what to do if layout information of a missing CDockable is found.

Parameters:
missingStrategy - the strategy, null will set the default strategy

getMissingStrategy

public MissingCDockableStrategy getMissingStrategy()
Gets the strategy that tells what to do if layout information of a missing CDockable is found.

Returns:
the strategy, never null

addResizeRequestListener

public void addResizeRequestListener(ResizeRequestListener listener)
Adds a ResizeRequestListener to this CControl. The listener will be informed when the resize requests of a CDockable should be processed.

Parameters:
listener - the new listener, not null

removeResizeRequestListener

public void removeResizeRequestListener(ResizeRequestListener listener)
Removes a ResizeRequestListener from this CControl.

Parameters:
listener - the listener to remove

handleResizeRequests

public void handleResizeRequests()
Informs all ResizeRequestListeners, that the resize request of all CDockables should be processed. There are no guarantees that a resize requests can be granted or even gets processed.
All requests, independent from whether they were processed, will be deleted by this method.
Note that a request might conflict with a "resize lock" CDockable.isResizeLockedHorizontally() and CDockable.isResizeLockedVertically(). The behavior of that case is not specified, but clients can assume that the locked components introduce additional resize requests.


intern

public CDockFrontend intern()
Gets the representation of the layer beneath the common-layer.

Returns:
the entry point to DockingFrames

getController

public DockController getController()
Gets the DockController which is used by this CControl.

Returns:
the core system of the framework

getIcons

public IconManager getIcons()
Grants access to all the Icons that are used within the realm of this CControl. Clients are free to modify the set of icons.

Returns:
the set of icons that are used

setRevertToBasicModes

public void setRevertToBasicModes(boolean revert)
Tells this control whether basic modes like "normalized", "minimized" or "externalized" are forced upon Dockables after loading a persistent layout. Basically if this property is set, then all Dockables are un-maximized after a layout change. The default value of this property is true.
The reasons behind forcing basic modes are:

Parameters:
revert - whether non-basic modes should be forbidden when loading a persistent layout

isRevertToBasicModes

public boolean isRevertToBasicModes()
Tells whether basic modes are forcibly applied when loading a persistent layout.

Returns:
whether the non-basic modes are forbidden
See Also:
setRevertToBasicModes(boolean)

setTransferFocusOnMinimize

public void setTransferFocusOnMinimize(boolean transferFocusOnMinimize)
If a CDockable is minimized, the focus can be automatically transfered to another CDockable. This feature is implemented by the method initTransferFocusOnMinimize(DockController), which may be overriden by subclasses.

Parameters:
transferFocusOnMinimize - whether to enable the feature or not (default is true)

isTransferFocusOnMinimize

public boolean isTransferFocusOnMinimize()
If a CDockable is minimized, the focus can be automatically transfered to another Dockable.

Returns:
whether the focus will be transfered
See Also:
setTransferFocusOnMinimize(boolean)

write

public void write(File file)
           throws IOException
Writes the current and all known layouts into file.
This is the same as calling getResources().writeFile( file ).

Parameters:
file - the file to override
Throws:
IOException - if the file can't be written

write

public void write(DataOutputStream out)
           throws IOException
Writes the current and all known layouts into out.
This is the same as calling getResources().writeStream( out ).

Parameters:
out - the stream to write into
Throws:
IOException - if the stream is not writable

writeXML

public void writeXML(XElement element)
Writes the current and all known layouts into element.
This is the same as calling getResources().writeXML( element ).

Parameters:
element - the element to write into

writeXML

public void writeXML(File file)
              throws IOException
Writes the current and all known layouts into file in xml format.

Parameters:
file - the file to write into
Throws:
IOException - if the file is not writable

read

public void read(File file)
          throws IOException
Reads the current and other known layouts from file.
This is the same as calling getResources().readFile( file ).

Parameters:
file - the file to read from
Throws:
IOException - if the file can't be read

read

public void read(DataInputStream in)
          throws IOException
Reads the current and other known layouts from in.
This is the same as calling getResources().readStream( in ).

Parameters:
in - the stream to read from
Throws:
IOException - if the stream can't be read

readXML

public void readXML(XElement element)
Reads the current and other known layouts from element.
This is the same as calling getResources().readXML( element ).

Parameters:
element - the element to read
Throws:
XException - if the xml file has the wrong structure

readXML

public void readXML(File file)
             throws IOException
Reads the current and other known layouts from file.

Parameters:
file - the file to open and to read
Throws:
IOException - if the file cannot be read
XException - if the xml file has the wrong structure

save

public void save(String name)
Stores the current layout with the given name. This creates "entry" (partial) layout information.

Parameters:
name - the name of the current layout.

load

public void load(String name)
Loads an earlier stored layout.

Parameters:
name - the name of the layout.

delete

public void delete(String name)
Deletes a layout that has been stored earlier.

Parameters:
name - the name of the layout to delete

layouts

public String[] layouts()
Gets a list of all layouts that are currently known.

Returns:
the list of layouts