public abstract class PlaceholderListMapping extends java.lang.Object implements PlaceholderMapping
PlaceholderMapping
that operates by accessing a PlaceholderList
.Constructor and Description |
---|
PlaceholderListMapping(DockStation station,
DockablePlaceholderList<?> placeholders)
Creates a new
PlaceholderListMapping . |
Modifier and Type | Method and Description |
---|---|
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. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLocationAt
public PlaceholderListMapping(DockStation station, DockablePlaceholderList<?> placeholders)
PlaceholderListMapping
. This constructor should not be called by clients
directly, instead they should call DockStation.getPlaceholderMapping()
station
- the station that created and owns this mappingplaceholders
- the placeholders that are used by station
public DockStation getStation()
PlaceholderMapping
DockStation
which created this mapping in its DockStation.getPlaceholderMapping()
.getStation
in interface PlaceholderMapping
public void addPlaceholder(Dockable dockable, Path placeholder)
PlaceholderMapping
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.addPlaceholder
in interface PlaceholderMapping
dockable
- a child of this station, must not be null
placeholder
- the placeholder to add, must not be null
public void removePlaceholder(Path placeholder)
PlaceholderMapping
placeholder
from this station.removePlaceholder
in interface PlaceholderMapping
placeholder
- the placeholder to remove, must not be null
public boolean hasPlaceholder(Path placeholder)
PlaceholderMapping
station
has any reference to placeholder
.hasPlaceholder
in interface PlaceholderMapping
placeholder
- the placeholder to searchtrue
if placeholder
was foundpublic Dockable getDockableAt(Path placeholder)
PlaceholderMapping
placeholder
and gets the Dockable
that is currently sitting
at the location described by placeholder
.getDockableAt
in interface PlaceholderMapping
placeholder
- the placeholder to searchplaceholder
, or null
either because placeholder
could not be found, or because placeholder
describes a position that does currently not contain
a Dockable