bibliothek.gui.dock.common
Interface CControlRegister

All Known Subinterfaces:
MutableCControlRegister
All Known Implementing Classes:
DefaultCControlRegister

public interface CControlRegister

Grants access to the CDockables and other information that is associated with a CControl.

Author:
Benjamin Sigg

Method Summary
 CStationContainer getContainer(CStation<?> child)
          Searches the CStationContainer which contains child.
 CControl getControl()
          Gets the control for which this register is used.
 CDockable getDockable(int index)
          Gets the index'th dockable that is registered
 int getDockableCount()
          Gets the number of CDockables that are registered.
 List<CDockable> getDockables()
          Gets an unmodifiable list of all CDockables which are known to this register.
 Map<String,MultipleCDockableFactory<?,?>> getFactories()
          Gets an unmodifiable map of all MultipleCDockableFactorys that are known to this register.
 MultipleCDockableFactory<?,?> getFactory(String id)
          Searches the factory with identifier id.
 List<MultipleCDockable> getMultipleDockables()
          Gets an unmodifiable list of all MultipleCDockables which are known to this register.
 List<SingleCDockable> getSingleDockables()
          Gets an unmodifiable list of all SingleCDockables which are known to this register.
 List<CStationContainer> getStationContainers()
          Gets an unmodifiable list of all CStationContainers known to this register.
 List<CStation<?>> getStations()
          Gets an unmodifiable list of all CStations which are known to this register.
 boolean isMultiId(String id)
          Checks whether id could be created by toMultiId(String).
 boolean isSingleId(String id)
          Checks whether id could be created by toSingleId(String).
 List<CDockable> listDockablesInMode(ExtendedMode mode)
          Gets a list of all visible CDockables in the given mode.
 Set<String> listMultipleDockableFactories()
          Gets a list of identifiers of all MultipleCDockableFactorys which are currently registered.
 List<MultipleCDockable> listMultipleDockables(MultipleCDockableFactory<?,?> factory)
          Gets a list of all MultipleCDockables that are registered at this control and whose MultipleCDockable.getFactory() method returns factory.
 Set<String> listSingleBackupFactories()
          Gets a list of keys for all SingleCDockableFactorys which are currently registered.
 Set<String> listSingleDockables()
          Gets a list of all identifiers of SingleCDockable for which the control has location information within the current setting.
 String multiToNormalId(String id)
          Undoes the changes of toMultiId(String).
 String singleToNormalId(String id)
          Undoes the changes of toSingleId(String).
 String toMultiId(String id)
          Transforms an identifier to an identifier for a MultipleCDockable.
Note that this method must never create an identifier that passes isSingleId(String).
 String toSingleId(String id)
          Transforms an identifier to an identifier for a SingleCDockable.
Note that this method must never create an identifier that passes isMultiId(String).
 

Method Detail

getControl

CControl getControl()
Gets the control for which this register is used.

Returns:
the control

getDockableCount

int getDockableCount()
Gets the number of CDockables that are registered.

Returns:
the number of dockables

getDockable

CDockable getDockable(int index)
Gets the index'th dockable that is registered

Parameters:
index - the index of the element
Returns:
the selected dockable

getDockables

List<CDockable> getDockables()
Gets an unmodifiable list of all CDockables which are known to this register. The list might or might not be updated when the contents of this register changes.

Returns:
an unmodifiable list of elements

getSingleDockables

List<SingleCDockable> getSingleDockables()
Gets an unmodifiable list of all SingleCDockables which are known to this register. The list might or might not be updated when the contents of this register changes.

Returns:
an unmodifiable list of elements

getMultipleDockables

List<MultipleCDockable> getMultipleDockables()
Gets an unmodifiable list of all MultipleCDockables which are known to this register. The list might or might not be updated when the contents of this register change.

Returns:
an unmodifiable list of elements

getStations

List<CStation<?>> getStations()
Gets an unmodifiable list of all CStations which are known to this register. The list might or might not be updated when the content of this register changes.

Returns:
an unmodifiable list of elements

getFactories

Map<String,MultipleCDockableFactory<?,?>> getFactories()
Gets an unmodifiable map of all MultipleCDockableFactorys that are known to this register. The map may or may not be updated when the content of this register changes.

Returns:
the unmodifiable map of factories

getFactory

MultipleCDockableFactory<?,?> getFactory(String id)
Searches the factory with identifier id.

Parameters:
id - the id of the factory
Returns:
the factory or null

listSingleBackupFactories

Set<String> listSingleBackupFactories()
Gets a list of keys for all SingleCDockableFactorys which are currently registered.

Returns:
the list of keys

listMultipleDockableFactories

Set<String> listMultipleDockableFactories()
Gets a list of identifiers of all MultipleCDockableFactorys which are currently registered.

Returns:
the list of factories

listMultipleDockables

List<MultipleCDockable> listMultipleDockables(MultipleCDockableFactory<?,?> factory)
Gets a list of all MultipleCDockables that are registered at this control and whose MultipleCDockable.getFactory() method returns factory.

Parameters:
factory - the factory to look out for
Returns:
the list of dockables, never null but might be empty

listDockablesInMode

List<CDockable> listDockablesInMode(ExtendedMode mode)
Gets a list of all visible CDockables in the given mode.

Parameters:
mode - the mode which each CDockable must have
Returns:
the list of CDockables

listSingleDockables

Set<String> listSingleDockables()
Gets a list of all identifiers of SingleCDockable for which the control has location information within the current setting.

Returns:
the list of ids, never null

getStationContainers

List<CStationContainer> getStationContainers()
Gets an unmodifiable list of all CStationContainers known to this register. The list might or might not be updated when the contents of this register change.

Returns:
the unmodifiable list

getContainer

CStationContainer getContainer(CStation<?> child)
Searches the CStationContainer which contains child.

Parameters:
child - the child whose parent is searched
Returns:
the parent of child or null

toSingleId

String toSingleId(String id)
Transforms an identifier to an identifier for a SingleCDockable.
Note that this method must never create an identifier that passes isMultiId(String).

Parameters:
id - some identifier
Returns:
an identifier marked as being for a SingleCDockable

isSingleId

boolean isSingleId(String id)
Checks whether id could be created by toSingleId(String).

Parameters:
id - the id to check
Returns:
true if there is an input for toSingleId(String) that would result in id

singleToNormalId

String singleToNormalId(String id)
Undoes the changes of toSingleId(String). It must be true that singleToNormalId( toSingleId( id )) = id. The behavior of this method is unspecified if isSingleId(String) returns false for id.

Parameters:
id - some id create by toSingleId(String).
Returns:
the original id

toMultiId

String toMultiId(String id)
Transforms an identifier to an identifier for a MultipleCDockable.
Note that this method must never create an identifier that passes isSingleId(String).

Parameters:
id - some identifier
Returns:
an identifier marked as being for a MultipleCDockable

isMultiId

boolean isMultiId(String id)
Checks whether id could be created by toMultiId(String).

Parameters:
id - the id to check
Returns:
true if there is an input for toMultiId(String) that would result in id

multiToNormalId

String multiToNormalId(String id)
Undoes the changes of toMultiId(String). It must be true that multiToNormalId( toMultiId( id )) = id. The behavior of this method is unspecified if isMultiId(String) returns false for id.

Parameters:
id - some id create by toMultiId(String).
Returns:
the original id