bibliothek.gui.dock.station.support
Class RootPlaceholderStrategy

java.lang.Object
  extended by bibliothek.gui.dock.station.support.RootPlaceholderStrategy
All Implemented Interfaces:
PlaceholderStrategy

public class RootPlaceholderStrategy
extends Object
implements PlaceholderStrategy

A PlaceholderStrategy that wraps around another strategy or around no strategy at all.

Author:
Benjamin Sigg

Field Summary
 
Fields inherited from interface bibliothek.gui.dock.station.support.PlaceholderStrategy
PLACEHOLDER_STRATEGY
 
Constructor Summary
RootPlaceholderStrategy(DockStation station)
          Creates a new strategy.
 
Method Summary
 void addListener(PlaceholderStrategyListener listener)
          Adds a listener to this strategy.
 Path getPlaceholderFor(Dockable dockable)
          Gets the placeholder which represents dockable.
 PlaceholderStrategy getStrategy()
          Gets the strategy that is the current delegate.
 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 setStrategy(PlaceholderStrategy strategy)
          Sets the delegate of 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

RootPlaceholderStrategy

public RootPlaceholderStrategy(DockStation station)
Creates a new strategy.

Parameters:
station - the station for which this strategy is used
Method Detail

setStrategy

public void setStrategy(PlaceholderStrategy strategy)
Sets the delegate of this strategy.

Parameters:
strategy - the new delegate, can be null

getStrategy

public PlaceholderStrategy getStrategy()
Gets the strategy that is the current delegate.

Returns:
the delegate, can be null

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

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

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

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

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