|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bibliothek.gui.dock.common.CControl
public class CControl
Manages the interaction between SingleCDockable
, MultipleCDockable
and CStation
s.
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:
CDockable
s, CStation
s and CStationContainer
s.CDockable
s.theme
.
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 PropertyKey<CloseActionFactory> |
CLOSE_ACTION_FACTORY
This factory creates the actions that close dockables. |
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<CGroupingBehavior> |
GROUPING_BEHAVIOR
The grouping behavior defines how Dockable s tend to automatically group together. |
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. |
|
|
addDockable(M dockable)
Adds a dockable to this control. |
|
|
addDockable(S dockable)
Adds a dockable to this control. |
|
|
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
CDockable s is about to be closed.CVetoClosingListener s 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 CDockable s can be stored. |
|
CMinimizeArea |
createMinimizeArea(String uniqueId)
Creates a new area where minimized CDockable s 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. |
|
CStation<?> |
findStation(DockStation intern)
Searches along the path to the root DockStation the first CStation that matches
the DockStation . |
|
CDockable |
getCDockable(int index)
Gets the index'th dockable that is registered in this control |
|
int |
getCDockableCount()
Gets the number of CDockable s that are registered in this
CControl . |
|
CContentArea |
getContentArea()
Gets the element that should be in the center of the mainframe. |
|
DockController |
getController()
Gets the DockController which is used by this CControl . |
|
CLocation |
getDefaultLocation()
Gets the location where CDockable s are opened when nothing else
is specified. |
|
CControlFactory |
getFactory()
Gets the factory which is mainly used to create new elements for this control. |
|
String |
getFactoryId(MultipleCDockableFactory<?,?> factory)
Gets the unique identifier of factory . |
|
CDockable |
getFocusedCDockable()
Gets the currently focused CDockable . |
|
CFocusHistory |
getFocusHistory()
Gets an object describing which CDockable s did have the focus in
which order. |
|
CGroupBehavior |
getGroupBehavior()
Gets the currently used CGroupBehavior . |
|
IconManager |
getIcons()
Grants access to all the Icon s that are used within the realm of this
CControl . |
|
String |
getLayout()
Gets the name of the current layout (the one with which save(String) was called). |
|
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 PreferenceModel s for this control. |
|
|
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 ApplicationResource s 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 CStationContainer s 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. |
|
String |
getUniqueId(MultipleCDockable dockable)
Gets the unique identifier which is used internally for dockable |
|
void |
handleResizeRequests()
Informs all ResizeRequestListener s, that the
resize request of all
CDockable s should be processed. |
|
protected void |
init(WindowProvider window,
CControlFactory factory)
Initializes the fields of this CControl . |
|
protected void |
initExtensions(DockController controller)
Initializes additional Extension s 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 DockFactory s
to the intern representation of this CControl . |
|
protected void |
initIcons()
Sets up all the default icons used in the realm of this CControl . |
|
protected void |
initPersistentStorage()
Creates new ApplicationResource s 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. |
|
void |
load(String name,
boolean includeWorkingAreas)
Loads an earlier stored layout. |
|
|
putProperty(PropertyKey<A> key,
A value)
Changes the value of a property. |
|
protected
|
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 |
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 CStationContainer s. |
|
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 . |
|
String |
save()
Saves the current layout with the current name. |
|
String |
save(boolean includeWorkingAreas)
Saves the current layout with the current name. |
|
void |
save(String name)
Stores the current layout with the given name. |
|
void |
save(String name,
boolean includeWorkingAreas)
Stores the current layout with the given name. |
|
void |
setDefaultLocation(CLocation defaultLocation)
Sets the location where CDockable s are opened when there is
nothing else specified for these CDockable s. |
|
void |
setGroupBehavior(CGroupBehavior behavior)
Sets the CGroupBehavior . |
|
void |
setIgnoreWorkingForEntry(boolean ignore)
Informs this CControl whether location of CDockable s 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" (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 CDockable s are maximized onto the area
which is registered under the given unique id. |
|
void |
setMissingPerspectiveStrategy(MissingPerspectiveStrategy missingPerspectiveStrategy)
Sets a strategy that creates missing CStationPerspective s. |
|
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 Dockable s 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 |
---|
public static final PropertyKey<CControl> CCONTROL
CControl
. Will be set with the highest priority. To be used
wherever a DockController
but not a CControl
is accessible.
public static final Path CCONTROL_EXTENSION
ExtensionName
that adds extensions to this control. The extensions
are of type Object
and are not actually used. Rather this extension informs
Extension
s that a CControl
has been created.
public static final String EXTENSION_PARAM
ExtensionName
that points to this
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.
public static final PropertyKey<KeyStroke> KEY_GOTO_MAXIMIZED
KeyStroke
used to change a CDockable
into
maximized-state.
public static final PropertyKey<KeyStroke> KEY_GOTO_NORMALIZED
KeyStroke
used to change a CDockable
into
normalized-state.
public static final PropertyKey<KeyStroke> KEY_GOTO_MINIMIZED
KeyStroke
used to change a CDockable
into
minimized-state.
public static final PropertyKey<KeyStroke> KEY_GOTO_EXTERNALIZED
KeyStroke
used to change a CDockable
into
externalized-state.
public static final PropertyKey<KeyStroke> KEY_CLOSE
KeyStroke
used to close a CDockable
.
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
.
DefaultConflictResolver
,
FullLockConflictResolver
public static final PropertyKey<CloseActionFactory> CLOSE_ACTION_FACTORY
public static final PropertyKey<CGroupingBehavior> GROUPING_BEHAVIOR
Dockable
s tend to automatically group together.
public static final String EXTERNALIZED_STATION_ID
public static final String CONTENT_AREA_STATIONS_ID
CContentArea
created by this control
Constructor Detail |
---|
public CControl()
CControl(WindowProvider)
would be the better choice than this constructor.
public CControl(JFrame frame)
frame
- the main frame of the application, needed to create
dialogs for externalized CDockable
s@Deprecated public CControl(boolean restrictedEnvironment)
restrictedEnvironment
parameter anymore, the framework
will choose a fitting value itself
restrictedEnvironment
- whether this application runs in a
restricted environment and is not allowed to listen for global events.public CControl(WindowProvider window)
window
- a provider for the main window of this application. Needed
to create dialogs for externalized CDockable
s. Must not be null
, but
its search method may return null
@Deprecated public CControl(JFrame frame, boolean restrictedEnvironment)
restrictedEnvironment
parameter anymore, the framework
will choose a fitting value itself
frame
- the main frame of the application, needed to create
dialogs for externalized CDockable
srestrictedEnvironment
- whether this application runs in a
restricted environment and is not allowed to listen for global events.@Deprecated public CControl(WindowProvider window, boolean restrictedEnvironment)
restrictedEnvironment
parameter anymore, the framework
will choose a fitting value itself
window
- a provider for the main window of this application. Needed
to create dialogs for externalized CDockable
s. 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.public CControl(JFrame frame, CControlFactory factory)
frame
- the main frame of the application, needed to create
dialogs for externalized CDockable
sfactory
- a factory which is used to create new elements for this
control.public CControl(WindowProvider window, CControlFactory factory)
window
- a provider for the main window of this application. Needed
to create dialogs for externalized CDockable
s. Must not be null
, but
its search method may return null
factory
- a factory which is used to create new elements for this
control.protected CControl(WindowProvider window, CControlFactory factory, boolean init)
window
- a provider for the main window of this application. Needed
to create dialogs for externalized CDockable
s. 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 |
---|
protected void init(WindowProvider window, CControlFactory factory)
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.
window
- a provider for the main window of this application. Needed
to create dialogs for externalized CDockable
s. Must not be null
, but
its search method may return null
factory
- a factory which is used to create new elements for this
control.protected void initExtensions(DockController controller)
Extension
s and registers them at the
ExtensionManager
of controller
.
controller
- the controller for which additional extensions should be
loadedprotected void initTransferFocusOnMinimize(DockController controller)
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.
controller
- the controller used by this CControl
setTransferFocusOnMinimize(boolean)
protected void initExternalizeArea()
CControl
, this method creates a new
CExternalizeArea
and registers it as root-station using the unique identifier
"external".CExternalizeArea
or create
a customized CExternalizeArea
.
protected void initFactories()
CControl
, this method adds DockFactory
s
to the intern representation
of this CControl
.
protected void initProperties()
CControl
will not work correctly if the wrong
properties are set or if no properties are set at all.
protected void initIcons()
CControl
.
protected void initTexts()
CControl
public void setLanguage(Locale locale)
CControl
.
locale
- the new language, must not be null
protected void initTexts(Locale locale)
CControl
locale
- what language to useprotected void initPersistentStorage()
ApplicationResource
s and registers them at the
ApplicationResourceManager
of this CControl
. While subclasses
can override this method, they should be aware that missing ApplicationResource
s will
break persistent storage for the location and size of Dockable
s.
public void addControlListener(CControlListener listener)
listener
- the new listenerpublic void removeControlListener(CControlListener listener)
listener
- the listener to removepublic void addFocusListener(CFocusListener listener)
listener
- the new listenerpublic void removeFocusListener(CFocusListener listener)
listener
- the listener to removepublic CDockable getFocusedCDockable()
CDockable
. This might be null
if some
Dockable
that is not a CommonDockable
has the focus.
CDockable
, can be null
addFocusListener(CFocusListener)
,
DockController.getFocusedDockable()
public CFocusHistory getFocusHistory()
CDockable
s did have the focus in
which order.
public void addVetoFocusListener(CVetoFocusListener listener)
listener
- the new listenerpublic void removeVetoFocusListener(CVetoFocusListener listener)
listener
- the listener to removepublic void addStateListener(CDockableStateListener listener)
CDockable
that is known to this
control.
listener
- the new listenerpublic void removeStateListener(CDockableStateListener listener)
listener
- the listener to removepublic void addPropertyListener(CDockablePropertyListener listener)
CDockable
that is known to this
control.
listener
- the new listenerpublic void removePropertyListener(CDockablePropertyListener listener)
listener
- the listener to removepublic void addKeyboardListener(CKeyboardListener listener)
Component
which is a child
of a CDockable
.CDockable
will always
be informed first.
listener
- the new listenerpublic void removeKeyboardListener(CKeyboardListener listener)
listener
- the listener to removepublic void addGlobalKeyListener(KeyListener listener)
KeyEvent
that gets processed or analyzed by this control. Especially
any event that gets forwarded to a CKeyboardListener
gets also
forwarded to listener
.
listener
- the new listenerpublic void removeGlobalKeyListener(KeyListener listener)
KeyListener
from this control.
listener
- the listener to removepublic void addDoubleClickListener(CDoubleClickListener listener)
Component
which
is a child of a CDockable
.CDockable
will always
be informed first.
listener
- the new listenerpublic void removeDoubleClickListener(CDoubleClickListener listener)
listener
- the listener to removepublic void addVetoClosingListener(CVetoClosingListener listener)
listener
to this control, the listener will be informed whenever a set of
CDockable
s is about to be closed.CVetoClosingListener
s added to the CControl
are invoked before listeners that
are added to a CDockable
.
listener
- the new listener, not null
public void removeVetoClosingListener(CVetoClosingListener listener)
listener
- the listener to removepublic void setIgnoreWorkingForEntry(boolean ignore)
CControl
whether location of CDockable
s that are associated with a
working area
should be stored when storing a layout.DockSituationIgnore
on the intern DockFrontend
, the filter is only
used for "normal entries", "final entries" (stored when the application shuts down) are not affected.true
.
ignore
- if true
then some CDockable
s are filtered out, otherwise their location
is stored.public void destroy()
CControl
will no longer
work correctly after this method was called.
public CWorkingArea createWorkingArea(String uniqueId)
CWorkingArea
to this control. The area
is not made visible by this method.
uniqueId
- the unique id of the area
public CMinimizeArea createMinimizeArea(String uniqueId)
CDockable
s can be stored. This
method adds the new area directly as a root station to this control.
uniqueId
- a unique identifier
public CGridArea createGridArea(String uniqueId)
CDockable
s can be stored.
This method adds the new area directly as a root station to this control
uniqueId
- a unique identifier
public CContentArea createContentArea(String uniqueId)
CContentArea
.
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.
IllegalArgumentException
- if the id is not unique
NullPointerException
- if the id is null
public void addStationContainer(CStationContainer container)
container
to this control. All children CStation
s of container
will
be added as root station to this control.
container
- the additional set of stations
IllegalArgumentException
- if container
is already registered or if the unique identifier
of container
is already known
NullPointerException
- if container
is null
@Deprecated public void removeContentArea(CContentArea content)
removeStationContainer(CStationContainer)
instead
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.
content
- the contentarea to remove
IllegalArgumentException
- if the default-contentarea equals content
public void removeStationContainer(CStationContainer container)
container
from the list of known CStationContainer
s. This also
ensures that all child CStation
s of container
are removed. Elements aboard the
stations are made invisible, but not removed from this CControl
.
container
- the set of stations to remove
IllegalArgumentException
- if container is the default CContentArea
public CControlRegister getRegister()
null
public List<CStationContainer> getStationContainers()
CStationContainer
s that are registered at this CControl
.
public CControlFactory getFactory()
public CLocationModeManager getLocationManager()
Dockable
s.
public void addDestroyHook(DestroyHook hook)
CControl
is
destroyed through destroy()
.
hook
- the new hookpublic void removeDestroyHook(DestroyHook hook)
CControl
.
hook
- the hook to removepublic ApplicationResourceManager getResources()
ApplicationResource
s to this manager,
however clients are strongly discouraged from removing ApplicationResource
which they did not add by themself.
public <A> void putProperty(PropertyKey<A> key, A value)
BubbleTheme.ACTION_DISTRIBUTOR | Default instance of a DockActionDistributor . |
FlatTheme.ACTION_DISTRIBUTOR | Default instance of a DockActionDistributor . |
DefaultDockRelocator.AUTO_DROP_ON_ANY_MOUSE_RELEASED_EVENT | Stop drag-and-drop operations on any mouse-released event (a workaround necessary for some Linux and Mac systems). |
DockTheme.BACKGROUND_PAINT | The default value of the BackgroundPaint . |
BasicTheme.BASIC_COLOR_SCHEME | The ColorScheme to use if the BasicTheme is installed. |
DockTheme.BORDER_MODIFIER | The default value of the BorderModifier . |
ScreenDockStation.BOUNDARY_RESTRICTION | How 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 Dockable s. |
FlapDockStation.BUTTON_CONTENT_FILTER | Tells which DockAction s 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 DockStation s. |
PropertyKey.DOCK_STATION_TITLE | The default title of DockStation s. |
PropertyKey.DOCK_STATION_TOOLTIP | The default tooltip of DockStation s. |
PropertyKey.DOCKABLE_ICON | The default icon of Dockable s. |
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 Dockable s. |
PropertyKey.DOCKABLE_TOOLTIP | The default tooltip of Dockable s. |
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 SplitDockStation s, used when dropping a Dockable or resizing the station. |
TabPane.LAYOUT_MANAGER | Defines the size and location of tabs of a stack. |
TabPane.USE_SMALL_MINIMUM_SIZE | Use really small minimum sizes for calculating the minimum size of a tab-pane, instead of trying to make the content look good |
* SplitDockStation.MAXIMIZE_ACCELERATOR | The KeyStroke that maximizes a child of a SplitDockStation . |
CombinedMenuContent.MENU_CONTENT | The menu that shows overflowing Dockable s on a stack. |
IconManager.MINIMUM_ICON_SIZE | The 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 Dockable s. |
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 Dockable s, see CPlaceholderStrategy . |
RESIZE_LOCK_CONFLICT_RESOLVER | Tells what happens if two CDockable s 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 Dockable s 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.STRATEGY | Which 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 FlapWindow s for the FlapDockStation . |
ScreenDockStation.WINDOW_FACTORY | A factory creating ScreenDockWindow s for the ScreenDockStation . |
A
- the type of the valuekey
- the name of the propertyvalue
- the new value, can be null
protected <A> void putProperty(PropertyKey<A> key, A value, Priority priority)
A
- the type of the valuekey
- the name of the propertypriority
- the priority of the new valuevalue
- the new value, can be null
putProperty(PropertyKey, Object)
public <A> A getProperty(PropertyKey<A> key)
A
- the type of the propertykey
- the name of the property
null
public CContentArea getContentArea()
CContentArea
is created the first time this method is called.
public void addStation(CStation<?> station)
station
- the new stationpublic void addStation(CStation<?> station, boolean root)
CStation
s should
be root-stations, even if they are nested.
station
- the new stationroot
- 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
public boolean isRootStation(CStation<?> station)
station
was added
to this CControl
with the root
flag set to true
.
station
- the station whose root flag is asked
false
if station
is not registered at allpublic void removeStation(CStation<?> station)
CStation
from this control. It is unspecified what
happens with the children on station
station
- the station to removepublic List<CStation<?>> getStations()
public CStation<?> getStation(DockStation intern)
CStation
whose internal representation
is intern
.
intern
- the internal representation
null
public CStation<?> findStation(DockStation intern)
DockStation
the first CStation
that matches
the DockStation
. If intern
is a CStation
, then this method behaves
as if getStation(DockStation)
was called. If the parent of intern
is a CStation
,
then this method behaves as if getStation( intern.getDockParent() )
was called.
intern
- the starting point for the search of a CStation
CStation
on the path from intern
(incl.) to the root station (incl.)public CStation<?> getStation(String id)
CStation
with unique identifier id
.
id
- the identifier
null
public <S extends SingleCDockable> S addDockable(S dockable)
dockable
was already registered at this CControl
.
S
- the type of the new elementdockable
- the new element to show
dockable
IllegalArgumentException
- if dockable
already is registered at another CControl
or if the unique id of dockable
already is used for another objectpublic SingleCDockable getSingleDockable(String id)
SingleCDockable
which has the unique identifier
id
.
id
- the identifier to look out for
null
public boolean removeSingleDockable(String id)
SingleCDockable
with the identifier id
.
This has the same effect as calling #remove(SingleCDockable)
.
id
- the id of the element to remove
true
if the element was removed, false
otherwisepublic boolean removeDockable(SingleCDockable dockable)
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.
dockable
- the element to remove
false
otherwisepublic void addSingleDockableFactory(String id, SingleCDockableFactory backupFactory)
SingleCDockable
when one is requested that
is not yet in the cache.id
available and
id
should be visible, then the factory will be used
instantaneously.addSingleDockableFactory(Filter, SingleCDockableFactory)
.
id
- the id of the dockable that might be requestedbackupFactory
- the new factorypublic void addSingleDockableFactory(Filter<String> ids, SingleCDockableFactory factory)
SingleCDockable
when one is requested that
is not yet in the cache.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.
ids
- a filter telling which dockables can be handled by factory
factory
- the new factorypublic SingleCDockableFactory getSingleDockableFactory(String id)
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)
).
id
- the identifier of some factory
null
public void removeSingleDockableFactory(SingleCDockableFactory factory)
factory
. Any location information that was held
because of the existence of factory
will be removed as well.
factory
- the factory to removepublic void removeSingleDockableFactory(String id)
id
will be deleted if neither a SingleCDockable
is added nor the MissingCDockableStrategy
tells to store the information.
id
- the name of the factoryaddSingleDockableFactory(String, SingleCDockableFactory)
public <M extends MultipleCDockable> M addDockable(M dockable)
dockable
, clients can also use addDockable(String, MultipleCDockable)
if
they want to specify the identifier themselves.
M
- the type of the new elementdockable
- the new element to show
dockable
public <M extends MultipleCDockable> M addDockable(String uniqueId, M dockable)
addDockable(MultipleCDockable)
if they want to assign a
random identifier to dockable
.
M
- the type of the new elementuniqueId
- id the unique id of the new elementdockable
- the new element to show
dockable
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
public void replace(MultipleCDockable oldDockable, MultipleCDockable newDockable)
oldDockable
with newDockable
. The new dockable
inherits settings and location of the old one.
oldDockable
- the old dockable, not null
newDockable
- the new dockable, not null
public MultipleCDockable getMultipleDockable(String id)
MultipleCDockable
which uses
the unique identifier id
.
id
- the identifier to look out for
id
or null
if nothing
was foundpublic String getUniqueId(MultipleCDockable dockable)
dockable
dockable
- the item to search
dockable
, may be null
public void removeDockable(MultipleCDockable dockable)
dockable
- the element to removepublic int getCDockableCount()
CDockable
s that are registered in this
CControl
.
public CDockable getCDockable(int index)
index
- the index of the element
public void addMultipleDockableFactory(String id, MultipleCDockableFactory<?,?> factory)
MultipleCDockable
s
when a layout is loaded. The NullMultipleCDockableFactory
will always be preinstalled using
the empty identifier.
id
- the unique id of the factory, must consist of at least one characterfactory
- the new factorypublic MultipleCDockableFactory<?,?> getMultipleDockableFactory(String id)
MultipleCDockableFactory
with the identifier
id
.
id
- the identifier to search for
null
public String getFactoryId(MultipleCDockableFactory<?,?> factory)
factory
.
factory
- the factory to search
null
public void removeMultipleDockableFactory(String id)
MultipleCDockableFactory
with identifier id
from this control. As a side effect all MultipleCDockable
s which
use that factory are removed as well. Nothing happens if there is no
factory registered with id
.
id
- the identifier of the factory to removepublic void setDefaultLocation(CLocation defaultLocation)
CDockable
s are opened when there is
nothing else specified for these CDockable
s.
defaultLocation
- the location, can be null
public CLocation getDefaultLocation()
CDockable
s are opened when nothing else
is specified.
null
setDefaultLocation(CLocation)
public void setMaximizeArea(String id)
CDockable
s are maximized onto the area
which is registered under the given unique id.
id
- the unique id of the areaCGridArea.getUniqueId()
,
CContentArea.getCenterIdentifier()
public void setGroupBehavior(CGroupBehavior behavior)
CGroupBehavior
. The behavior decides what happens when the user wants to change
the ExtendedMode
of a CDockable
.CDockable.setExtendedMode(ExtendedMode)
respective a call to LocationModeManager.setMode(Dockable, ExtendedMode)
. The buttons that are
visible to the user all link to these methods.
behavior
- the new behavior, not null
public CGroupBehavior getGroupBehavior()
CGroupBehavior
.
null
setGroupBehavior(CGroupBehavior)
@Deprecated public void setTheme(DockTheme theme)
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.
theme
- the new themepublic void setTheme(String theme)
theme
is used as key for ThemeMap.select(String)
.
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)
.public ThemeMap getThemes()
public void setMissingPerspectiveStrategy(MissingPerspectiveStrategy missingPerspectiveStrategy)
CStationPerspective
s.
missingPerspectiveStrategy
- the strategy, not null
public MissingPerspectiveStrategy getMissingPerspectiveStrategy()
CStationPerspective
.
null
public CControlPerspective getPerspectives()
dockables
or stations
.
CControl
allowing to inspect and modify the layouts
that are availableload(String)
,
save(String)
,
setMissingPerspectiveStrategy(MissingPerspectiveStrategy)
public void setRootWindow(WindowProvider window)
window
- the new owner, can be null
public WindowProvider getRootWindow()
setRootWindow(WindowProvider)
,
however the provide returned by this method will return the same window
as specified by setRootWindow(WindowProvider)
.
null
public PreferenceStorage getPreferences()
PreferenceModel
s for this control.
The contents of this container are stored in the
resource manager
.
getResources()
public void setPreferenceModel(PreferenceModel preferenceModel)
PreferenceModel
which will be used to translate between
this
and the preferences
. This
model can be set to null
.null
.
preferenceModel
- the new model, it will used to translate
the contents of getPreferences()
immediately, can be null
public PreferenceModel getPreferenceModel()
preferences
and this
.
null
setPreferenceModel(PreferenceModel)
public void setMissingStrategy(MissingCDockableStrategy missingStrategy)
CDockable
is found.
missingStrategy
- the strategy, null
will set
the default strategypublic MissingCDockableStrategy getMissingStrategy()
CDockable
is found.
null
public void addResizeRequestListener(ResizeRequestListener listener)
ResizeRequestListener
to this CControl
. The listener
will be informed when the resize requests of a CDockable
should
be processed.
listener
- the new listener, not null
public void removeResizeRequestListener(ResizeRequestListener listener)
ResizeRequestListener
from this CControl
.
listener
- the listener to removepublic void handleResizeRequests()
ResizeRequestListener
s, that the
resize request
of all
CDockable
s should be processed. There are no
guarantees that a resize requests can be granted or even gets processed.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.
public CDockFrontend intern()
public DockController getController()
DockController
which is used by this CControl
.
public IconManager getIcons()
Icon
s that are used within the realm of this
CControl
. Clients are free to modify the set of icons.
public void setRevertToBasicModes(boolean revert)
Dockable
s after loading a persistent layout. Basically if this property is set, then all Dockable
s
are un-maximized after a layout change. The default value of this property is true
.Dockable
would
hide the effects.Dockable
s from being in the wrong position if the client
was stared with new settings.
revert
- whether non-basic modes should be forbidden when loading a persistent layoutpublic boolean isRevertToBasicModes()
setRevertToBasicModes(boolean)
public void setTransferFocusOnMinimize(boolean transferFocusOnMinimize)
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.
transferFocusOnMinimize
- whether to enable the feature or not (default is true
)public boolean isTransferFocusOnMinimize()
CDockable
is minimized, the focus can be automatically transfered to another Dockable
.
setTransferFocusOnMinimize(boolean)
public void write(File file) throws IOException
file
.getResources().writeFile( file )
.
file
- the file to override
IOException
- if the file can't be writtenpublic void write(DataOutputStream out) throws IOException
out
.getResources().writeStream( out )
.
out
- the stream to write into
IOException
- if the stream is not writablepublic void writeXML(XElement element)
element
.getResources().writeXML( element )
.
element
- the element to write intopublic void writeXML(File file) throws IOException
file
in xml format.
file
- the file to write into
IOException
- if the file is not writablepublic void read(File file) throws IOException
file
.getResources().readFile( file )
.
file
- the file to read from
IOException
- if the file can't be readpublic void read(DataInputStream in) throws IOException
in
.getResources().readStream( in )
.
in
- the stream to read from
IOException
- if the stream can't be readpublic void readXML(XElement element)
element
.getResources().readXML( element )
.
element
- the element to read
XException
- if the xml file has the wrong structurepublic void readXML(File file) throws IOException
file
.
file
- the file to open and to read
IOException
- if the file cannot be read
XException
- if the xml file has the wrong structurepublic String save()
save(String)
public String save(boolean includeWorkingAreas)
includeWorkingAreas
- whether the content of the CStation
s that are marked as
working area
should be stored as well.
save(String)
public void save(String name)
name
- the name of the current layout.public void save(String name, boolean includeWorkingAreas)
name
- the name of the current layout.includeWorkingAreas
- whether the content of the CStation
s that are marked as
working area
should be stored as well.public void load(String name)
name
- the name of the layout.public void load(String name, boolean includeWorkingAreas)
name
- the name of the layout.includeWorkingAreas
- whether the content of the CStation
s that are marked as
working area
should be updated as well. This value should be the same
as was used to call save(String, boolean)
.public void delete(String name)
name
- the name of the layout to deletepublic String[] layouts()
public String getLayout()
save(String)
was called). The current
layout may not have a name if it was never saved. The result of this method will be a String
that is part of layouts()
.
null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |