Package bibliothek.gui.dock.common
Class CControl
java.lang.Object
bibliothek.gui.dock.common.CControl
Manages the interaction between
Clients which do no longer need a
A
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:
- add/remove a global listener.
- add/remove/access
CDockables,CStations andCStationContainers. - add/remove/access factories for
CDockables. - read/write/apply the layout, this includes reading/writing from files.
- store properties, like for example the
theme.
- Author:
- Benjamin Sigg
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PropertyKey<CControl>A key for thisCControl.static final PathName of anExtensionNamethat adds extensions to this control.static final PropertyKey<CloseActionFactory>This factory creates the actions that close dockables.static final Stringthe unique id of the default-CContentAreacreated by this controlstatic final Stringname of a parameter of anExtensionNamethat points tothisstatic final Stringthe unique id of the station that handles the externalized dockablesstatic final PropertyKey<CGroupingBehavior>The grouping behavior defines howDockables tend to automatically group together.static final PropertyKey<KeyStroke>KeyStrokethat can be hit during a drag and drop operation, that will cancel the operation (default is ESCAPE).static final PropertyKey<KeyStroke>static final PropertyKey<KeyStroke>static final PropertyKey<KeyStroke>static final PropertyKey<KeyStroke>static final PropertyKey<KeyStroke>static final PropertyKey<KeyStroke>static final PropertyKey<ConflictResolver<RequestDimension>>ConflictResolverused to determine what happens when there is a conflict between two resize requests on aSplitDockStationlikeCGridArea,CWorkingAreaorCContentArea. -
Constructor Summary
ConstructorsModifierConstructorDescriptionCControl()Creates a new control.CControl(boolean restrictedEnvironment) Deprecated.CControl(WindowProvider window) Creates a new controlCControl(WindowProvider window, boolean restrictedEnvironment) Deprecated.it is not necessary to set therestrictedEnvironmentparameter anymore, the framework will choose a fitting value itselfCControl(WindowProvider window, CControlFactory factory) Creates a new controlprotectedCControl(WindowProvider window, CControlFactory factory, boolean init) Creates a new controlCreates a new controlDeprecated.it is not necessary to set therestrictedEnvironmentparameter anymore, the framework will choose a fitting value itselfCControl(JFrame frame, CControlFactory factory) Creates a new control -
Method Summary
Modifier and TypeMethodDescriptionvoidaddControlListener(CControlListener listener) Adds a listener to this control.voidaddDestroyHook(DestroyHook hook) Adds a destroy-hook.<M extends MultipleCDockable>
MaddDockable(String uniqueId, M dockable) Adds a dockable to this control.<M extends MultipleCDockable>
MaddDockable(M dockable) Adds a dockable to this control.<S extends SingleCDockable>
SaddDockable(S dockable) Adds a dockable to this control.voidaddDoubleClickListener(CDoubleClickListener listener) Adds a global mouse double click listener to this control.voidaddFocusListener(CFocusListener listener) Adds a new focus listener to this control.voidaddGlobalKeyListener(KeyListener listener) Adds a key listener to this control that will be informed about anyKeyEventthat gets processed or analyzed by this control.voidaddKeyboardListener(CKeyboardListener listener) Adds a global keyboard listener to this control.voidaddMultipleDockableFactory(String id, MultipleCDockableFactory<?, ?> factory) Adds a factory to this control.voidaddPropertyListener(CDockablePropertyListener listener) Adds a global property listener.voidAdds aResizeRequestListenerto thisCControl.voidaddSingleDockableFactory(Filter<String> ids, SingleCDockableFactory factory) Adds a factory to this control.voidaddSingleDockableFactory(String id, SingleCDockableFactory backupFactory) Adds a factory to this control.voidaddStateListener(CDockableStateListener listener) Adds a global state listener.voidaddStation(CStation<?> station) Adds an additional station to this control.voidaddStation(CStation<?> station, boolean root) Adds an additional station to this control.voidaddStationContainer(CStationContainer container) Addscontainerto this control.voidaddVetoClosingListener(CVetoClosingListener listener) Addslistenerto this control, the listener will be informed whenever a set ofCDockables is about to be closed.
CVetoClosingListeners added to theCControlare invoked before listeners that are added to aCDockable.voidaddVetoFocusListener(CVetoFocusListener listener) Adds a new veto focus listener to this control.createContentArea(String uniqueId) Creates and adds a newCContentArea.createGridArea(String uniqueId) Creates a new area where normalizedCDockables can be stored.createMinimizeArea(String uniqueId) Creates a new area where minimizedCDockables can be stored.createWorkingArea(String uniqueId) Creates and adds a newCWorkingAreato this control.voidDeletes a layout that has been stored earlier.voiddestroy()Frees as much resources as possible.CStation<?>findStation(DockStation intern) getCDockable(int index) Gets the index'th dockable that is registered in this controlintGets the element that should be in the center of the mainframe.Gets theDockControllerwhich is used by thisCControl.Gets the location whereCDockables are opened when nothing else is specified.Gets the factory which is mainly used to create new elements for this control.getFactoryId(MultipleCDockableFactory<?, ?> factory) Gets the unique identifier offactory.Gets the currently focusedCDockable.Gets an object describing whichCDockables did have the focus in which order.Gets the currently usedCGroupBehavior.getIcons()Gets the name of the current layout (the one with whichsave(String)was called).Gets the manager that is responsible to handle all changes of the modes (maximized, normalized, ...Gets the strategy that is used to create missingCStationPerspective.Gets the strategy that tells what to do if layout information of a missingCDockableis found.Searches and returns the oneMultipleCDockablewhich uses the unique identifierid.Searches for theMultipleCDockableFactorywith the identifierid.Gets the preference model which is used to translate between thepreferencesandthis.Gets the storage container forPreferenceModels for this control.<A> AgetProperty(PropertyKey<A> key) Gets the value of a property.Gets the set of dockables, stations and other elements that are used by this control.Grants access to the manager that reads and stores configurations of the common-project.
Clients can add their ownApplicationResources to this manager, however clients are strongly discouraged from removingApplicationResourcewhich they did not add themselves.Gets the root window of the application.Searches for theSingleCDockablewhich has the unique identifierid.Searches theSingleCDockableFactorywhich is responsible for creating theSingleCDockablewith identifierid.CStation<?>getStation(DockStation intern) CStation<?>getStation(String id) Searches theCStationwith unique identifierid.Gets an unmodifiable list of allCStationContainers that are registered at thisCControl.Gets an unmodifiable list of all stations that are currently registered at this control.Gets the list of installed themes.getUniqueId(MultipleCDockable dockable) Gets the unique identifier which is used internally fordockablevoidprotected voidinit(WindowProvider window, CControlFactory factory) Initializes the fields of thisCControl.protected voidinitExtensions(DockController controller) protected voidCalled during construction of thisCControl, this method creates a newCExternalizeAreaand registers it as root-station using the unique identifier "external".
Subclasses may override this method and not create aCExternalizeAreaor create a customizedCExternalizeArea.protected voidCalled during construction of thisCControl, this method addsDockFactorys to theintern representationof thisCControl.protected voidSets up all the default icons used in the realm of thisCControl.protected voidCreates newApplicationResources and registers them at theApplicationResourceManagerof thisCControl.protected voidSets up the default properties.protected voidSets up all the default text that is used in the realm of thisCControlprotected voidSets up all the default text that is used in the realm of thisCControlprotected voidinitTransferFocusOnMinimize(DockController controller) Adds aCDockableStateListenerto thisCControl, if aCDockableisminimized, anotherDockablereceives the focus.intern()Gets the representation of the layer beneath the common-layer.booleanTells whether basic modes are forcibly applied when loading a persistent layout.booleanisRootStation(CStation<?> station) booleanString[]layouts()Gets a list of all layouts that are currently known.voidLoads an earlier stored layout.voidLoads an earlier stored layout.<A> voidputProperty(PropertyKey<A> key, A value) Changes the value of a property.protected <A> voidputProperty(PropertyKey<A> key, A value, Priority priority) Changes the value of a property.voidread(DataInputStream in) Reads the current and other known layouts fromin.
This is the same as callinggetResources().readStream( in ).voidReads the current and other known layouts fromfile.
This is the same as callinggetResources().readFile( file ).voidReads the current and other known layouts fromelement.
This is the same as callinggetResources().readXML( element ).voidReads the current and other known layouts fromfile.voidremoveContentArea(CContentArea content) Deprecated.useremoveStationContainer(CStationContainer)insteadvoidremoveControlListener(CControlListener listener) Removes a listener from this control.voidremoveDestroyHook(DestroyHook hook) Removes a destroy-hook from thisCControl.voidremoveDockable(MultipleCDockable dockable) Removes a dockable from this control.booleanremoveDockable(SingleCDockable dockable) Removesdockablefrom this control.voidRemoves a listener from this control.voidremoveFocusListener(CFocusListener listener) Removes a listener from this control.voidremoveGlobalKeyListener(KeyListener listener) Removes a globalKeyListenerfrom this control.voidremoveKeyboardListener(CKeyboardListener listener) Removes a listener from this control.voidRemoves theMultipleCDockableFactorywith identifieridfrom this control.voidRemoves a global listener from this control.voidRemoves aResizeRequestListenerfrom thisCControl.booleanRemoves theSingleCDockablewith the identifierid.voidRemoves all occurrences offactory.voidRemoves a factory from this control.voidremoveStateListener(CDockableStateListener listener) Removes a global state listener.voidremoveStation(CStation<?> station) Removes aCStationfrom this control.voidremoveStationContainer(CStationContainer container) Removescontainerfrom the list of knownCStationContainers.voidRemoves a listener from this control.voidremoveVetoFocusListener(CVetoFocusListener listener) Removes a listener from this control.voidreplace(MultipleCDockable oldDockable, MultipleCDockable newDockable) ReplacesoldDockablewithnewDockable.save()Saves the current layout with the current name.save(boolean includeWorkingAreas) Saves the current layout with the current name.voidStores the current layout with the given name.voidStores the current layout with the given name.voidsetDefaultLocation(CLocation defaultLocation) Sets the location whereCDockables are opened when there is nothing else specified for theseCDockables.voidsetGroupBehavior(CGroupBehavior behavior) Sets theCGroupBehavior.voidsetIgnoreWorkingForEntry(boolean ignore) Informs thisCControlwhether location ofCDockables that are associated with aworking areashould be stored when storing a layout.
This method installs aDockSituationIgnoreon the internDockFrontend, the filter is only used for "normal entries", "final entries" (stored when the application shuts down) are not affected.
The default value for this property istrue.voidsetLanguage(Locale locale) Re-initializes the default text that is used in the realm of thisCControl.voidMakes sure that allCDockables are maximized onto the area which is registered under the given unique id.voidsetMissingPerspectiveStrategy(MissingPerspectiveStrategy missingPerspectiveStrategy) Sets a strategy that creates missingCStationPerspectives.voidsetMissingStrategy(MissingCDockableStrategy missingStrategy) Sets the strategy that tells what to do if layout information of a missingCDockableis found.voidsetPreferenceModel(PreferenceModel preferenceModel) voidsetRevertToBasicModes(boolean revert) Tells this control whether basic modes like "normalized", "minimized" or "externalized" are forced uponDockables after loading a persistent layout.voidsetRootWindow(WindowProvider window) Sets the root window of the application.voidDeprecated.replaced bysetTheme(String).voidSets the theme of the elements in the realm of this control.voidsetTransferFocusOnMinimize(boolean transferFocusOnMinimize) voidwrite(DataOutputStream out) Writes the current and all known layouts intoout.
This is the same as callinggetResources().writeStream( out ).voidWrites the current and all known layouts intofile.
This is the same as callinggetResources().writeFile( file ).voidWrites the current and all known layouts intoelement.
This is the same as callinggetResources().writeXML( element ).voidWrites the current and all known layouts intofilein xml format.
-
Field Details
-
CCONTROL
A key for thisCControl. Will be set with the highest priority. To be used wherever aDockControllerbut not aCControlis accessible. -
CCONTROL_EXTENSION
Name of anExtensionNamethat adds extensions to this control. The extensions are of typeObjectand are not actually used. Rather this extension informsExtensions that aCControlhas been created. -
EXTENSION_PARAM
name of a parameter of anExtensionNamethat points tothis- See Also:
-
KEY_MAXIMIZE_CHANGE
-
KEY_GOTO_MAXIMIZED
-
KEY_GOTO_NORMALIZED
-
KEY_GOTO_MINIMIZED
-
KEY_GOTO_EXTERNALIZED
-
KEY_CLOSE
-
KEY_CANCEL_OPERATION
KeyStrokethat can be hit during a drag and drop operation, that will cancel the operation (default is ESCAPE). -
RESIZE_LOCK_CONFLICT_RESOLVER
ConflictResolverused to determine what happens when there is a conflict between two resize requests on aSplitDockStationlikeCGridArea,CWorkingAreaorCContentArea.- See Also:
-
CLOSE_ACTION_FACTORY
This factory creates the actions that close dockables. -
GROUPING_BEHAVIOR
The grouping behavior defines howDockables tend to automatically group together. -
EXTERNALIZED_STATION_ID
the unique id of the station that handles the externalized dockables- See Also:
-
CONTENT_AREA_STATIONS_ID
the unique id of the default-CContentAreacreated by this control- See Also:
-
-
Constructor Details
-
CControl
public CControl()Creates a new control. Note that a control should know the main window of the application, thusCControl(WindowProvider)would be the better choice than this constructor. -
CControl
Creates a new control- Parameters:
frame- the main frame of the application, needed to create dialogs for externalizedCDockables
-
CControl
Deprecated.it is not necessary to set therestrictedEnvironmentparameter anymore, the framework will choose a fitting value itselfCreates a new control- Parameters:
restrictedEnvironment- whether this application runs in a restricted environment and is not allowed to listen for global events.
-
CControl
Creates a new control- Parameters:
window- a provider for the main window of this application. Needed to create dialogs for externalizedCDockables. Must not benull, but its search method may returnnull
-
CControl
Deprecated.it is not necessary to set therestrictedEnvironmentparameter anymore, the framework will choose a fitting value itselfCreates a new control- Parameters:
frame- the main frame of the application, needed to create dialogs for externalizedCDockablesrestrictedEnvironment- whether this application runs in a restricted environment and is not allowed to listen for global events.
-
CControl
Deprecated.it is not necessary to set therestrictedEnvironmentparameter anymore, the framework will choose a fitting value itselfCreates a new control- Parameters:
window- a provider for the main window of this application. Needed to create dialogs for externalizedCDockables. Must not benull, but its search method may returnnullrestrictedEnvironment- whether this application runs in a restricted environment and is not allowed to listen for global events.
-
CControl
Creates a new control- Parameters:
frame- the main frame of the application, needed to create dialogs for externalizedCDockablesfactory- a factory which is used to create new elements for this control.
-
CControl
Creates a new control- Parameters:
window- a provider for the main window of this application. Needed to create dialogs for externalizedCDockables. Must not benull, but its search method may returnnullfactory- a factory which is used to create new elements for this control.
-
CControl
Creates a new control- Parameters:
window- a provider for the main window of this application. Needed to create dialogs for externalizedCDockables. Must not benull, but its search method may returnnullfactory- a factory which is used to create new elements for this control.init- iftruethen this constructor callsinit(WindowProvider, CControlFactory), otherwise this constructor does nothing and returns immediately. Subclasses should callinit(WindowProvider, CControlFactory)in that case.
-
-
Method Details
-
init
Initializes the fields of thisCControl. This method is called during construction of thisCControl. Subclasses may useCControl(WindowProvider, CControlFactory, boolean)to create an uninitializedCControland then call this method by themselves.- Parameters:
window- a provider for the main window of this application. Needed to create dialogs for externalizedCDockables. Must not benull, but its search method may returnnullfactory- a factory which is used to create new elements for this control.
-
initExtensions
- Parameters:
controller- the controller for which additional extensions should be loaded
-
initTransferFocusOnMinimize
Adds aCDockableStateListenerto thisCControl, if aCDockableisminimized, anotherDockablereceives the focus. Subclasses may override this method to disable or modify the feature.- Parameters:
controller- the controller used by thisCControl- See Also:
-
initExternalizeArea
protected void initExternalizeArea()Called during construction of thisCControl, this method creates a newCExternalizeAreaand registers it as root-station using the unique identifier "external".
Subclasses may override this method and not create aCExternalizeAreaor create a customizedCExternalizeArea. -
initFactories
protected void initFactories()Called during construction of thisCControl, this method addsDockFactorys to theintern representationof thisCControl. -
initProperties
protected void initProperties()Sets up the default properties. While subclasses can override this method, they should call this method first. Some parts of thisCControlwill 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 realm of thisCControl. -
initTexts
protected void initTexts()Sets up all the default text that is used in the realm of thisCControl -
setLanguage
Re-initializes the default text that is used in the realm of thisCControl.- Parameters:
locale- the new language, must not benull
-
initTexts
Sets up all the default text that is used in the realm of thisCControl- Parameters:
locale- what language to use
-
initPersistentStorage
protected void initPersistentStorage()Creates newApplicationResources and registers them at theApplicationResourceManagerof thisCControl. While subclasses can override this method, they should be aware that missingApplicationResources will break persistent storage for the location and size ofDockables. -
addControlListener
Adds a listener to this control.- Parameters:
listener- the new listener
-
removeControlListener
Removes a listener from this control.- Parameters:
listener- the listener to remove
-
addFocusListener
Adds a new focus listener to this control. The listener gets informed about changes in the focus.- Parameters:
listener- the new listener
-
removeFocusListener
Removes a listener from this control.- Parameters:
listener- the listener to remove
-
getFocusedCDockable
Gets the currently focusedCDockable. This might benullif someDockablethat is not aCommonDockablehas the focus.- Returns:
- the currently focused
CDockable, can benull - See Also:
-
getFocusHistory
Gets an object describing whichCDockables did have the focus in which order.- Returns:
- the focus history
-
addVetoFocusListener
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
Removes a listener from this control.- Parameters:
listener- the listener to remove
-
addStateListener
Adds a global state listener. This has the same effect as adding a state listener to eachCDockablethat is known to this control.- Parameters:
listener- the new listener
-
removeStateListener
Removes a global state listener.- Parameters:
listener- the listener to remove
-
addPropertyListener
Adds a global property listener. This has the same effect as adding a property listener to eachCDockablethat is known to this control.- Parameters:
listener- the new listener
-
removePropertyListener
Removes a global listener from this control.- Parameters:
listener- the listener to remove
-
addKeyboardListener
Adds a global keyboard listener to this control. The listener gets informed whenever a key is touched on aComponentwhich is a child of aCDockable.
Note: listeners directly added to aCDockablewill 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
Removes a listener from this control.- Parameters:
listener- the listener to remove
-
addGlobalKeyListener
Adds a key listener to this control that will be informed about anyKeyEventthat gets processed or analyzed by this control. Especially any event that gets forwarded to aCKeyboardListenergets also forwarded tolistener.- Parameters:
listener- the new listener
-
removeGlobalKeyListener
Removes a globalKeyListenerfrom this control.- Parameters:
listener- the listener to remove
-
addDoubleClickListener
Adds a global mouse double click listener to this control. The listener gets informed whenever the mouse is clicked twice on aComponentwhich is a child of aCDockable.
Note: listeners directly added to aCDockablewill 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
Removes a listener from this control.- Parameters:
listener- the listener to remove
-
addVetoClosingListener
Addslistenerto this control, the listener will be informed whenever a set ofCDockables is about to be closed.
CVetoClosingListeners added to theCControlare invoked before listeners that are added to aCDockable.- Parameters:
listener- the new listener, notnull
-
removeVetoClosingListener
Removes a listener from this control.- Parameters:
listener- the listener to remove
-
setIgnoreWorkingForEntry
public void setIgnoreWorkingForEntry(boolean ignore) Informs thisCControlwhether location ofCDockables that are associated with aworking areashould be stored when storing a layout.
This method installs aDockSituationIgnoreon the internDockFrontend, the filter is only used for "normal entries", "final entries" (stored when the application shuts down) are not affected.
The default value for this property istrue.- Parameters:
ignore- iftruethen someCDockables are filtered out, otherwise their location is stored.
-
destroy
public void destroy()Frees as much resources as possible. ThisCControlwill no longer work correctly after this method was called. -
createWorkingArea
Creates and adds a newCWorkingAreato this control. The area is not made visible by this method.- Parameters:
uniqueId- the unique id of the area- Returns:
- the new area
-
createMinimizeArea
Creates a new area where minimizedCDockables 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
Creates a new area where normalizedCDockables 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
Creates and adds a newCContentArea.- 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 uniqueNullPointerException- if the id isnull
-
addStationContainer
Addscontainerto this control. All childrenCStations ofcontainerwill be added as root station to this control.- Parameters:
container- the additional set of stations- Throws:
IllegalArgumentException- ifcontaineris already registered or if the unique identifier ofcontaineris already knownNullPointerException- ifcontainerisnull
-
removeContentArea
Deprecated.useremoveStationContainer(CStationContainer)insteadRemovescontentfrom the list of known contentareas. This also removes the stations ofcontentfrom 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 equalscontent
-
removeStationContainer
Removescontainerfrom the list of knownCStationContainers. This also ensures that all childCStations ofcontainerare removed. Elements aboard the stations are made invisible, but not removed from thisCControl.- Parameters:
container- the set of stations to remove- Throws:
IllegalArgumentException- if container is the defaultCContentArea
-
getRegister
Gets the set of dockables, stations and other elements that are used by this control.- Returns:
- the set of elements, never
null
-
getStationContainers
Gets an unmodifiable list of allCStationContainers that are registered at thisCControl.- Returns:
- the list of containers
-
getFactory
Gets the factory which is mainly used to create new elements for this control.- Returns:
- the factory
-
getLocationManager
Gets the manager that is responsible to handle all changes of the modes (maximized, normalized, ... ) ofDockables.
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
- Parameters:
hook- the new hook
-
removeDestroyHook
Removes a destroy-hook from thisCControl.- Parameters:
hook- the hook to remove
-
getResources
Grants access to the manager that reads and stores configurations of the common-project.
Clients can add their ownApplicationResources to this manager, however clients are strongly discouraged from removingApplicationResourcewhich they did not add themselves.- Returns:
- the persistent storage
-
putProperty
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).Properties BubbleTheme.ACTION_DISTRIBUTORDefault instance of a DockActionDistributor.FlatTheme.ACTION_DISTRIBUTORDefault instance of a DockActionDistributor.DefaultDockRelocator.AUTO_DROP_ON_ANY_MOUSE_RELEASED_EVENTStop drag-and-drop operations on any mouse-released event (a workaround necessary for some Linux and Mac systems). DockTheme.BACKGROUND_PAINTThe default value of the BackgroundPaint.BasicTheme.BASIC_COLOR_SCHEMEThe ColorSchemeto use if theBasicThemeis installed.DockTheme.BORDER_MODIFIERThe default value of the BorderModifier.ScreenDockStation.BOUNDARY_RESTRICTIONHow far the user can push a window with a Dockableout of the screen(s).BubbleTheme.BUBBLE_COLOR_SCHEMEThe ColorSchemeto use if theBubbleThemeis installed.FlapDockStation.BUTTON_CONTENTTells what content should be on the buttons that represent minimized Dockables.FlapDockStation.BUTTON_CONTENT_FILTERTells which DockActions should be shown on a button representing a minimizedDockable.* CCONTROLThe CControlin whose realm the property is read, is a read-only property.DockTheme.COMBINERDefault value of the Combiner.StackDockStation.COMPONENT_FACTORYThe factory creating the "tabbed panes" of the StackDockStation.DockTheme.DISPLAYER_FACTORYDefault value of the DisplayerFactory.DockStationDropLayerFactory.DROP_LAYER_FACTORYFactory that defines which parts of the screen are targets for a drag and drop operation/ PropertyKey.DOCK_STATION_ICONThe default icon of DockStations.PropertyKey.DOCK_STATION_TITLEThe default title of DockStations.PropertyKey.DOCK_STATION_TOOLTIPThe default tooltip of DockStations.PropertyKey.DOCKABLE_ICONThe default icon of Dockables.DockTheme.DOCKABLE_MOVING_IMAGE_FACTORYDefault value of the DockableMovingImageFactory.DockTheme.DOCKABLE_SELECTIONDefault value of the DockableSelection.PropertyKey.DOCKABLE_TITLEThe default title of Dockables.PropertyKey.DOCKABLE_TOOLTIPThe default tooltip of Dockables.LocationModeManager.DOUBLE_CLICK_STRATEGYTells what happens if the user double clicks on a DockTitleor aDockable.EclipseTheme.ECLIPSE_COLOR_SCHEMEThe ColorSchemeto use if theEclipseThemeis installed.* ScreenDockStation.EXPAND_ON_DOUBLE_CLICKWhether a double click on a child of a ScreenDockStationshould maximize the child.FlatTheme.FLAT_COLOR_SCHEMEThe ColorSchemeto use if theFlatThemeis installed.ScreenDockStation.FULL_SCREEN_STRATEGYDefines when a floating Dockableis considered to be in fullscreen mode.* DockFrontend.HIDE_ACCELERATORThe KeyStrokethat will callDockFrontend.hide(Dockable)DockableSelector.INIT_SELECTIONThe KeyStrokethat opens a window where the user can select a newDockable.StackDockStation.IMMUTABLE_SELECTION_INDEXPrevents the StackDockStationfrom switching the selected index on a drop operation (but does not prevent theFocusManagerfrom switching the focus!).KEY_CLOSEThe KeyStrokethat closes aCDockable.KEY_GOTO_EXTERNALIZEDThe KeyStrokethat externalizes aCDockable.KEY_GOTO_MAXIMIZEDThe KeyStrokethat maximizes aCDockable.KEY_GOTO_MINIMIZEDThe KeyStrokethat minimizes aCDockable.KEY_GOTO_NORMALIZEDThe KeyStrokethat normalizes aCDockable.KEY_MAXIMIZE_CHANGEThe KeyStrokethat either maximizes or normalizes aCDockable.KEY_CANCEL_OPERATIONThe KeyStrokethat will cancel the current drag and drop operation.FlapDockStation.LAYOUT_MANAGERTells the FlapDockStationthe size and the hold property of its children.SplitDockStation.LAYOUT_MANAGERLogic of all SplitDockStations, used when dropping aDockableor resizing the station.TabPane.LAYOUT_MANAGERDefines the size and location of tabs of a stack. TabPane.USE_SMALL_MINIMUM_SIZEUse really small minimum sizes for calculating the minimum size of a tab-pane, instead of trying to make the content look good * SplitDockStation.MAXIMIZE_ACCELERATORThe KeyStrokethat maximizes a child of aSplitDockStation.CombinedMenuContent.MENU_CONTENTThe menu that shows overflowing Dockables on a stack.IconManager.MINIMUM_ICON_SIZEThe expected minimal size of all icons. FlapDockStation.MINIMUM_SIZEThe minimum size of the Componentthat represents theFlapDockStation.* LocationModeManager.MODE_ENABLEMENTTells which CDockableis allowed to have whichExtendedMode.DockRelocatorMode.NO_COMBINATION_MASKWhat keys the user has to press during a drag and drop operation to prevent the framework from combining Dockables.DockTitle.ORIENTATION_STRATEGYTells how to rotate text on a DockTitle.EclipseTheme.PAINT_ICONS_WHEN_DESELECTEDWhether to paint icons on unselected tabs if using the EclipseTheme.PlaceholderStrategy.PLACEHOLDER_STRATEGYA strategy that creates placeholders for Dockables, seeCPlaceholderStrategy.RESIZE_LOCK_CONFLICT_RESOLVERTells what happens if two CDockables have a locked size and the user is resizing the parent of these two elements.DockController.RESTRICTED_ENVIRONMENTTells whether the application runs as applet/with webstart or as free or authenticated application. DockRelocatorMode.SCREEN_MASKThe keys the user has to press during a drag and drop operation to ensure that the Dockableis added to aScreenDockStation.SingleTabDecider.SINGLE_TAB_DECIDERTells which Dockables should be presented with a single tab - even if there is no reason to show a tab.DockTheme.STATION_PAINTThe default value of StationPaint.AWTComponentCaptureStrategy.STRATEGYHow to make an image of an AWT component. DisablingStrategy.STRATEGYWhich element to disable. StackDockStation.TAB_CONTENT_FILTERA filter deciding what content to show on a tab of a StackDockStation.EclipseTheme.TAB_PAINTERThe look of tabs if using the EclipseTheme.StackDockStation.TAB_PLACEMENTThe location of the tabs on a StackDockStation.EclipseTheme.THEME_CONNECTORDetailed instructions how to present a Dockableif using theEclipseTheme.FlapDockStation.WINDOW_FACTORYA factory creating FlapWindows for theFlapDockStation.ScreenDockStation.WINDOW_FACTORYA factory creating ScreenDockWindows for theScreenDockStation.- Type Parameters:
A- the type of the value- Parameters:
key- the name of the propertyvalue- the new value, can benull
-
putProperty
Changes the value of a property.- Type Parameters:
A- the type of the value- Parameters:
key- the name of the propertyvalue- the new value, can benullpriority- the priority of the new value- See Also:
-
getProperty
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
Gets the element that should be in the center of the mainframe. TheCContentAreais created the first time this method is called.- Returns:
- the center of the mainframe of the application
-
addStation
Adds an additional station to this control.- Parameters:
station- the new station
-
addStation
Adds an additional station to this control. MostCStations should be root-stations, even if they are nested.- Parameters:
station- the new stationroot-trueif the station should be a root station. A root station may or may not have any parent station. The location of aCDockableis always relative to the first root station that can be found when travelling the tree upwards. For most stations this attribute should betrue
-
isRootStation
- Parameters:
station- the station whose root flag is asked- Returns:
- the value of the root flag or
falseifstationis not registered at all
-
removeStation
Removes aCStationfrom this control. It is unspecified what happens with the children onstation- Parameters:
station- the station to remove
-
getStations
Gets an unmodifiable list of all stations that are currently registered at this control.- Returns:
- the list of stations
-
getStation
- Parameters:
intern- the internal representation- Returns:
- the station or
null
-
findStation
Searches along the path to the rootDockStationthe firstCStationthat matches theDockStation. Ifinternis aCStation, then this method behaves as ifgetStation(DockStation)was called. If the parent ofinternis aCStation, then this method behaves as ifgetStation( intern.getDockParent() )was called. -
getStation
Searches theCStationwith unique identifierid.- Parameters:
id- the identifier- Returns:
- the station or
null
-
addDockable
Adds a dockable to this control. The dockable can be made visible afterwards. This method will do nothing ifdockablewas already registered at thisCControl.- Type Parameters:
S- the type of the new element- Parameters:
dockable- the new element to show- Returns:
dockable- Throws:
IllegalArgumentException- ifdockablealready is registered at anotherCControlor if the unique id ofdockablealready is used for another object
-
getSingleDockable
Searches for theSingleCDockablewhich has the unique identifierid.- Parameters:
id- the identifier to look out for- Returns:
- the element with that identifier or
null
-
removeSingleDockable
Removes theSingleCDockablewith the identifierid.- Parameters:
id- the id of the element to remove- Returns:
trueif the element was removed,falseotherwise
-
removeDockable
Removesdockablefrom this control. The location information fordockableremains stored if either there is aSingleCDockableFactoryregistered or theMissingCDockableStrategytells to store the values.- Parameters:
dockable- the element to remove- Returns:
- true if the element was removed,
falseotherwise
-
addSingleDockableFactory
Adds a factory to this control. The factory will be used to create and add aSingleCDockablewhen one is requested that is not yet in the cache.
If there is already information foridavailable andidshould 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, seeaddSingleDockableFactory(Filter, SingleCDockableFactory).- Parameters:
id- the id of the dockable that might be requestedbackupFactory- the new factory
-
addSingleDockableFactory
Adds a factory to this control. The factory will be used to create and add aSingleCDockablewhen one is requested that is not yet in the cache.
If there is already information for identifiers that are included byidsavailable and if they should be visible, then thefactorywill be used instantaneously to create these elements. During this actionfactoryhas 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 byfactoryfactory- the new factory
-
getSingleDockableFactory
Searches theSingleCDockableFactorywhich is responsible for creating theSingleCDockablewith identifierid. 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
Removes all occurrences offactory. Any location information that was held because of the existence offactorywill be removed as well.- Parameters:
factory- the factory to remove
-
removeSingleDockableFactory
Removes a factory from this control. Location information foridwill be deleted if neither aSingleCDockableis added nor theMissingCDockableStrategytells to store the information.- Parameters:
id- the name of the factory- See Also:
-
addDockable
Adds a dockable to this control. The dockable can be made visible afterwards. A random identifier is assigned todockable, clients can also useaddDockable(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- Throws:
IllegalArgumentException- if either thefactoryofdockableisnull, or is not registered (seeaddMultipleDockableFactory(String, MultipleCDockableFactory)).
-
addDockable
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 useaddDockable(MultipleCDockable)if they want to assign a random identifier todockable.- Type Parameters:
M- the type of the new element- Parameters:
uniqueId- id the unique id of the new elementdockable- the new element to show- Returns:
dockable- Throws:
IllegalArgumentException- if the unique identifier is already in use, ifdockableis already used elsewhere, if there is no factory fordockableNullPointerException- if any argument isnull
-
replace
ReplacesoldDockablewithnewDockable. The new dockable inherits settings and location of the old one.- Parameters:
oldDockable- the old dockable, notnullnewDockable- the new dockable, notnull
-
getMultipleDockable
Searches and returns the oneMultipleCDockablewhich uses the unique identifierid.- Parameters:
id- the identifier to look out for- Returns:
- the element using
idornullif nothing was found
-
getUniqueId
Gets the unique identifier which is used internally fordockable- Parameters:
dockable- the item to search- Returns:
- the internal unique identifier of
dockable, may benull
-
removeDockable
Removes a dockable from this control. The dockable is made invisible.- Parameters:
dockable- the element to remove
-
getCDockableCount
public int getCDockableCount()- Returns:
- the number of dockables
-
getCDockable
Gets the index'th dockable that is registered in this control- Parameters:
index- the index of the element- Returns:
- the selected dockable
-
addMultipleDockableFactory
Adds a factory to this control. The factory will createMultipleCDockables when a layout is loaded. TheNullMultipleCDockableFactorywill always be preinstalled using the empty identifier.- Parameters:
id- the unique id of the factory, must consist of at least one characterfactory- the new factory
-
getMultipleDockableFactory
Searches for theMultipleCDockableFactorywith the identifierid.- Parameters:
id- the identifier to search for- Returns:
- the factory or
null
-
getFactoryId
Gets the unique identifier offactory.- Parameters:
factory- the factory to search- Returns:
- the unique identifier or
null
-
removeMultipleDockableFactory
Removes theMultipleCDockableFactorywith identifieridfrom this control. As a side effect allMultipleCDockables which use that factory are removed as well. Nothing happens if there is no factory registered withid.- Parameters:
id- the identifier of the factory to remove
-
setDefaultLocation
Sets the location whereCDockables are opened when there is nothing else specified for theseCDockables.- Parameters:
defaultLocation- the location, can benull
-
getDefaultLocation
Gets the location whereCDockables are opened when nothing else is specified.- Returns:
- the location, might be
null - See Also:
-
setMaximizeArea
Makes sure that allCDockables are maximized onto the area which is registered under the given unique id.- Parameters:
id- the unique id of the area- See Also:
-
setGroupBehavior
Sets theCGroupBehavior. The behavior decides what happens when the user wants to change theExtendedModeof aCDockable.
To be exact: the group behavior is applied for a call toCDockable.setExtendedMode(ExtendedMode)respective a call toLocationModeManager.setMode(Dockable, ExtendedMode). The buttons that are visible to the user all link to these methods.- Parameters:
behavior- the new behavior, notnull
-
getGroupBehavior
Gets the currently usedCGroupBehavior.- Returns:
- the current behavior, not
null - See Also:
-
setTheme
Deprecated.replaced bysetTheme(String). While this method still works, the theme will not get stored persistent and any module using theThemeMap(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
Sets the theme of the elements in the realm of this control. The Stringthemeis used as key forThemeMap.select(String).- Parameters:
theme- the name of the theme, this might be one ofThemeMap.KEY_BASIC_THEME,ThemeMap.KEY_BUBBLE_THEME,ThemeMap.KEY_ECLIPSE_THEME,ThemeMap.KEY_FLAT_THEMEorThemeMap.KEY_SMOOTH_THEME. This can also be a any other string which was used forThemeMap.put(String, ThemeFactory),ThemeMap.add(String, ThemeFactory)orThemeMap.insert(int, String, ThemeFactory).
-
getThemes
Gets the list of installed themes.- Returns:
- the list of themes
-
setMissingPerspectiveStrategy
Sets a strategy that creates missingCStationPerspectives.- Parameters:
missingPerspectiveStrategy- the strategy, notnull
-
getMissingPerspectiveStrategy
Gets the strategy that is used to create missingCStationPerspective.- Returns:
- the strategy, not
null
-
getPerspectives
Grants access to the perspective API which allows clients to build complex layouts without the need to create anydockablesorstations.- Returns:
- access a wrapper around this
CControlallowing to inspect and modify the layouts that are available - See Also:
-
setRootWindow
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 benull
-
getRootWindow
Gets the root window of the application. Note that this method might not return the same object as given tosetRootWindow(WindowProvider), however the provide returned by this method will return the same window as specified bysetRootWindow(WindowProvider).- Returns:
- the provider, never
null
-
getPreferences
Gets the storage container forPreferenceModels for this control. The contents of this container are stored in theresource manager.- Returns:
- the storage for preferences
- See Also:
-
setPreferenceModel
Sets thePreferenceModelwhich will be used to translate betweenthisand thepreferences. This model can be set tonull.
The default value of this property isnull.- Parameters:
preferenceModel- the new model, it will used to translate the contents ofgetPreferences()immediately, can benull
-
getPreferenceModel
Gets the preference model which is used to translate between thepreferencesandthis.- Returns:
- the model, can be
null - See Also:
-
setMissingStrategy
Sets the strategy that tells what to do if layout information of a missingCDockableis found.- Parameters:
missingStrategy- the strategy,nullwill set the default strategy
-
getMissingStrategy
Gets the strategy that tells what to do if layout information of a missingCDockableis found.- Returns:
- the strategy, never
null
-
addResizeRequestListener
Adds aResizeRequestListenerto thisCControl. The listener will be informed when the resize requests of aCDockableshould be processed.- Parameters:
listener- the new listener, notnull
-
removeResizeRequestListener
Removes aResizeRequestListenerfrom thisCControl.- Parameters:
listener- the listener to remove
-
handleResizeRequests
public void handleResizeRequests()Informs allResizeRequestListeners, that theresize requestof allCDockables 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()andCDockable.isResizeLockedVertically(). The behavior of that case is not specified, but clients can assume that the locked components introduce additional resize requests. -
intern
Gets the representation of the layer beneath the common-layer.- Returns:
- the entry point to DockingFrames
-
getController
Gets theDockControllerwhich is used by thisCControl.- Returns:
- the core system of the framework
-
getIcons
Grants access to all theIcons that are used within the realm of thisCControl. 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 uponDockables after loading a persistent layout. Basically if this property is set, then allDockables are un-maximized after a layout change. The default value of this property istrue.
The reasons behind forcing basic modes are:- If the user changes the layout, he/she most likely would like to see the effects. A maximized
Dockablewould hide the effects. - For the user re-maximizing an element requires no more than one click with the mouse. It's a cheap operation.
- It is an additional layer of security preventing
Dockables from being in the wrong position if the client was stared with new settings.
- Parameters:
revert- whether non-basic modes should be forbidden when loading a persistent layout
- If the user changes the layout, he/she most likely would like to see the effects. A maximized
-
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:
-
setTransferFocusOnMinimize
public void setTransferFocusOnMinimize(boolean transferFocusOnMinimize) If aCDockableis minimized, the focus can be automatically transferred to anotherCDockable. This feature is implemented by the methodinitTransferFocusOnMinimize(DockController), which may be overridden by subclasses.- Parameters:
transferFocusOnMinimize- whether to enable the feature or not (default istrue)
-
isTransferFocusOnMinimize
public boolean isTransferFocusOnMinimize()- Returns:
- whether the focus will be transferred
- See Also:
-
write
Writes the current and all known layouts intofile.
This is the same as callinggetResources().writeFile( file ).- Parameters:
file- the file to override- Throws:
IOException- if the file can't be written
-
write
Writes the current and all known layouts intoout.
This is the same as callinggetResources().writeStream( out ).- Parameters:
out- the stream to write into- Throws:
IOException- if the stream is not writable
-
writeXML
Writes the current and all known layouts intoelement.
This is the same as callinggetResources().writeXML( element ).- Parameters:
element- the element to write into
-
writeXML
Writes the current and all known layouts intofilein xml format.- Parameters:
file- the file to write into- Throws:
IOException- if the file is not writable
-
read
Reads the current and other known layouts fromfile.
This is the same as callinggetResources().readFile( file ).- Parameters:
file- the file to read from- Throws:
IOException- if the file can't be read
-
read
Reads the current and other known layouts fromin.
This is the same as callinggetResources().readStream( in ).- Parameters:
in- the stream to read from- Throws:
IOException- if the stream can't be read
-
readXML
Reads the current and other known layouts fromelement.
This is the same as callinggetResources().readXML( element ).- Parameters:
element- the element to read- Throws:
XException- if the xml file has the wrong structure
-
readXML
Reads the current and other known layouts fromfile.- Parameters:
file- the file to open and to read- Throws:
IOException- if the file cannot be readXException- if the xml file has the wrong structure
-
save
Saves the current layout with the current name. Does nothing if there is no name for the current layout.- Returns:
- the name that was used to save the layout
- See Also:
-
save
Saves the current layout with the current name. Does nothing if there is no name for the current layout.- Parameters:
includeWorkingAreas- whether the content of theCStations that are marked asworking areashould be stored as well.- Returns:
- the name that was used to save the layout
- See Also:
-
save
Stores the current layout with the given name. This creates "entry" (partial) layout information.- Parameters:
name- the name of the current layout.
-
save
Stores the current layout with the given name. This creates "entry" (partial) layout information.- Parameters:
name- the name of the current layout.includeWorkingAreas- whether the content of theCStations that are marked asworking areashould be stored as well.
-
load
Loads an earlier stored layout.- Parameters:
name- the name of the layout.
-
load
Loads an earlier stored layout.- Parameters:
name- the name of the layout.includeWorkingAreas- whether the content of theCStations that are marked asworking areashould be updated as well. This value should be the same as was used to callsave(String, boolean).
-
delete
Deletes a layout that has been stored earlier.- Parameters:
name- the name of the layout to delete
-
layouts
Gets a list of all layouts that are currently known.- Returns:
- the list of layouts
-
getLayout
Gets the name of the current layout (the one with whichsave(String)was called). The current layout may not have a name if it was never saved. The result of this method will be aStringthat is part oflayouts().- Returns:
- the name of the current layout, or
null
-
restrictedEnvironmentparameter anymore, the framework will choose a fitting value itself