H - class storing history informationpublic interface Mode<H>
Dockable can be. A Dockable
can be in exactly one Mode at a time. Notice that the mode may
change through events that are not registered or influenced by this
mode.| Modifier and Type | Method and Description |
|---|---|
boolean |
apply(Dockable dockable,
H history,
AffectedSet set)
Applies this mode to
dockable. |
H |
current(Dockable dockable)
Provides history information about the current state of
dockable
in respect to this mode. |
DockActionSource |
getActionsFor(Dockable dockable,
Mode<H> mode)
|
ModeSettingFactory<H> |
getSettingFactory()
Gets a factory for creating new
ModeSettings. |
Path |
getUniqueIdentifier()
Gets a unique identifier, only this
Mode must have this
identifier. |
boolean |
isCurrentMode(Dockable dockable)
Tells whether
dockable fulfills the requirements of
this mode, meaning whether dockable has this mode. |
boolean |
isDefaultMode(Dockable dockable)
Checks whether this mode is a default mode of
dockable. |
void |
readSetting(ModeSetting<H> setting)
Sets the properties of this mode.
|
void |
writeSetting(ModeSetting<H> setting)
Gets the current properties of this mode in an independent way.
|
DockActionSource getActionsFor(Dockable dockable, Mode<H> mode)
DockActionSource which should be shown on dockable
which is currently in mode. This method will be called
every time when dockable changes its mode.dockable - some element, not nullmode - the mode of dockable, not nulldockable, can be nullPath getUniqueIdentifier()
Mode must have this
identifier. Identifiers with the first segment being "dock" are
reserved for this framework, clients may choose any other identifiers.null, should contain at least
one segment.boolean apply(Dockable dockable, H history, AffectedSet set)
dockable. This method may fail for example because a DockAcceptance
does prevent dockable from being moved.dockable - the element whose mode becomes thishistory - history information that was returned by this mode
on its last call to current(Dockable). May be null
if this mode was never applied or returns null on current(Dockable).set - this method has to store all Dockables which might have changed their
mode in the set.true if dockable was successfully moved on its parent or to a new parent,
or false if dockable did not change its locationH current(Dockable dockable)
dockable
in respect to this mode.dockable - the elementapply(Dockable, Object, AffectedSet)boolean isDefaultMode(Dockable dockable)
dockable. A
default mode is a mode that is chosen per default, if no other mode
is selected. There should be only one default-mode per Dockable.dockable - some dockable, not nullboolean isCurrentMode(Dockable dockable)
dockable fulfills the requirements of
this mode, meaning whether dockable has this mode. There
should be only at most one mode which returns true for this
question. Please note, the mode selected in the ModeManager may
be out of date, and should not be considered when checking the
current mode.dockable - some dockable, not nulldockable is in this modevoid writeSetting(ModeSetting<H> setting)
setting - a ModeSetting with the same id as this Mode. This setting
was created by a ModeSettingFactory with the same id as this Mode.void readSetting(ModeSetting<H> setting)
ModeSetting that has been created by the current
ModeSettingFactorysetting - the new set of properties, not nullModeSettingFactory<H> getSettingFactory()
ModeSettings.nullCopyright © 2018. All rights reserved.