bibliothek.gui.dock.perspective
Interface PerspectiveStation

All Superinterfaces:
PerspectiveElement
All Known Subinterfaces:
ShrinkablePerspectiveStation
All Known Implementing Classes:
CExternalizePerspective.CommonScreenDockPerspective, CGridPerspective.CommonSplitDockPerspective, CMinimizePerspective.CommonFlapDockPerspective, CStackPerspective, FlapDockPerspective, ScreenDockPerspective, SplitDockPerspective, StackDockPerspective

public interface PerspectiveStation
extends PerspectiveElement

An abstract representation of a DockStation in a Perspective.

Author:
Benjamin Sigg

Method Summary
 PerspectiveDockable getDockable(int index)
          Gets the index'th child of this station.
 int getDockableCount()
          Gets the number of children this station has.
 DockableProperty getDockableProperty(PerspectiveDockable child, PerspectiveDockable target)
          Gets precise information about the location of a child of this station.
 PlaceholderMap getPlaceholders()
          Converts the contents of this station into a map of placeholders.
 boolean remove(PerspectiveDockable dockable)
          Removes a child of this station, can leave behind a placeholder.
 void replace(PerspectiveDockable oldDockable, PerspectiveDockable newDockable)
          Replaces oldDockable by newDockable.
 void setPlaceholders(PlaceholderMap placeholders)
          Informs this station of the content that it should show
 
Methods inherited from interface bibliothek.gui.dock.perspective.PerspectiveElement
asDockable, asStation, getFactoryID
 

Method Detail

getDockableCount

int getDockableCount()
Gets the number of children this station has.

Returns:
the number of children

getDockable

PerspectiveDockable getDockable(int index)
Gets the index'th child of this station.

Parameters:
index - the index of a child
Returns:
the child, not null

getDockableProperty

DockableProperty getDockableProperty(PerspectiveDockable child,
                                     PerspectiveDockable target)
Gets precise information about the location of a child of this station.

Parameters:
child - a child of this station, this childs location is asked
target - an optional hint telling for which dockable the location information will be used, can be null. This hint can be used to find a placeholder that should be part of the result.
Returns:
the location

getPlaceholders

PlaceholderMap getPlaceholders()
Converts the contents of this station into a map of placeholders.

Returns:
a map of placeholders describing the contents of this station

setPlaceholders

void setPlaceholders(PlaceholderMap placeholders)
Informs this station of the content that it should show

Parameters:
placeholders - a map that was earlier created by getPlaceholders()

remove

boolean remove(PerspectiveDockable dockable)
Removes a child of this station, can leave behind a placeholder.

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

replace

void replace(PerspectiveDockable oldDockable,
             PerspectiveDockable newDockable)
Replaces oldDockable by newDockable. This method should behave the same way is if oldDockable was removed and newDockable added at the same location.

Parameters:
oldDockable - some child of this station
newDockable - the replacement for oldDockable
Throws:
IllegalArgumentException - if oldDockable is not a child of this station or if newDockable cannot be added as child to this station