|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbibliothek.gui.dock.DockSituation
bibliothek.gui.dock.PredefinedDockSituation
public class PredefinedDockSituation
A DockSituation
that does not load or store all DockElements
.
All elements which are registered by put(DockElement)
are stored in an
internal list. On writing, just a unique id is written to the stream.
A DockFactory
is still necessary for these elements, but the factory may
just do nothing.
Nested Class Summary | |
---|---|
private class |
PredefinedDockSituation.PreloadFactory
A factory which uses other factories as delegate. |
Field Summary | |
---|---|
private java.util.Map<DockElement,java.lang.String> |
elementToString
A mapping from a list of elements to their ids |
private PredefinedDockSituation.PreloadFactory |
factory
|
private static java.lang.String |
KNOWN
|
private java.util.Map<java.lang.String,DockElement> |
stringToElement
A mapping from ids to a list of elements which must not be created by a factory |
private static java.lang.String |
UNKNOWN
|
Constructor Summary | |
---|---|
PredefinedDockSituation()
|
Method Summary | |
---|---|
protected DockFactory<? extends DockElement> |
getFactory(java.lang.String id)
Gets the factory which has the given id . |
protected java.lang.String |
getID(DockElement dockable)
Gets the id of the factory which is needed to write (and later read) the element dockable . |
protected java.lang.String |
getID(DockFactory<?> factory)
Gets the id of factory . |
void |
put(DockElement element)
Registers an element at this situation. |
void |
put(java.lang.String key,
DockElement element)
Registers an element at this situation. |
Methods inherited from class bibliothek.gui.dock.DockSituation |
---|
add, getIgnore, ignoreChildren, ignoreElement, read, read, setIgnore, write, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.Map<java.lang.String,DockElement> stringToElement
private java.util.Map<DockElement,java.lang.String> elementToString
private static final java.lang.String KNOWN
private static final java.lang.String UNKNOWN
private final PredefinedDockSituation.PreloadFactory factory
Constructor Detail |
---|
public PredefinedDockSituation()
Method Detail |
---|
public void put(DockElement element)
element
- the elementpublic void put(java.lang.String key, DockElement element)
key
- the key of the elementelement
- the element
java.lang.IllegalArgumentException
- if the key is already usedprotected java.lang.String getID(DockElement dockable)
DockSituation
dockable
.
getID
in class DockSituation
dockable
- the dockable to write
DockSituation.getID(DockFactory)
,
DockSituation.getFactory(String)
protected java.lang.String getID(DockFactory<?> factory)
DockSituation
factory
. The default behavior is just to
return DockFactory.getID()
. Note that this method should be
a bijection to DockSituation.getFactory(String)
.
getID
in class DockSituation
factory
- the factory whose id is needed
protected DockFactory<? extends DockElement> getFactory(java.lang.String id)
DockSituation
id
. Note that this
method should be a bijection to DockSituation.getID(DockFactory)
. The
default behavior compares id
with the
DockSituation.getID(DockFactory)
.
getFactory
in class DockSituation
id
- the name of the factory
null
if no factory has this id
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |