Class DefaultCControlRegister
java.lang.Object
bibliothek.gui.dock.common.intern.DefaultCControlRegister
- All Implemented Interfaces:
CControlRegister,MutableCControlRegister
Standard implementation of
CControlRegister.- Author:
- Benjamin Sigg
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMultipleDockable(MultipleCDockable dockable) Addsdockableto this register.voidaddSingleDockable(SingleCDockable dockable) Addsdockableto this register.voidaddStation(CStation<?> station) Addsstationto this register.voidaddStationContainer(CStationContainer container) Adds a new set ofCStations to this register.Gets the backup factory for missingSingleCDockables.Gets the factory with identifierid.getContainer(CStation<?> child) Searches theCStationContainerwhich containschild.Gets the control for which this register is used.Gets the default set ofCStations.getDockable(int index) Gets the index'th dockable that is registeredintGets the number ofCDockables that are registered.Gets an unmodifiable list of allCDockables which are known to this register.Gets an unmodifiable map of allMultipleCDockableFactorys that are known to this register.getFactory(String id) Searches the factory with identifierid.Gets an unmodifiable list of allMultipleCDockables which are known to this register.Searches the oneSingleCDockablewhose unique id equalsid.Gets an unmodifiable list of allSingleCDockables which are known to this register.Gets an unmodifiable list of allCStationContainers known to this register.Gets an unmodifiable list of allCStations which are known to this register.booleanChecks whetheridcould be created byCControlRegister.toMultiId(String).booleanisSingleId(String id) Checks whetheridcould be created byCControlRegister.toSingleId(String).Gets a list of all visibleCDockables in the given mode.Gets a list of identifiers of allMultipleCDockableFactorys which are currently registered at this control.listMultipleDockables(MultipleCDockableFactory<?, ?> factory) Gets a list of allMultipleCDockables that are registered at this control and whoseMultipleCDockable.getFactory()method returnsfactory.Gets a list of keys for allSingleCDockableFactorys which are currently registered at this control.Gets a list of all identifiers ofSingleCDockablefor which this control has location information within the currentsetting.Undoes the changes ofCControlRegister.toMultiId(String).voidAddsfactoryto this register.Removes theCommonMultipleDockableFactorywith identifieridrom this register.booleanremoveMultipleDockable(MultipleCDockable dockable) Removesdockablefrom this register.booleanremoveSingleDockable(SingleCDockable dockable) Removesdockablefrom this register.booleanremoveStation(CStation<?> station) Removesstationfrom this register.booleanremoveStationContainer(CStationContainer container) Removescontainerfrom this registry.voidsetDefaultContentArea(CContentArea container) Sets the default set ofCStations.Undoes the changes ofCControlRegister.toSingleId(String).Transforms an identifier to an identifier for aMultipleCDockable.
Note that this method must never create an identifier that passesCControlRegister.isSingleId(String).toSingleId(String id) Transforms an identifier to an identifier for aSingleCDockable.
Note that this method must never create an identifier that passesCControlRegister.isMultiId(String).
-
Constructor Details
-
DefaultCControlRegister
Creates a new register- Parameters:
control- the owner of this register
-
-
Method Details
-
getControl
Description copied from interface:CControlRegisterGets the control for which this register is used.- Specified by:
getControlin interfaceCControlRegister- Returns:
- the control
-
getDockables
Description copied from interface:CControlRegisterGets an unmodifiable list of allCDockables which are known to this register. The list might or might not be updated when the contents of this register changes.- Specified by:
getDockablesin interfaceCControlRegister- Returns:
- an unmodifiable list of elements
-
getMultipleDockables
Description copied from interface:CControlRegisterGets an unmodifiable list of allMultipleCDockables which are known to this register. The list might or might not be updated when the contents of this register change.- Specified by:
getMultipleDockablesin interfaceCControlRegister- Returns:
- an unmodifiable list of elements
-
getSingleDockables
Description copied from interface:CControlRegisterGets an unmodifiable list of allSingleCDockables which are known to this register. The list might or might not be updated when the contents of this register changes.- Specified by:
getSingleDockablesin interfaceCControlRegister- Returns:
- an unmodifiable list of elements
-
getStations
Description copied from interface:CControlRegisterGets an unmodifiable list of allCStations which are known to this register. The list might or might not be updated when the content of this register changes.- Specified by:
getStationsin interfaceCControlRegister- Returns:
- an unmodifiable list of elements
-
getStationContainers
Description copied from interface:CControlRegisterGets an unmodifiable list of allCStationContainers known to this register. The list might or might not be updated when the contents of this register change.- Specified by:
getStationContainersin interfaceCControlRegister- Returns:
- the unmodifiable list
-
getContainer
Description copied from interface:CControlRegisterSearches theCStationContainerwhich containschild.- Specified by:
getContainerin interfaceCControlRegister- Parameters:
child- the child whose parent is searched- Returns:
- the parent of
childornull
-
addStationContainer
Description copied from interface:MutableCControlRegisterAdds a new set ofCStations to this register.- Specified by:
addStationContainerin interfaceMutableCControlRegister- Parameters:
container- the new set of stations, notnull
-
listSingleBackupFactories
Gets a list of keys for allSingleCDockableFactorys which are currently registered at this control.- Specified by:
listSingleBackupFactoriesin interfaceCControlRegister- Returns:
- the list of keys
-
listMultipleDockableFactories
Gets a list of identifiers of allMultipleCDockableFactorys which are currently registered at this control.- Specified by:
listMultipleDockableFactoriesin interfaceCControlRegister- Returns:
- the list of factories
-
listMultipleDockables
Gets a list of allMultipleCDockables that are registered at this control and whoseMultipleCDockable.getFactory()method returnsfactory.- Specified by:
listMultipleDockablesin interfaceCControlRegister- Parameters:
factory- the factory to look out for- Returns:
- the list of dockables, never
nullbut might be empty
-
listDockablesInMode
Gets a list of all visibleCDockables in the given mode.- Specified by:
listDockablesInModein interfaceCControlRegister- Parameters:
mode- the mode which eachCDockablemust have- Returns:
- the list of
CDockables
-
listSingleDockables
Gets a list of all identifiers ofSingleCDockablefor which this control has location information within the currentsetting.- Specified by:
listSingleDockablesin interfaceCControlRegister- Returns:
- the list of ids, never
null
-
toSingleId
Description copied from interface:CControlRegisterTransforms an identifier to an identifier for aSingleCDockable.
Note that this method must never create an identifier that passesCControlRegister.isMultiId(String).- Specified by:
toSingleIdin interfaceCControlRegister- Parameters:
id- some identifier- Returns:
- an identifier marked as being for a
SingleCDockable
-
isSingleId
Description copied from interface:CControlRegisterChecks whetheridcould be created byCControlRegister.toSingleId(String).- Specified by:
isSingleIdin interfaceCControlRegister- Parameters:
id- the id to check- Returns:
trueif there is an input forCControlRegister.toSingleId(String)that would result inid
-
singleToNormalId
Description copied from interface:CControlRegisterUndoes the changes ofCControlRegister.toSingleId(String). It must betruethatsingleToNormalId( toSingleId( id )) = id. The behavior of this method is unspecified ifCControlRegister.isSingleId(String)returnsfalseforid.- Specified by:
singleToNormalIdin interfaceCControlRegister- Parameters:
id- some id create byCControlRegister.toSingleId(String).- Returns:
- the original id
-
toMultiId
Description copied from interface:CControlRegisterTransforms an identifier to an identifier for aMultipleCDockable.
Note that this method must never create an identifier that passesCControlRegister.isSingleId(String).- Specified by:
toMultiIdin interfaceCControlRegister- Parameters:
id- some identifier- Returns:
- an identifier marked as being for a
MultipleCDockable
-
isMultiId
Description copied from interface:CControlRegisterChecks whetheridcould be created byCControlRegister.toMultiId(String).- Specified by:
isMultiIdin interfaceCControlRegister- Parameters:
id- the id to check- Returns:
trueif there is an input forCControlRegister.toMultiId(String)that would result inid
-
multiToNormalId
Description copied from interface:CControlRegisterUndoes the changes ofCControlRegister.toMultiId(String). It must betruethatmultiToNormalId( toMultiId( id )) = id. The behavior of this method is unspecified ifCControlRegister.isMultiId(String)returnsfalseforid.- Specified by:
multiToNormalIdin interfaceCControlRegister- Parameters:
id- some id create byCControlRegister.toMultiId(String).- Returns:
- the original id
-
addMultipleDockable
Description copied from interface:MutableCControlRegisterAddsdockableto this register.- Specified by:
addMultipleDockablein interfaceMutableCControlRegister- Parameters:
dockable- the new element
-
addSingleDockable
Description copied from interface:MutableCControlRegisterAddsdockableto this register.- Specified by:
addSingleDockablein interfaceMutableCControlRegister- Parameters:
dockable- the new element
-
getSingleDockable
Description copied from interface:MutableCControlRegisterSearches the oneSingleCDockablewhose unique id equalsid.- Specified by:
getSingleDockablein interfaceMutableCControlRegister- Parameters:
id- some id to search- Returns:
- a dockable with the same id
-
addStation
Description copied from interface:MutableCControlRegisterAddsstationto this register.- Specified by:
addStationin interfaceMutableCControlRegister- Parameters:
station- the new station
-
getBackupFactory
Description copied from interface:MutableCControlRegisterGets the backup factory for missingSingleCDockables.- Specified by:
getBackupFactoryin interfaceMutableCControlRegister- Returns:
- the factory, never
null
-
getCommonMultipleDockableFactory
Description copied from interface:MutableCControlRegisterGets the factory with identifierid.- Specified by:
getCommonMultipleDockableFactoryin interfaceMutableCControlRegister- Parameters:
id- the id of the factory- Returns:
- the factory or
null
-
getDefaultContentArea
Description copied from interface:MutableCControlRegisterGets the default set ofCStations.- Specified by:
getDefaultContentAreain interfaceMutableCControlRegister- Returns:
- the container, can be
null
-
putCommonMultipleDockableFactory
Description copied from interface:MutableCControlRegisterAddsfactoryto this register.- Specified by:
putCommonMultipleDockableFactoryin interfaceMutableCControlRegister- Parameters:
id- the id for the factoryfactory- the new factory
-
removeCommonMultipleDockableFactory
Description copied from interface:MutableCControlRegisterRemoves theCommonMultipleDockableFactorywith identifieridrom this register.- Specified by:
removeCommonMultipleDockableFactoryin interfaceMutableCControlRegister- Parameters:
id- the identifier of the factory- Returns:
- the factory that was removed or
null
-
removeStationContainer
Description copied from interface:MutableCControlRegisterRemovescontainerfrom this registry.- Specified by:
removeStationContainerin interfaceMutableCControlRegister- Parameters:
container- the container to remove- Returns:
trueifcontainerwas known to this registry and was removed,falseotherwise
-
removeMultipleDockable
Description copied from interface:MutableCControlRegisterRemovesdockablefrom this register.- Specified by:
removeMultipleDockablein interfaceMutableCControlRegister- Parameters:
dockable- the element to remove- Returns:
trueifdockablewas removed,falseif not
-
removeSingleDockable
Description copied from interface:MutableCControlRegisterRemovesdockablefrom this register.- Specified by:
removeSingleDockablein interfaceMutableCControlRegister- Parameters:
dockable- the element to remove- Returns:
trueifdockablewas removed,falseif not
-
removeStation
Description copied from interface:MutableCControlRegisterRemovesstationfrom this register.- Specified by:
removeStationin interfaceMutableCControlRegister- Parameters:
station- the station to remove- Returns:
trueifstationwas removed,falseotherwise
-
setDefaultContentArea
Description copied from interface:MutableCControlRegisterSets the default set ofCStations. One of thisCStations will be used to show newCDockables if they do not have a location set.- Specified by:
setDefaultContentAreain interfaceMutableCControlRegister- Parameters:
container- the new container
-
getDockable
Description copied from interface:CControlRegisterGets the index'th dockable that is registered- Specified by:
getDockablein interfaceCControlRegister- Parameters:
index- the index of the element- Returns:
- the selected dockable
-
getDockableCount
public int getDockableCount()Description copied from interface:CControlRegisterGets the number ofCDockables that are registered.- Specified by:
getDockableCountin interfaceCControlRegister- Returns:
- the number of dockables
-
getFactories
Description copied from interface:CControlRegisterGets an unmodifiable map of allMultipleCDockableFactorys that are known to this register. The map may or may not be updated when the content of this register changes.- Specified by:
getFactoriesin interfaceCControlRegister- Returns:
- the unmodifiable map of factories
-
getFactory
Description copied from interface:CControlRegisterSearches the factory with identifierid.- Specified by:
getFactoryin interfaceCControlRegister- Parameters:
id- the id of the factory- Returns:
- the factory or
null
-