bibliothek.gui.dock.station.support
Class PlaceholderListMapping

java.lang.Object
  extended by bibliothek.gui.dock.station.support.PlaceholderListMapping
All Implemented Interfaces:
PlaceholderMapping

public abstract class PlaceholderListMapping
extends Object
implements PlaceholderMapping

A generic PlaceholderMapping that operates by accessing a PlaceholderList.

Author:
Benjamin Sigg

Constructor Summary
PlaceholderListMapping(DockStation station, DockablePlaceholderList<?> placeholders)
          Creates a new PlaceholderListMapping.
 
Method Summary
 void addPlaceholder(Dockable dockable, Path placeholder)
          First searches the location of dockable, then adds placeholder to that location.
 Dockable getDockableAt(Path placeholder)
          Searches for the placeholder placeholder and gets the Dockable that is currently sitting at the location described by placeholder.
 DockStation getStation()
          Gets the DockStation which created this mapping in its DockStation.getPlaceholderMapping().
 boolean hasPlaceholder(Path placeholder)
          Tells whether the station has any reference to placeholder.
 void removePlaceholder(Path placeholder)
          Removes all occurrences of placeholder from this station.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface bibliothek.gui.dock.station.PlaceholderMapping
getLocationAt
 

Constructor Detail

PlaceholderListMapping

public PlaceholderListMapping(DockStation station,
                              DockablePlaceholderList<?> placeholders)
Creates a new PlaceholderListMapping. This constructor should not be called by clients directly, instead they should call DockStation.getPlaceholderMapping()

Parameters:
station - the station that created and owns this mapping
placeholders - the placeholders that are used by station
Method Detail

getStation

public DockStation getStation()
Description copied from interface: PlaceholderMapping
Gets the DockStation which created this mapping in its DockStation.getPlaceholderMapping().

Specified by:
getStation in interface PlaceholderMapping
Returns:
the creator and owner of this mapping

addPlaceholder

public void addPlaceholder(Dockable dockable,
                           Path placeholder)
Description copied from interface: PlaceholderMapping
First searches the location of dockable, then adds placeholder to that location. If another dockable is dropped on this station, and that item is associated with placeholder, then it will be put at the same position as dockable. This method will remove placeholder from any other position on the station.

Specified by:
addPlaceholder in interface PlaceholderMapping
Parameters:
dockable - a child of this station, must not be null
placeholder - the placeholder to add, must not be null

removePlaceholder

public void removePlaceholder(Path placeholder)
Description copied from interface: PlaceholderMapping
Removes all occurrences of placeholder from this station.

Specified by:
removePlaceholder in interface PlaceholderMapping
Parameters:
placeholder - the placeholder to remove, must not be null

hasPlaceholder

public boolean hasPlaceholder(Path placeholder)
Description copied from interface: PlaceholderMapping
Tells whether the station has any reference to placeholder.

Specified by:
hasPlaceholder in interface PlaceholderMapping
Parameters:
placeholder - the placeholder to search
Returns:
true if placeholder was found

getDockableAt

public Dockable getDockableAt(Path placeholder)
Description copied from interface: PlaceholderMapping
Searches for the placeholder placeholder and gets the Dockable that is currently sitting at the location described by placeholder.

Specified by:
getDockableAt in interface PlaceholderMapping
Parameters:
placeholder - the placeholder to search
Returns:
the dockable at placeholder, or null either because placeholder could not be found, or because placeholder describes a position that does currently not contain a Dockable