public class CLocationModeManager extends LocationModeManager<CLocationMode>
LocationModeManager providing additional methods for working with
CLocations, CommonDockables and other items specific to the
common project.| Modifier and Type | Field and Description |
|---|---|
static String |
ICON_MANAGER_KEY_EXTERNALIZE
the key used for the
IconManager to read the Icon for the "externalize"-action |
static String |
ICON_MANAGER_KEY_MAXIMIZE
the key used for the
IconManager to read the Icon for the "maximize"-action |
static String |
ICON_MANAGER_KEY_MINIMIZE
the key used for the
IconManager to read the Icon for the "minimize"-action |
static String |
ICON_MANAGER_KEY_NORMALIZE
the key used for the
IconManager to read the Icon for the "normalize"-action |
static String |
ICON_MANAGER_KEY_UNEXTERNALIZE
the key used for the
IconManager to read the Icon for the "unexternalize"-action |
static String |
ICON_MANAGER_KEY_UNMAXIMIZE_EXTERNALIZED
the key used for the
IconManager to read the Icon for the "unmaximize externalized"-action |
DOUBLE_CLICK_STRATEGY, MODE_ENABLEMENT| Constructor and Description |
|---|
CLocationModeManager(CControlAccess control)
Creates a new manager.
|
| Modifier and Type | Method and Description |
|---|---|
ExtendedMode |
childsExtendedMode(DockStation parent)
Guesses the result of
LocationModeManager.getCurrentMode(Dockable) once a Dockable is
dropped onto DockStation. |
protected boolean |
createEntryDuringRead(String key)
Tells whether an entry for a missing
Dockable should be created. |
<B> ModeSettings<Location,B> |
createModeSettings(ModeSettingsConverter<Location,B> converter)
Creates the empty set of settings for this
ModeManager. |
boolean |
ensureBasicModes()
Ensures that all dockables are in a basic mode.
|
void |
ensureValidLocation(CDockable dockable)
This method compares the current mode of
dockable with its
availability set. |
void |
ensureValidLocation(Dockable dockable)
Empty method evaluating the correct location of a
Dockable. |
protected CStation<?> |
getAreaOf(Dockable dockable)
Searches
dockable and its parent for the first CStation
that is a working area. |
CLocation |
getDropLocation(CStation<?> station)
Tries to find the "optimal spot" where to put a new child onto
station. |
CExternalizedMode |
getExternalizedMode()
Direct access to the mode handling "externalized"
Dockables. |
CLocation |
getLocation(Dockable dockable)
Gets an element describing the location of
dockable as
good as possible. |
CLocation |
getLocation(Dockable dockable,
ExtendedMode mode)
Assuming that
dockable is currently not in mode mode,
then this method searches for the previously stored location of dockable. |
CMaximizedMode |
getMaximizedMode()
Direct access to the mode handling "maximized"
Dockables. |
CMinimizedMode |
getMinimizedMode()
Direct access to the mode handling "minimized"
Dockables. |
CNormalMode |
getNormalMode()
Direct access to the mode handling "normal"
Dockables. |
void |
readSettings(ModeSettings<Location,?> settings)
Reads the contents of
settings and stores it. |
Runnable |
readSettings(ModeSettings<Location,?> settings,
UndoableModeSettings pending)
Reads the contents of
settings, creates new entries if either
ModeManager.createEntryDuringRead(String) or if pending allows the setting
to be undone if not needed. |
void |
remove(Dockable dockable)
Removes the properties that belong to
dockable. |
void |
resetWorkingAreaChildren()
Updates the location of all dockables that should be on a working-area
and that are currently in a mode that does not support working-areas.
|
void |
setLocation(Dockable dockable,
CLocation location)
Tries to set the location of
dockable. |
void |
setLocation(Dockable dockable,
ExtendedMode mode,
CLocation location)
Sets the default location of
dockable when going into
mode. |
addListener, apply, apply, applyDuringRead, delayedRefresh, destroy, ensureNotHidden, getCurrentAction, getCurrentMode, getDoubleClickStrategy, getGroupBehavior, getMode, getRepresentations, getSharedActions, isLayouting, isModeAvailable, isModeHidden, removeListener, runLayoutTransaction, setDoubleClickStrategy, setGroupBehavior, setLocationAside, setMode, updateEnablementadd, addAffected, addEmpty, addModeManagerListener, addToModeHistory, apply, apply, apply, apply, apply, createSettings, fireAdded, fireAdded, fireModeChanged, fireRemoved, fireRemoved, getController, getDefaultMode, getDoubleClickTarget, getFactories, getHistory, getHistoryRewriter, getKey, getMode, getModeHistory, getPreviousMode, getProperties, getPropertyHistory, isEmpty, isOnContinuous, isOnTransaction, isRegistered, listDockables, listeners, modes, put, putFactory, putMode, rebuild, rebuildAll, reduceToEmpty, refresh, refresh, removeEmpty, removeMode, removeModeManagerListener, runTransaction, runTransaction, runTransaction, runTransaction, setHistoryRewriter, setProperties, store, store, toString, writeSettingspublic static final String ICON_MANAGER_KEY_MINIMIZE
IconManager to read the Icon for the "minimize"-actionpublic static final String ICON_MANAGER_KEY_MAXIMIZE
IconManager to read the Icon for the "maximize"-actionpublic static final String ICON_MANAGER_KEY_NORMALIZE
IconManager to read the Icon for the "normalize"-actionpublic static final String ICON_MANAGER_KEY_EXTERNALIZE
IconManager to read the Icon for the "externalize"-actionpublic static final String ICON_MANAGER_KEY_UNEXTERNALIZE
IconManager to read the Icon for the "unexternalize"-actionpublic static final String ICON_MANAGER_KEY_UNMAXIMIZE_EXTERNALIZED
IconManager to read the Icon for the "unmaximize externalized"-actionpublic CLocationModeManager(CControlAccess control)
control - the control in whose realm this manager workspublic CNormalMode getNormalMode()
Dockables.public CMaximizedMode getMaximizedMode()
Dockables.public CMinimizedMode getMinimizedMode()
Dockables.public CExternalizedMode getExternalizedMode()
Dockables.protected boolean createEntryDuringRead(String key)
ModeManagerDockable should be created.
This will result in a call to ModeManager.addEmpty(String) during
ModeManager.readSettings(ModeSettings).
The default implementation returns always false.createEntryDuringRead in class ModeManager<Location,CLocationMode>key - the key for which to create a new entrytrue if an entry should be createdpublic void remove(Dockable dockable)
ModeManagerdockable.remove in class ModeManager<Location,CLocationMode>dockable - the element to removepublic <B> ModeSettings<Location,B> createModeSettings(ModeSettingsConverter<Location,B> converter)
ModeManagerModeManager. Subclasses
may override this method to use another set of settings. This method does
not need to call ModeSettings.addFactory(ModeSettingFactory).createModeSettings in class ModeManager<Location,CLocationMode>B - the intermediate formatconverter - conversion tool from this manager's meta-data format to the
intermediate format.public void readSettings(ModeSettings<Location,?> settings)
ModeManagersettings and stores it.readSettings in class ModeManager<Location,CLocationMode>settings - the settings to readpublic Runnable readSettings(ModeSettings<Location,?> settings, UndoableModeSettings pending)
ModeManagersettings, creates new entries if either
ModeManager.createEntryDuringRead(String) or if pending allows the setting
to be undone if not needed.readSettings in class ModeManager<Location,CLocationMode>settings - the settings to readpending - undoable settings, can be nullpending
did advise so, null if pending was nullpublic void setLocation(Dockable dockable, CLocation location)
dockable. Does nothing if
location is invalid or requires information that is
not available. If dockable is a CommonDockable and
the mode respects working-areas,
then the working-area is set or removed depending on the value of CStation.isWorkingArea().dockable - the element to movelocation - the new location of dockablepublic void setLocation(Dockable dockable, ExtendedMode mode, CLocation location)
dockable when going into
mode. The properties set here will be overridden
as soon as the user drags dockable to another location (within
the same mode) or dockable is removed permanently.dockable is already in
mode. There is also no effect if dockable
has not been registered at the CLocationModeManager.location
and mode belong to each other.dockable - the element whose location will be setmode - the mode for which the location is to be set or nulllocation - the new locationIllegalArgumentException - if either argument is null or
if CLocation.findRoot() or CLocation.findProperty() returns
nullpublic CLocation getLocation(Dockable dockable)
dockable as
good as possible.dockable - the element whose location should be searchednull if no location was foundpublic CLocation getLocation(Dockable dockable, ExtendedMode mode)
dockable is currently not in mode mode,
then this method searches for the previously stored location of dockable.
Note that this method can't tell where dockable would be
shown if it never was in that mode and the client never specified the
location.dockable - the dockable whose location is searchedmode - the mode which might be taken by dockablenullIllegalArgumentException - if any argument is nullpublic CLocation getDropLocation(CStation<?> station)
station. In this
case the optimal spot is CLocation.aside() the latest focused child of station.station - the station where a CDockable is about to be dropped ontopublic void ensureValidLocation(Dockable dockable)
LocationModeManagerDockable. To be
overridden by subclasses to handle elements which have additional restrictions.ensureValidLocation in class LocationModeManager<CLocationMode>dockable - the element to checkpublic void ensureValidLocation(CDockable dockable)
dockable with its
availability set. If the current mode is not available, then dockable
is put into another mode (usually the normal mode).layouting modedockable - the element whose mode is to be checkedpublic boolean ensureBasicModes()
layouting modetrue if at least one element was affected by changes,
false if nothing happened.public void resetWorkingAreaChildren()
public ExtendedMode childsExtendedMode(DockStation parent)
LocationModeManager.getCurrentMode(Dockable) once a Dockable is
dropped onto DockStation. If more than one mode is using
parent, then the guess might not always be correct.parent - some stationnull if no guess can be madeCopyright © 2018. All rights reserved.