bibliothek.gui.dock.common.intern
Class CPlaceholderStrategy

java.lang.Object
  extended by bibliothek.gui.dock.common.intern.CPlaceholderStrategy
All Implemented Interfaces:
PlaceholderStrategy

public class CPlaceholderStrategy
extends Object
implements PlaceholderStrategy

This strategy assigns a unique identifier to all CDockables that are registered at a CControl.

Author:
Benjamin Sigg

Field Summary
 
Fields inherited from interface bibliothek.gui.dock.station.support.PlaceholderStrategy
PLACEHOLDER_STRATEGY
 
Constructor Summary
CPlaceholderStrategy(CControl control)
          Creates a new strategy
 
Method Summary
 void addListener(PlaceholderStrategyListener listener)
          Adds a listener to this strategy.
protected  void fireInvalidated(Path placeholder)
           
static Path getMultipleDockablePlaceholder(String id)
          Gets the placeholder that is used for the MultipleCDockable with unique identifier id.
 Path getPlaceholderFor(Dockable dockable)
          Gets the placeholder which represents dockable.
static Path getSingleDockablePlaceholder(String id)
          Gets the placeholder that is used for the SingleCDockable with unique identifier id.
 void install(DockStation station)
          Informs this strategy that it will from no one be used by station.
 boolean isValidPlaceholder(Path placeholder)
          Tells whether placeholder is associated with any Dockable.
 void removeListener(PlaceholderStrategyListener listener)
          Removes a listener from this strategy.
 void uninstall(DockStation station)
          Informs this strategy that it will no longer be used for station.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CPlaceholderStrategy

public CPlaceholderStrategy(CControl control)
Creates a new strategy

Parameters:
control - the control in whose realm this strategy operates
Method Detail

getSingleDockablePlaceholder

public static Path getSingleDockablePlaceholder(String id)
Gets the placeholder that is used for the SingleCDockable with unique identifier id.

Parameters:
id - the unique identifer of a SingleCDockable
Returns:
the placeholder for that dockable

getMultipleDockablePlaceholder

public static Path getMultipleDockablePlaceholder(String id)
Gets the placeholder that is used for the MultipleCDockable with unique identifier id.

Parameters:
id - the unique identifer of a MultipleCDockable
Returns:
the placeholder for that dockable

addListener

public void addListener(PlaceholderStrategyListener listener)
Description copied from interface: PlaceholderStrategy
Adds a listener to this strategy.

Specified by:
addListener in interface PlaceholderStrategy
Parameters:
listener - the new listener, not null

removeListener

public void removeListener(PlaceholderStrategyListener listener)
Description copied from interface: PlaceholderStrategy
Removes a listener from this strategy.

Specified by:
removeListener in interface PlaceholderStrategy
Parameters:
listener - the listener to remove

fireInvalidated

protected void fireInvalidated(Path placeholder)

getPlaceholderFor

public Path getPlaceholderFor(Dockable dockable)
Description copied from interface: PlaceholderStrategy
Gets the placeholder which represents dockable.

Specified by:
getPlaceholderFor in interface PlaceholderStrategy
Parameters:
dockable - some child of station
Returns:
the placeholder id or null

isValidPlaceholder

public boolean isValidPlaceholder(Path placeholder)
Description copied from interface: PlaceholderStrategy
Tells whether placeholder is associated with any Dockable.

Specified by:
isValidPlaceholder in interface PlaceholderStrategy
Parameters:
placeholder - the placeholder in question
Returns:
true if placeholder is still in use

install

public void install(DockStation station)
Description copied from interface: PlaceholderStrategy
Informs this strategy that it will from no one be used by station.

Specified by:
install in interface PlaceholderStrategy
Parameters:
station - the station which uses this strategy

uninstall

public void uninstall(DockStation station)
Description copied from interface: PlaceholderStrategy
Informs this strategy that it will no longer be used for station.

Specified by:
uninstall in interface PlaceholderStrategy
Parameters:
station - the station that is removed