bibliothek.gui.dock.common.intern
Interface MutableCControlRegister

All Superinterfaces:
CControlRegister
All Known Implementing Classes:
DefaultCControlRegister

public interface MutableCControlRegister
extends CControlRegister

A CControlRegister whose contents can be changed.

Author:
Benjamin Sigg

Method Summary
 void addContentArea(CContentArea area)
          Adds a new content area to this register.
 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.
 CommonSingleDockableFactory getBackupFactory()
          Gets the backup factory for missing SingleCDockables.
 CommonMultipleDockableFactory getCommonMultipleDockableFactory(String id)
          Gets the factory with identifier id.
 List<CContentArea> getContentAreas()
          Gets an unmodifiable list of all CContentAreas known to this register.
 CContentArea getDefaultContentArea()
          Gets the default content area.
 SingleCDockable getSingleDockable(String id)
          Searches the one SingleCDockable whose unique id equals id.
 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).
 String multiToNormalId(String id)
          Undoes the changes of toMultiId(String).
 void putCommonMultipleDockableFactory(String id, CommonMultipleDockableFactory factory)
          Adds factory to this register.
 CommonMultipleDockableFactory removeCommonMultipleDockableFactory(String id)
          Removes the CommonMultipleDockableFactory with identifier id rom this register.
 boolean removeContentArea(CContentArea area)
          Removes area from 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.
 void setDefaultContentArea(CContentArea area)
          Sets the default content area.
 String singleToNormalId(String id)
          Undoes the changes of toSingleId(String).
 String toMultiId(String id)
          Transforms an identifier to an identifier for a MultipleCDockable.
 String toSingleId(String id)
          Transforms an identifier to an identifier for a SingleCDockable.
 
Methods inherited from interface bibliothek.gui.dock.common.CControlRegister
getControl, getDockable, getDockableCount, getDockables, getFactories, getFactory, getMultipleDockables, getSingleDockables, getStations, listDockablesInMode, listMultipleDockableFactories, listMultipleDockables, listSingleBackupFactories, listSingleDockables
 

Method Detail

getContentAreas

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

Returns:
the unmodifiable list

addContentArea

void addContentArea(CContentArea area)
Adds a new content area to this register.

Parameters:
area - the new area
Throws:
IllegalArgumentException - if area is already known to this register
NullPointerException - if area is null

removeContentArea

boolean removeContentArea(CContentArea area)
Removes area from this register

Parameters:
area - the area to remove
Returns:
true if area was known to this register before, false if area could not be removed because it was not in the list

getDefaultContentArea

CContentArea getDefaultContentArea()
Gets the default content area.

Returns:
the area, can be null

setDefaultContentArea

void setDefaultContentArea(CContentArea area)
Sets the default content area.

Parameters:
area - the new area

addStation

void addStation(CStation<?> station)
Adds station to this register.

Parameters:
station - the new station

removeStation

boolean removeStation(CStation<?> station)
Removes station from this register.

Parameters:
station - the station to remove
Returns:
true if station was removed, false otherwise

getBackupFactory

CommonSingleDockableFactory getBackupFactory()
Gets the backup factory for missing SingleCDockables.

Returns:
the factory, never null

addSingleDockable

void addSingleDockable(SingleCDockable dockable)
Adds dockable to this register.

Parameters:
dockable - the new element

getSingleDockable

SingleCDockable getSingleDockable(String id)
Searches the one SingleCDockable whose unique id equals id.

Parameters:
id - some id to search
Returns:
a dockable with the same id

addMultipleDockable

void addMultipleDockable(MultipleCDockable dockable)
Adds dockable to this register.

Parameters:
dockable - the new element

putCommonMultipleDockableFactory

void putCommonMultipleDockableFactory(String id,
                                      CommonMultipleDockableFactory factory)
Adds factory to this register.

Parameters:
id - the id for the factory
factory - the new factory

getCommonMultipleDockableFactory

CommonMultipleDockableFactory getCommonMultipleDockableFactory(String id)
Gets the factory with identifier id.

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

removeCommonMultipleDockableFactory

CommonMultipleDockableFactory removeCommonMultipleDockableFactory(String id)
Removes the CommonMultipleDockableFactory with identifier id rom this register.

Parameters:
id - the identifier of the factory
Returns:
the factory that was removed or null

removeSingleDockable

boolean removeSingleDockable(SingleCDockable dockable)
Removes dockable from this register.

Parameters:
dockable - the element to remove
Returns:
true if dockable was removed, false if not

removeMultipleDockable

boolean removeMultipleDockable(MultipleCDockable dockable)
Removes dockable from this register.

Parameters:
dockable - the element to remove
Returns:
true if dockable was removed, false if not

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