public class DefaultCControlRegister extends java.lang.Object implements MutableCControlRegister
CControlRegister
.Constructor and Description |
---|
DefaultCControlRegister(CControl control)
Creates a new register
|
Modifier and Type | Method and Description |
---|---|
void |
addMultipleDockable(MultipleCDockable dockable)
Adds
dockable to this register. |
void |
addSingleDockable(SingleCDockable dockable)
Adds
dockable to this register. |
void |
addStation(CStation<?> station)
Adds
station to this register. |
void |
addStationContainer(CStationContainer container)
Adds a new set of
CStation s to this register. |
CommonSingleDockableFactory |
getBackupFactory()
Gets the backup factory for missing
SingleCDockable s. |
CommonMultipleDockableFactory |
getCommonMultipleDockableFactory(java.lang.String id)
Gets the factory with identifier
id . |
CStationContainer |
getContainer(CStation<?> child)
Searches the
CStationContainer which contains child . |
CControl |
getControl()
Gets the control for which this register is used.
|
CContentArea |
getDefaultContentArea()
Gets the default set of
CStation s. |
CDockable |
getDockable(int index)
Gets the index'th dockable that is registered
|
int |
getDockableCount()
Gets the number of
CDockable s that are registered. |
java.util.List<CDockable> |
getDockables()
Gets an unmodifiable list of all
CDockable s which are known to
this register. |
java.util.Map<java.lang.String,MultipleCDockableFactory<?,?>> |
getFactories()
Gets an unmodifiable map of all
MultipleCDockableFactory s that
are known to this register. |
MultipleCDockableFactory<?,?> |
getFactory(java.lang.String id)
Searches the factory with identifier
id . |
java.util.List<MultipleCDockable> |
getMultipleDockables()
Gets an unmodifiable list of all
MultipleCDockable s which are known to
this register. |
SingleCDockable |
getSingleDockable(java.lang.String id)
Searches the one
SingleCDockable whose unique id equals id . |
java.util.List<SingleCDockable> |
getSingleDockables()
Gets an unmodifiable list of all
SingleCDockable s which are known to
this register. |
java.util.List<CStationContainer> |
getStationContainers()
Gets an unmodifiable list of all
CStationContainer s known
to this register. |
java.util.List<CStation<?>> |
getStations()
Gets an unmodifiable list of all
CStation s which are known to
this register. |
boolean |
isMultiId(java.lang.String id)
Checks whether
id could be created by CControlRegister.toMultiId(String) . |
boolean |
isSingleId(java.lang.String id)
Checks whether
id could be created by CControlRegister.toSingleId(String) . |
java.util.List<CDockable> |
listDockablesInMode(ExtendedMode mode)
Gets a list of all visible
CDockable s in the given mode. |
java.util.Set<java.lang.String> |
listMultipleDockableFactories()
Gets a list of identifiers of all
MultipleCDockableFactory s
which are currently registered at this control. |
java.util.List<MultipleCDockable> |
listMultipleDockables(MultipleCDockableFactory<?,?> factory)
Gets a list of all
MultipleCDockable s that are registered at this
control and whose MultipleCDockable.getFactory() method returns
factory . |
java.util.Set<java.lang.String> |
listSingleBackupFactories()
Gets a list of keys for all
SingleCDockableFactory s which
are currently registered at this control. |
java.util.Set<java.lang.String> |
listSingleDockables()
Gets a list of all identifiers of
SingleCDockable for which
this control has location information within the current setting . |
java.lang.String |
multiToNormalId(java.lang.String id)
Undoes the changes of
CControlRegister.toMultiId(String) . |
void |
putCommonMultipleDockableFactory(java.lang.String id,
CommonMultipleDockableFactory factory)
Adds
factory to this register. |
CommonMultipleDockableFactory |
removeCommonMultipleDockableFactory(java.lang.String id)
Removes the
CommonMultipleDockableFactory with identifier id
rom this register. |
boolean |
removeMultipleDockable(MultipleCDockable dockable)
Removes
dockable from this register. |
boolean |
removeSingleDockable(SingleCDockable dockable)
Removes
dockable from this register. |
boolean |
removeStation(CStation<?> station)
Removes
station from this register. |
boolean |
removeStationContainer(CStationContainer container)
Removes
container from this registry. |
void |
setDefaultContentArea(CContentArea container)
Sets the default set of
CStation s. |
java.lang.String |
singleToNormalId(java.lang.String id)
Undoes the changes of
CControlRegister.toSingleId(String) . |
java.lang.String |
toMultiId(java.lang.String id)
Transforms an identifier to an identifier for a
MultipleCDockable .Note that this method must never create an identifier that passes CControlRegister.isSingleId(String) . |
java.lang.String |
toSingleId(java.lang.String id)
Transforms an identifier to an identifier for a
SingleCDockable .Note that this method must never create an identifier that passes CControlRegister.isMultiId(String) . |
public DefaultCControlRegister(CControl control)
control
- the owner of this registerpublic CControl getControl()
CControlRegister
getControl
in interface CControlRegister
public java.util.List<CDockable> getDockables()
CControlRegister
CDockable
s which are known to
this register. The list might or might not be updated when the contents
of this register changes.getDockables
in interface CControlRegister
public java.util.List<MultipleCDockable> getMultipleDockables()
CControlRegister
MultipleCDockable
s which are known to
this register. The list might or might not be updated when the contents
of this register change.getMultipleDockables
in interface CControlRegister
public java.util.List<SingleCDockable> getSingleDockables()
CControlRegister
SingleCDockable
s which are known to
this register. The list might or might not be updated when the contents
of this register changes.getSingleDockables
in interface CControlRegister
public java.util.List<CStation<?>> getStations()
CControlRegister
CStation
s which are known to
this register. The list might or might not be updated when the content
of this register changes.getStations
in interface CControlRegister
public java.util.List<CStationContainer> getStationContainers()
CControlRegister
CStationContainer
s known
to this register. The list might or might not be updated when the contents
of this register change.getStationContainers
in interface CControlRegister
public CStationContainer getContainer(CStation<?> child)
CControlRegister
CStationContainer
which contains child
.getContainer
in interface CControlRegister
child
- the child whose parent is searchedchild
or null
public void addStationContainer(CStationContainer container)
MutableCControlRegister
CStation
s to this register.addStationContainer
in interface MutableCControlRegister
container
- the new set of stations, not null
public java.util.Set<java.lang.String> listSingleBackupFactories()
SingleCDockableFactory
s which
are currently registered at this control.listSingleBackupFactories
in interface CControlRegister
public java.util.Set<java.lang.String> listMultipleDockableFactories()
MultipleCDockableFactory
s
which are currently registered at this control.listMultipleDockableFactories
in interface CControlRegister
public java.util.List<MultipleCDockable> listMultipleDockables(MultipleCDockableFactory<?,?> factory)
MultipleCDockable
s that are registered at this
control and whose MultipleCDockable.getFactory()
method returns
factory
.listMultipleDockables
in interface CControlRegister
factory
- the factory to look out fornull
but might be emptypublic java.util.List<CDockable> listDockablesInMode(ExtendedMode mode)
CDockable
s in the given mode.listDockablesInMode
in interface CControlRegister
mode
- the mode which each CDockable
must haveCDockable
spublic java.util.Set<java.lang.String> listSingleDockables()
SingleCDockable
for which
this control has location information within the current setting
.listSingleDockables
in interface CControlRegister
null
public java.lang.String toSingleId(java.lang.String id)
CControlRegister
SingleCDockable
.CControlRegister.isMultiId(String)
.toSingleId
in interface CControlRegister
id
- some identifierSingleCDockable
public boolean isSingleId(java.lang.String id)
CControlRegister
id
could be created by CControlRegister.toSingleId(String)
.isSingleId
in interface CControlRegister
id
- the id to checktrue
if there is an input for CControlRegister.toSingleId(String)
that would result in id
public java.lang.String singleToNormalId(java.lang.String id)
CControlRegister
CControlRegister.toSingleId(String)
. It must be true
that singleToNormalId( toSingleId( id )) = id
. The behavior
of this method is unspecified if CControlRegister.isSingleId(String)
returns
false
for id
.singleToNormalId
in interface CControlRegister
id
- some id create by CControlRegister.toSingleId(String)
.public java.lang.String toMultiId(java.lang.String id)
CControlRegister
MultipleCDockable
.CControlRegister.isSingleId(String)
.toMultiId
in interface CControlRegister
id
- some identifierMultipleCDockable
public boolean isMultiId(java.lang.String id)
CControlRegister
id
could be created by CControlRegister.toMultiId(String)
.isMultiId
in interface CControlRegister
id
- the id to checktrue
if there is an input for CControlRegister.toMultiId(String)
that would result in id
public java.lang.String multiToNormalId(java.lang.String id)
CControlRegister
CControlRegister.toMultiId(String)
. It must be true
that multiToNormalId( toMultiId( id )) = id
. The behavior
of this method is unspecified if CControlRegister.isMultiId(String)
returns
false
for id
.multiToNormalId
in interface CControlRegister
id
- some id create by CControlRegister.toMultiId(String)
.public void addMultipleDockable(MultipleCDockable dockable)
MutableCControlRegister
dockable
to this register.addMultipleDockable
in interface MutableCControlRegister
dockable
- the new elementpublic void addSingleDockable(SingleCDockable dockable)
MutableCControlRegister
dockable
to this register.addSingleDockable
in interface MutableCControlRegister
dockable
- the new elementpublic SingleCDockable getSingleDockable(java.lang.String id)
MutableCControlRegister
SingleCDockable
whose unique id equals id
.getSingleDockable
in interface MutableCControlRegister
id
- some id to searchpublic void addStation(CStation<?> station)
MutableCControlRegister
station
to this register.addStation
in interface MutableCControlRegister
station
- the new stationpublic CommonSingleDockableFactory getBackupFactory()
MutableCControlRegister
SingleCDockable
s.getBackupFactory
in interface MutableCControlRegister
null
public CommonMultipleDockableFactory getCommonMultipleDockableFactory(java.lang.String id)
MutableCControlRegister
id
.getCommonMultipleDockableFactory
in interface MutableCControlRegister
id
- the id of the factorynull
public CContentArea getDefaultContentArea()
MutableCControlRegister
CStation
s.getDefaultContentArea
in interface MutableCControlRegister
null
public void putCommonMultipleDockableFactory(java.lang.String id, CommonMultipleDockableFactory factory)
MutableCControlRegister
factory
to this register.putCommonMultipleDockableFactory
in interface MutableCControlRegister
id
- the id for the factoryfactory
- the new factorypublic CommonMultipleDockableFactory removeCommonMultipleDockableFactory(java.lang.String id)
MutableCControlRegister
CommonMultipleDockableFactory
with identifier id
rom this register.removeCommonMultipleDockableFactory
in interface MutableCControlRegister
id
- the identifier of the factorynull
public boolean removeStationContainer(CStationContainer container)
MutableCControlRegister
container
from this registry.removeStationContainer
in interface MutableCControlRegister
container
- the container to removetrue
if container
was known to this registry and
was removed, false
otherwisepublic boolean removeMultipleDockable(MultipleCDockable dockable)
MutableCControlRegister
dockable
from this register.removeMultipleDockable
in interface MutableCControlRegister
dockable
- the element to removetrue
if dockable
was removed,
false
if notpublic boolean removeSingleDockable(SingleCDockable dockable)
MutableCControlRegister
dockable
from this register.removeSingleDockable
in interface MutableCControlRegister
dockable
- the element to removetrue
if dockable
was removed,
false
if notpublic boolean removeStation(CStation<?> station)
MutableCControlRegister
station
from this register.removeStation
in interface MutableCControlRegister
station
- the station to removetrue
if station
was removed, false
otherwisepublic void setDefaultContentArea(CContentArea container)
MutableCControlRegister
CStation
s. One of this CStation
s will be used
to show new CDockable
s if they do not have a location set.setDefaultContentArea
in interface MutableCControlRegister
container
- the new containerpublic CDockable getDockable(int index)
CControlRegister
getDockable
in interface CControlRegister
index
- the index of the elementpublic int getDockableCount()
CControlRegister
CDockable
s that are registered.getDockableCount
in interface CControlRegister
public java.util.Map<java.lang.String,MultipleCDockableFactory<?,?>> getFactories()
CControlRegister
MultipleCDockableFactory
s that
are known to this register. The map may or may not be updated when the
content of this register changes.getFactories
in interface CControlRegister
public MultipleCDockableFactory<?,?> getFactory(java.lang.String id)
CControlRegister
id
.getFactory
in interface CControlRegister
id
- the id of the factorynull