|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bibliothek.gui.DockFrontend
public class DockFrontend
A DockFrontend provides some methods to handle the storage of various layouts.
The frontend can save the current layout (the location of all Dockables) and
later restore it. Each set of properties is stored in a Setting
. Subclasses
might override the following methods to store additional information:
createSetting()
getSetting(boolean)
and setSetting(Setting, boolean)
write(Setting, boolean, DataOutputStream)
and read(boolean, DataInputStream)
or
Setting.write(DockSituation, PropertyTransformer, boolean, DataOutputStream)
and
Setting.read(DockSituation, PropertyTransformer, boolean, DataInputStream)
writeXML(Setting, boolean, XElement)
and readXML(boolean, XElement)
or
Setting.writeXML(DockSituation, PropertyTransformer, boolean, XElement)
and
Setting.readXML(DockSituation, PropertyTransformer, boolean, XElement)
added
to this frontend, are just ignored.addRoot
). The frontend will only
store the locations of children of these roots. The frontend adds these
roots also to its controller
, but the frontend does
not observe the controller, and so all changes must be applied directly
on the frontend (on the other hand, clients may use more than one frontend).factories
to allow the storage of their elements. The default-factories are already
installed.Common project
instead of DockFrontend
.
The Common project
offers way more features than DockFrontend
and is even
easier to handle.
Nested Class Summary | |
---|---|
class |
DockFrontend.DockInfo
Information about a Dockable . |
class |
DockFrontend.Hider
An object which is action and ActionGuard at the same time. |
static class |
DockFrontend.RootInfo
Stores information about a root-station. |
Field Summary | |
---|---|
static java.lang.String |
DOCKABLE_KEY_PREFIX
prefix used for Dockable s when creating a new PredefinedDockSituation |
static PropertyKey<javax.swing.KeyStroke> |
HIDE_ACCELERATOR
This KeyStore calls hide(Dockable) for the currently selected Dockable . |
static java.lang.String |
ROOT_KEY_PREFIX
prefix used for root s when creating a new PredefinedDockSituation |
Constructor Summary | |
---|---|
DockFrontend()
Constructs a new frontend, creates a new controller. |
|
DockFrontend(DockController controller)
Constructs a new frontend. |
|
DockFrontend(DockController controller,
java.awt.Window owner)
Constructs a new frontend, tries to set up a ScreenDockStationFactory
and sets the root window of controller to owner . |
|
DockFrontend(DockController controller,
WindowProvider owner)
Constructs a new frontend, tries to set up a ScreenDockStationFactory
and sets the root window of controller to owner . |
|
DockFrontend(java.awt.Window owner)
Constructs a new frontend, creates a new controller. |
|
DockFrontend(WindowProvider owner)
Constructs a new frontend, creates a new controller. |
Method Summary | |
---|---|
void |
add(Dockable dockable,
java.lang.String name)
Deprecated. replaced by addDockable(String, Dockable) , since name
is used as key in a map, it should come first. Note: this method might
be removed in future releases. |
void |
addDockable(java.lang.String id,
Dockable dockable)
Adds a Dockable to this frontend. |
void |
addEmpty(java.lang.String name)
Adds the name of a Dockable whose properties should be stored
in this frontend even if the Dockable itself is not
registered. |
void |
addFrontendListener(DockFrontendListener listener)
Adds a listener to this frontend. |
void |
addRepresentative(DockElementRepresentative representative)
Adds a representative for some DockElement . |
void |
addRoot(DockStation station,
java.lang.String name)
Deprecated. replaced by addRoot(String, DockStation) , since
name is used as key in a map it should come first |
void |
addRoot(java.lang.String id,
DockStation station)
Adds a root to this frontend. |
void |
addVetoableListener(VetoableDockFrontendListener listener)
Adds listener to this frontend. |
protected void |
clean(DockSituationIgnore ignore)
Removes all child-parent relations expect the ones filtered out by ignore . |
protected void |
clean(DockStation station,
DockSituationIgnore ignore)
Removes recursively all children from station , but only
if the children are not filtered by ignore . |
protected DockFrontend.Hider |
createHider()
Creates the action that is added to all known dockables, and which is called the "close"-action. |
protected Setting |
createSetting()
Creates a bag that contains all information needed to describe the current set of properties. |
boolean |
delete(java.lang.String name)
Deletes the setting with the given name . |
protected void |
fireAdded(Dockable dockable)
Invokes the method DockFrontendListener.added(DockFrontend, Dockable)
on all listeners. |
protected void |
fireAllHidden(Dockable dockable,
java.util.Set<Dockable> processed)
Invokes the method DockFrontendListener.hidden(DockFrontend, Dockable)
on all listeners for dockable and all its children. |
protected void |
fireAllShown(Dockable dockable,
java.util.Set<Dockable> processed)
Invokes the method DockFrontendListener.shown(DockFrontend, Dockable)
on all listeners for dockable and all its children. |
protected void |
fireDeleted(java.lang.String name)
Invokes the method DockFrontendListener.deleted(DockFrontend, String)
on all listeners. |
protected void |
fireHidden(Dockable dockable)
Invokes the method DockFrontendListener.hidden(DockFrontend, Dockable)
on all listeners. |
protected void |
fireHideable(Dockable dockable,
boolean value)
Invokes the method DockFrontendListener.hideable(DockFrontend, Dockable, boolean)
on all listeners. |
protected void |
fireLoaded(java.lang.String name)
Invokes the method DockFrontendListener.loaded(DockFrontend, String)
on all listeners. |
protected void |
fireRead(java.lang.String name)
Invokes the method DockFrontendListener.read(DockFrontend, String)
on all listeners. |
protected void |
fireRemoved(Dockable dockable)
Invokes the method DockFrontendListener.removed(DockFrontend, Dockable)
on all listeners. |
protected void |
fireSaved(java.lang.String name)
Invokes the method DockFrontendListener.saved(DockFrontend, String)
on all listeners. |
protected void |
fireShown(Dockable dockable)
Invokes the method DockFrontendListener.shown(DockFrontend, Dockable)
on all listeners. |
DockController |
getController()
Gets the controller which is used by this frontend. |
java.lang.String |
getCurrentSetting()
Gets the name of the setting which was loaded or saved the last time. |
DockStation |
getDefaultStation()
Gets the default station of this frontend. |
Dockable |
getDockable(java.lang.String name)
Gets the Dockable which was added
to this frontend with the name name . |
java.util.Collection<Dockable> |
getDockables()
Deprecated. please use listDockables() |
DockProperties |
getDockProperties()
Gets the set of properties which have a controller-global influence. |
FrontendEntry |
getFrontendEntry(java.lang.String key)
Gets all the information known about the Dockable with
name key . |
DockFrontend.Hider |
getHider()
Gets the action which is added to all known Dockables, and which is called the "close"-action. |
DockSituationIgnore |
getIgnoreForEntry()
Gets the filter which is used when saving or loading a normal entry. |
DockSituationIgnore |
getIgnoreForFinal()
Gets the filter which is applied when saving or loading the final layout at the startup or shutdown of the application. |
Setting |
getLastAppliedEntrySetting()
Gets the last Setting that was given to setSetting(Setting, boolean)
when the entry-parameter was set to true . |
Setting |
getLastAppliedFullSetting()
Gets the last Setting that was given to setSetting(Setting, boolean)
when the entry-parameter was set to false . |
LayoutChangeStrategy |
getLayoutChangeStrategy()
Gets the current strategy that is used to read Setting s by this DockFrontend . |
MissingDockableStrategy |
getMissingDockable()
Gets the strategy that is applied for location information of missing Dockable s. |
java.util.Map<java.lang.String,Dockable> |
getNamedDockables()
Gets an independent map containing all Dockables registered to this frontend. |
java.lang.String |
getNameOf(Dockable dockable)
Searches the name of dockable as it was given to
add(Dockable, String) . |
WindowProvider |
getOwner()
Gets the current provider for the root window. |
Perspective |
getPerspective(boolean entry)
Creates and returns a new Perspective which can be used to read, write and convert
PerspectiveElement s. |
Perspective |
getPerspective(boolean entry,
FrontendPerspectiveCache factory)
Creates and returns a new Perspective which can be used to read, write and convert
PerspectiveElement s. |
DockStation |
getRoot(java.lang.String name)
Gets the root with the designated name. |
DockStation[] |
getRoots()
Gets a modifiable array containing all DockStation s which are
registered as root. |
Setting |
getSetting(boolean entry)
Creates a new Setting which describes the current set of
properties of this frontend. |
Setting |
getSetting(java.lang.String name)
Gets the Setting which stores locations and other information under the key name . |
java.util.Set<java.lang.String> |
getSettings()
Gets a set of the names of all known settings. |
boolean |
hasLocation(Dockable dockable)
Tells whether this DockFrontend currently knows where to
put dockable . |
void |
hide(Dockable dockable)
Makes dockable invisible. |
void |
hide(Dockable dockable,
boolean cancelable)
Makes dockable invisible. |
boolean |
isDefaultEntryLayout()
Gets the default value of isEntryLayout(Dockable) . |
boolean |
isDefaultHideable()
Gets the default value of setHideable(Dockable, boolean) . |
boolean |
isEmpty(java.lang.String name)
Tells whether name denotes an entry that can be empty. |
boolean |
isEntryLayout(Dockable dockable)
Tells whether the layout of dockable should be stored
for entry Setting s. |
boolean |
isEntryLayout(java.lang.String id)
Tells whether the layout of id should be stored
for entry Setting s. |
boolean |
isHidden(Dockable dockable)
Tells whether dockable is hidden or not. |
boolean |
isHiddenRootStation(DockElement element)
Tells whether element is a root-station and at the same time a Dockable
without parent. |
boolean |
isHideable(Dockable dockable)
Tells whether there is a "close"-action for dockable or not. |
boolean |
isShowHideAction()
Tells whether the hide-action is shown or not. |
boolean |
isShown(Dockable dockable)
Tells whether dockable is visible or not. |
void |
kill()
Destroys this DockFrontend , it will no longer be useful but
can be removed by the garbage collector. |
java.util.List<Dockable> |
listDockables()
Gets a list of all Dockable s which are registered at this
frontend. |
java.lang.String[] |
listEmpty(boolean all)
Gets a list of all keys that are marked as empty . |
protected DockFrontendListener[] |
listeners()
Gets an independent array containing all currently registered listeners. |
java.util.List<FrontendEntry> |
listFrontendEntries()
Gets a list of all informations known of any Dockable
that is or might be registered at this frontend. |
java.util.Set<Dockable> |
listShownDockables()
Gets a set of all Dockable which are known to this frontend
and which are visible. |
void |
load(java.lang.String name)
Loads a setting of this frontend. |
protected Setting |
read(boolean entry,
java.io.DataInputStream in)
Calls first createSetting() and then
Setting.read(DockSituation, PropertyTransformer, boolean, DataInputStream) . |
void |
read(java.io.DataInputStream in)
Reads the settings of this frontend from in . |
protected Setting |
readXML(boolean entry,
XElement element)
Calls createSetting() and then
Setting.readXML(DockSituation, PropertyTransformer, boolean, XElement) . |
void |
readXML(XElement element)
Reads the contents of this frontend from an xml element. |
void |
registerAdjacentFactory(AdjacentDockFactory<?> factory)
Registers a factory that stores additional information for a set of Dockable s. |
void |
registerBackupFactory(DockFactory<? extends Dockable,?,?> factory)
Register a backup factory. |
void |
registerFactory(DockablePropertyFactory factory)
Registers a factory to write and read properties. |
void |
registerFactory(DockFactory<?,?,?> factory)
Registers a factory to write and read Dockables and
DockStations . |
void |
registerFactory(DockFactory<? extends Dockable,?,?> factory,
boolean backup)
Registers a factory to write and read Dockable s and DockStation s. |
void |
remove(Dockable dockable)
Removes a Dockable which was earlier added to this frontend. |
void |
removeEmpty(java.lang.String name)
Removes the properties of a non existing Dockable and/or
changes the flag to store information about the non existing
Dockable name to false . |
void |
removeFrontendListener(DockFrontendListener listener)
Removes an earlier added listener from this frontend. |
void |
removeRepresentative(DockElementRepresentative representative)
Removes representative from this frontend. |
void |
removeRoot(DockStation station)
Removes a root from this frontend. |
void |
removeVetoableListener(VetoableDockFrontendListener listener)
Removes listener from this frontend. |
void |
save()
Saves the current layout under the name of the current setting . |
void |
save(java.lang.String name)
Saves the current layout with the specified name. |
void |
setCurrentSetting(java.lang.String setting)
Sets the name of the current setting. |
void |
setCurrentSettingName(java.lang.String setting)
Changes the name of the current setting. |
void |
setDefaultEntryLayout(boolean defaultEntryLayout)
Sets the default value for setEntryLayout(Dockable, boolean) . |
void |
setDefaultHideable(boolean defaultHideable)
Sets the default setting for setHideable(Dockable, boolean) . |
void |
setDefaultStation(DockStation defaultStation)
Sets the default station of this frontend. |
void |
setEntryLayout(Dockable dockable,
boolean layout)
Sets whether the layout of dockable should be stored
for entry Setting s. |
void |
setEntryLayout(java.lang.String id,
boolean layout)
Sets whether the layout of id should be stored
for entry Setting s. |
void |
setHideable(Dockable dockable,
boolean hideable)
Sets whether to show add a close-action or not to dockable . |
void |
setIgnoreForEntry(DockSituationIgnore ignoreForEntry)
Sets a filter which is applied when saving or loading a normal entry. |
void |
setIgnoreForFinal(DockSituationIgnore ignoreForFinal)
Sets the filter which is applied when saving or loading the final layout at the startup or shutdown of the application. |
void |
setLayoutChangeStrategy(LayoutChangeStrategy strategy)
Sets the strategy this DockFrontend should use to read Setting s. |
void |
setMissingDockableStrategy(MissingDockableStrategy missingDockable)
Sets the strategy how to deal with location information of Dockable s
which are missing and which are not marked as empty . |
void |
setOwner(WindowProvider owner)
Sets the window which is used as root for any dialog, can be null . |
void |
setSetting(Setting setting,
boolean entry)
Changes the content of all root-stations according to setting . |
void |
setSetting(java.lang.String name,
Setting setting)
Stores the setting setting with the given name. |
void |
setShowHideAction(boolean show)
Sets whether to show the hide-action or not. |
void |
show(Dockable dockable)
Ensures that dockable is child of a root known to this
frontend. |
void |
show(Dockable dockable,
boolean cancelable)
Ensures that dockable is child of a root known to this
frontend. |
void |
unregisterAdjacentFactory(AdjacentDockFactory<?> factory)
Removes an additional factory from this frontend. |
void |
unregisterBackupFactory(DockFactory<?,?,?> factory)
Removes a backup factory from this frontend. |
void |
unregisterFactory(DockFactory<?,?,?> factory)
Removes a factory from this frontend. |
void |
write(java.io.DataOutputStream out)
Writes all settings of this frontend, including the current layout, into out . |
protected void |
write(Setting setting,
boolean entry,
java.io.DataOutputStream out)
Calls Setting.write(DockSituation, PropertyTransformer, boolean, DataOutputStream) |
protected void |
writeXML(Setting setting,
boolean entry,
XElement element)
Calls Setting.writeXML(DockSituation, PropertyTransformer, boolean, XElement) . |
void |
writeXML(XElement element)
Writes all properties of this frontend into an xml 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<javax.swing.KeyStroke> HIDE_ACCELERATOR
KeyStore
calls hide(Dockable)
for the currently selected Dockable
.
public static final java.lang.String DOCKABLE_KEY_PREFIX
Dockable
s when creating a new PredefinedDockSituation
public static final java.lang.String ROOT_KEY_PREFIX
root
s when creating a new PredefinedDockSituation
Constructor Detail |
---|
public DockFrontend()
public DockFrontend(java.awt.Window owner)
ScreenDockStationFactory
, which can only be created if the owner
of the dialogs is known.
owner
- the owner of the dialogs of a ScreenDockStationFactory
,
may be null
public DockFrontend(WindowProvider owner)
ScreenDockStationFactory
, which can only be created if the owner
of the dialogs is known.
owner
- the owner of the dialogs of a ScreenDockStationFactory
,
may be null
public DockFrontend(DockController controller)
controller
- the controller used to store root stationspublic DockFrontend(DockController controller, java.awt.Window owner)
ScreenDockStationFactory
and sets the root window of controller
to owner
.
controller
- the controller used to store the root stationsowner
- the owner of the dialog of a ScreenDockStation
,
may be null
public DockFrontend(DockController controller, WindowProvider owner)
ScreenDockStationFactory
and sets the root window of controller
to owner
.
controller
- the controller used to store the root stationsowner
- the owner of the dialog of a ScreenDockStation
,
may be null
Method Detail |
---|
public DockController getController()
public void setOwner(WindowProvider owner)
null
.
owner
- the owning windowDockController.setRootWindowProvider(WindowProvider)
public WindowProvider getOwner()
setOwner(WindowProvider)
, however it
will return the same value.
null
public void kill()
DockFrontend
, it will no longer be useful but
can be removed by the garbage collector.
@Deprecated public java.util.Collection<Dockable> getDockables()
listDockables()
Dockables
which are added to this frontend.
public void addFrontendListener(DockFrontendListener listener)
listener
- the observerpublic void removeFrontendListener(DockFrontendListener listener)
listener
- the observer which will be removedpublic void addVetoableListener(VetoableDockFrontendListener listener)
listener
to this frontend. The listener will be notified
when a Dockable
will be or is closed.Dockable
s that are
known
to this DockFrontend
.
It may or may not receive events for other Dockable
s.
listener
- the new listenerpublic void removeVetoableListener(VetoableDockFrontendListener listener)
listener
from this frontend.
listener
- the listener to removepublic void registerFactory(DockFactory<?,?,?> factory)
Dockables
and
DockStations
.
factory
- the new factorypublic void registerFactory(DockFactory<? extends Dockable,?,?> factory, boolean backup)
Dockable
s and DockStation
s.
factory
- the new factorybackup
- if true
, then factory
is registered
as backup factory
as well.public void registerBackupFactory(DockFactory<? extends Dockable,?,?> factory)
Dockable
that is expected to be in the cache, but is missing. The new Dockable
is automatically added to this frontend.Dockable
, a backup factory will also install the Dockable
on the
DockFrontend
using the identifier the element had when it was saved (this happens automatically).
factory
- a new factorypublic void registerAdjacentFactory(AdjacentDockFactory<?> factory)
Dockable
s.
factory
- the additional factory, not null
public void unregisterFactory(DockFactory<?,?,?> factory)
factory
- the factory to removeunregisterBackupFactory(DockFactory)
public void unregisterBackupFactory(DockFactory<?,?,?> factory)
factory
- the factory to removepublic void unregisterAdjacentFactory(AdjacentDockFactory<?> factory)
factory
- the factory to removepublic void registerFactory(DockablePropertyFactory factory)
DockStation
.
factory
- the new factorypublic void addDockable(java.lang.String id, Dockable dockable)
dockable
. The frontend also assumes that dockable
can be reused when reading a setting. That means, that the factory which
matches the key of dockable
does not create a new instance
when reading the preferences of dockable
. You should note that
the frontend does not support Dockables
whose lifespan
ends when they are made invisible.
id
- the unique name of the Dockabledockable
- the new Dockable
java.lang.IllegalArgumentException
- if either of dockable
or
id
is null
, or if id
is not
unique.@Deprecated @Todo(compatibility=BREAK_MINOR, priority=MINOR, target=VERSION_1_1_1, description="Replace this method with addDockable") public void add(Dockable dockable, java.lang.String name)
addDockable(String, Dockable)
, since name
is used as key in a map, it should come first. Note: this method might
be removed in future releases.
dockable
. The frontend also assumes that dockable
can be reused when reading a setting. That means, that the factory which
matches the key of dockable
does not create a new instance
when reading the preferences of dockable
. You should note that
the frontend does not support Dockables
whose lifespan
ends when they are made invisible.
dockable
- the new Dockablename
- the unique name of the Dockable
java.lang.IllegalArgumentException
- if either of dockable
or
name
is null
, or if name
is not
unique.public void setMissingDockableStrategy(MissingDockableStrategy missingDockable)
Dockable
s
which are missing and which are not marked as empty
.empty info
will be added to store it. Note that setting the strategy does only
affect future actions, information already stored or discarded will not
be rescued or thrown away.
missingDockable
- the new strategy, null
is valid and
will force this frontend to discard any information.public MissingDockableStrategy getMissingDockable()
Dockable
s.
null
setMissingDockableStrategy(MissingDockableStrategy)
public void setLayoutChangeStrategy(LayoutChangeStrategy strategy)
DockFrontend
should use to read Setting
s.DockFrontend
has been created. Clients
should always set the same kind of strategy.
strategy
- the new strategy, not null
public LayoutChangeStrategy getLayoutChangeStrategy()
Setting
s by this DockFrontend
.
null
public java.util.Map<java.lang.String,Dockable> getNamedDockables()
public Dockable getDockable(java.lang.String name)
Dockable
which was added
to this frontend with the name name
.
name
- the name of a Dockable
null
public java.lang.String getNameOf(Dockable dockable)
dockable
as it was given to
add(Dockable, String)
.
dockable
- some element whose name is searched
null
public void addRoot(java.lang.String id, DockStation station)
Dockables
which are
children of a root can be stored. The frontend forwards the roots to
its controller
(through the add
-method). Note
that the frontend does not observe its controller and therefore does not
know whether there are other roots registered at the controller.default station
.
id
- the unique name of the stationstation
- the new station
java.lang.IllegalArgumentException
- if station
or name
is null
, or if name
is not unique.@Deprecated public void addRoot(DockStation station, java.lang.String name)
addRoot(String, DockStation)
, since
name
is used as key in a map it should come first
Dockables
which are
children of a root can be stored. The frontend forwards the roots to
its controller
(through the add
-method). Note
that the frontend does not observe its controller and therefore does not
know whether there are other roots registered at the controller.default station
.
station
- the new stationname
- the unique name of the station
java.lang.IllegalArgumentException
- if station
or name
is null
, or if name
is not unique.public DockStation getRoot(java.lang.String name)
name
- the name of the root
null
public DockStation[] getRoots()
DockStation
s which are
registered as root.
public void addRepresentative(DockElementRepresentative representative)
DockElement
. Note that no two
representatives can have the same
component
. If two have
the same, then the second one overrides the first one.
representative
- the new representativeDockController.addRepresentative(DockElementRepresentative)
public void removeRepresentative(DockElementRepresentative representative)
representative
from this frontend.
representative
- the element to removeDockController.removeRepresentative(DockElementRepresentative)
public void setDefaultStation(DockStation defaultStation)
Dockables
whose location could not be stored
earlier or whose location has become invalid.
defaultStation
- the default station, can be null
public DockStation getDefaultStation()
setDefaultStation(DockStation)
or a root picked at random.
null
public void remove(Dockable dockable)
Dockable
which was earlier added to this frontend.
dockable
- the element to removepublic void addEmpty(java.lang.String name)
Dockable
whose properties should be stored
in this frontend even if the Dockable
itself is not
registered.this
can add "empty infos" automatically
when calling setSetting(Setting, boolean)
and information
is found that is not associated with any Dockable
, but
whose key passes the methods of MissingDockableStrategy
.
name
- the name of the dockablepublic void removeEmpty(java.lang.String name)
Dockable
and/or
changes the flag to store information about the non existing
Dockable
name
to false
.
name
- the empty element to removepublic boolean isEmpty(java.lang.String name)
name
denotes an entry that can be empty.
name
- some unique identifier
true
if information about a Dockable name
is stored even if the element is null
public java.lang.String[] listEmpty(boolean all)
empty
.
all
- if true
then just all keys are returned, if
false
then only those keys are returned for which no
Dockable
is registered.
null
addEmpty(String)
,
removeEmpty(String)
public void removeRoot(DockStation station)
default station
, then the
default station is set to null
.
station
- the root to removepublic boolean hasLocation(Dockable dockable)
DockFrontend
currently knows where to
put dockable
.
dockable
- the element whose location might be known
true
if the location of dockable
is knownpublic void setIgnoreForEntry(DockSituationIgnore ignoreForEntry)
ignoreForEntry
- the filter, can be null
public DockSituationIgnore getIgnoreForEntry()
null
public void setIgnoreForFinal(DockSituationIgnore ignoreForFinal)
ignoreForFinal
- the filter, can be null
public DockSituationIgnore getIgnoreForFinal()
null
public DockProperties getDockProperties()
public Setting getLastAppliedFullSetting()
Setting
that was given to setSetting(Setting, boolean)
when the entry-parameter was set to false
. This might be
null
if no setting was yet applied.
null
public Setting getLastAppliedEntrySetting()
Setting
that was given to setSetting(Setting, boolean)
when the entry-parameter was set to true
. This might be
null
if no setting was yet applied or a non-entry setting
was applied.
null
public java.util.Set<java.lang.String> getSettings()
public Setting getSetting(java.lang.String name)
Setting
which stores locations and other information under the key name
.
name
- a key that was used for calling save(String)
null
if not foundpublic java.lang.String getCurrentSetting()
null
if no setting was saved yetpublic void setCurrentSetting(java.lang.String setting)
setting
- the name of the new settingpublic void setCurrentSettingName(java.lang.String setting)
getCurrentSetting()
. This method does not fire
any events as nothing happens.
setting
- the name to use, can be null
public void setSetting(java.lang.String name, Setting setting)
setting
with the given name.
name
- the name of the settingsetting
- the new setting, not null
public boolean isHidden(Dockable dockable)
dockable
is hidden or not. A Dockable
is hidden if either
isHiddenRootStation(DockElement)
is true
or if isShown(Dockable)
is false
.
dockable
- the element whose state is asked
true
if dockable
is not visibleisHiddenRootStation(DockElement)
public boolean isShown(Dockable dockable)
dockable
is visible or not. A Dockable
is visible if it is or will
be registered. A root-station is always visible.
dockable
- the element whose state is asked
true
if dockable
is visibleisHiddenRootStation(DockElement)
public boolean isHiddenRootStation(DockElement element)
element
is a root-station and at the same time a Dockable
without parent.
element
- the element to check
true
if element
is a root-station and a dockable without parentpublic void setDefaultHideable(boolean defaultHideable)
setHideable(Dockable, boolean)
. This
default value is stored as soon as the identifier of a Dockable
becomes known and further changes of the default value will not affect it.
defaultHideable
- the default valuesetHideable(Dockable, boolean)
public boolean isDefaultHideable()
setHideable(Dockable, boolean)
.
setDefaultHideable(boolean)
public boolean isHideable(Dockable dockable)
dockable
or not.
dockable
- the element whose state is asked, must be known to this
frontend.
true
if dockable
has a close-actionpublic void setHideable(Dockable dockable, boolean hideable)
dockable
.
Changes are affected immediately.
dockable
- the element whose state will be changedhideable
- the new state
java.lang.IllegalArgumentException
- if dockable
is not known
to this frontendpublic void setShowHideAction(boolean show)
hide
).
show
- whether to show the actionsetHideable(Dockable, boolean)
public boolean isShowHideAction()
true
if the action is shown on
hideable
dockables or false
otherwisepublic void setDefaultEntryLayout(boolean defaultEntryLayout)
setEntryLayout(Dockable, boolean)
.
This default value is stored as soon as the identifier of a Dockable
becomes known and will not be affected by further changes of the default
value.
defaultEntryLayout
- whether the contents of Dockable
s should
be stored in entry
Setting
s or notgetSetting(boolean)
public boolean isDefaultEntryLayout()
isEntryLayout(Dockable)
.
public void setEntryLayout(Dockable dockable, boolean layout)
dockable
should be stored
for entry
Setting
s.
dockable
- the element whose state is to be setlayout
- the new state
java.lang.IllegalArgumentException
- if dockable
is not
knowngetSetting(boolean)
public void setEntryLayout(java.lang.String id, boolean layout)
id
should be stored
for entry
Setting
s.
id
- the id of the element whose state is to be changedlayout
- the new state
java.lang.IllegalArgumentException
- if id
is not
knowngetSetting(boolean)
public boolean isEntryLayout(Dockable dockable)
dockable
should be stored
for entry
Setting
s.
dockable
- the element whose state is asked
java.lang.IllegalArgumentException
- if dockable
is not knowngetSetting(boolean)
public boolean isEntryLayout(java.lang.String id)
id
should be stored
for entry
Setting
s.
id
- the identifier of an element whose state is requested
java.lang.IllegalArgumentException
- if id
is not knowngetSetting(boolean)
public void show(Dockable dockable)
dockable
is child of a root known to this
frontend.
dockable
- the element which should be made visible
java.lang.IllegalStateException
- if the default station
is
needed but can't be foundpublic void show(Dockable dockable, boolean cancelable)
dockable
is child of a root known to this
frontend.
dockable
- the element which should be made visiblecancelable
- whether a VetoableDockFrontendListener
can
cancel the operation or not
java.lang.IllegalStateException
- if the default station
is
needed but can't be foundpublic void hide(Dockable dockable)
dockable
invisible. The location of dockable
is saved, and if made visible again, it will reappear at its old location.
dockable
- the element which should be hiddenpublic void hide(Dockable dockable, boolean cancelable)
dockable
invisible. The location of dockable
is saved, and if made visible again, it will reappear at its old location.
dockable
- the element which should be hiddencancelable
- whether a VetoableDockFrontendListener
can cancel
the operation or notpublic void save()
current setting
.
java.lang.IllegalStateException
- if the name of the current setting is null
public void save(java.lang.String name)
name
- the name for the settingpublic void load(java.lang.String name)
name
- the name of the setting
java.lang.IllegalArgumentException
- if no setting name
could be foundpublic Setting getSetting(boolean entry)
Setting
which describes the current set of
properties of this frontend. The setting contains information about
the location of each Dockable
.
entry
- true
if only the information for an ordinary
entry should be stored, false
if the setting should contain
as much information as possible.
createSetting()
public void setSetting(Setting setting, boolean entry)
setting
.empty infos
if it finds
information for a non existing, non empty Dockable
but whose
key passes the methods of MissingDockableStrategy
.
setting
- a new set of propertiesentry
- true
if only information for an ordinary
entry should be extracted, false
if as much information
as possible should be extracted. The value of this argument should
be the same as was used when getSetting(boolean)
was called.public Perspective getPerspective(boolean entry)
Perspective
which can be used to read, write and convert
PerspectiveElement
s. This method creates a new DefaultFrontendPerspectiveCache
.DefaultFrontendPerspectiveCache
to learn
about the drawbacks of using that class.
entry
- Whether the perspective should act as if loading or storing an "normal setting". A normal setting
is a setting created by save(String)
or by save()
.
null
getPerspective(boolean, FrontendPerspectiveCache)
public Perspective getPerspective(boolean entry, FrontendPerspectiveCache factory)
Perspective
which can be used to read, write and convert
PerspectiveElement
s. The new perspective will be set up with the factories known to this
frontend and with the entries from elements
.DockFrontend
. Clients can use a Setting
to access layout information.
entry
- Whether the perspective should act as if loading or storing an "normal setting". A normal setting
is a setting created by save(String)
or by save()
.factory
- a factory that will be used to translate DockElement
s to PerspectiveElement
s
null
getSetting(boolean)
,
getSetting(String)
,
setSetting(Setting, boolean)
,
setSetting(String, Setting)
public java.util.Set<Dockable> listShownDockables()
Dockable
which are known to this frontend
and which are visible.
public java.util.List<Dockable> listDockables()
Dockable
s which are registered at this
frontend.
public java.util.List<FrontendEntry> listFrontendEntries()
Dockable
that is or might be registered at this frontend.
public FrontendEntry getFrontendEntry(java.lang.String key)
Dockable
with
name key
.
key
- some key of a dockable
null
if nothing is availableprotected void clean(DockSituationIgnore ignore)
ignore
.
ignore
- a filter, never null
protected void clean(DockStation station, DockSituationIgnore ignore)
station
, but only
if the children are not filtered by ignore
.
station
- a station to cleanignore
- a filterpublic boolean delete(java.lang.String name)
name
.
name
- the name of the setting to delete
true
if the setting was deleted, false
if the setting was unknown anyway.public void write(java.io.DataOutputStream out) throws java.io.IOException
out
.
out
- the stream to write into
java.io.IOException
- if there are any problemsprotected void write(Setting setting, boolean entry, java.io.DataOutputStream out) throws java.io.IOException
Setting.write(DockSituation, PropertyTransformer, boolean, DataOutputStream)
setting
- the setting which will be writtenentry
- whether setting
is an ordinary entry, or
the finall setting that contains more data.out
- the stream to write into
java.io.IOException
- if an I/O-error occurspublic void read(java.io.DataInputStream in) throws java.io.IOException
in
. The layout
will be changed according to the contents that are read.
in
- the stream to read from
java.io.IOException
- if there are any problemsprotected Setting read(boolean entry, java.io.DataInputStream in) throws java.io.IOException
createSetting()
and then
Setting.read(DockSituation, PropertyTransformer, boolean, DataInputStream)
.
entry
- whether the set of properties is used as ordinary entry,
or contains more data than usuall.in
- the stream to read from
java.io.IOException
- if an I/O-error occurscreateSetting()
public void writeXML(XElement element)
element
- the element to write into, this method will not
change the attributes of element
protected void writeXML(Setting setting, boolean entry, XElement element)
Setting.writeXML(DockSituation, PropertyTransformer, boolean, XElement)
.
setting
- the setting to writeentry
- whether setting
is an ordinary entry, or
the finall setting that contains more data.element
- the xml element to write into, this method does not
change the attributes of the entrypublic void readXML(XElement element)
element
- the element to readprotected Setting readXML(boolean entry, XElement element)
createSetting()
and then
Setting.readXML(DockSituation, PropertyTransformer, boolean, XElement)
.
entry
- whether the set of properties is used as ordinary entry,
or contains more data than usuall.element
- the xml element containg the data for the new setting
createSetting()
protected DockFrontend.Hider createHider()
protected Setting createSetting()
public DockFrontend.Hider getHider()
protected DockFrontendListener[] listeners()
protected void fireAllHidden(Dockable dockable, java.util.Set<Dockable> processed)
DockFrontendListener.hidden(DockFrontend, Dockable)
on all listeners for dockable
and all its children.
dockable
- the hidden elementprocessed
- Set of Dockable
s for which the event is already fired,
will be modified by this method, can be null
protected void fireHidden(Dockable dockable)
DockFrontendListener.hidden(DockFrontend, Dockable)
on all listeners.
dockable
- the hidden elementprotected void fireAdded(Dockable dockable)
DockFrontendListener.added(DockFrontend, Dockable)
on all listeners.
dockable
- the added elementprotected void fireHideable(Dockable dockable, boolean value)
DockFrontendListener.hideable(DockFrontend, Dockable, boolean)
on all listeners.
dockable
- the element whose state changedvalue
- the new stateprotected void fireRemoved(Dockable dockable)
DockFrontendListener.removed(DockFrontend, Dockable)
on all listeners.
dockable
- the removed elementprotected void fireAllShown(Dockable dockable, java.util.Set<Dockable> processed)
DockFrontendListener.shown(DockFrontend, Dockable)
on all listeners for dockable
and all its children.
dockable
- the shown elementprocessed
- Set of Dockable
s whose event is already fired,
will be modified by this method, can be null
protected void fireShown(Dockable dockable)
DockFrontendListener.shown(DockFrontend, Dockable)
on all listeners.
dockable
- the shown elementprotected void fireSaved(java.lang.String name)
DockFrontendListener.saved(DockFrontend, String)
on all listeners.
name
- the name of the saved settingprotected void fireLoaded(java.lang.String name)
DockFrontendListener.loaded(DockFrontend, String)
on all listeners.
name
- the name of the loaded settingprotected void fireRead(java.lang.String name)
DockFrontendListener.read(DockFrontend, String)
on all listeners.
name
- the name of the read settingprotected void fireDeleted(java.lang.String name)
DockFrontendListener.deleted(DockFrontend, String)
on all listeners.
name
- the name of the deleted setting
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |