bibliothek.gui.dock.station.split
Class SplitDockPlaceholderProperty

java.lang.Object
  extended by bibliothek.gui.dock.layout.AbstractDockableProperty
      extended by bibliothek.gui.dock.station.split.SplitDockPlaceholderProperty
All Implemented Interfaces:
DockableProperty

public class SplitDockPlaceholderProperty
extends AbstractDockableProperty

This property references a placeholder that is already present within the tree of a SplitDockStation.

Author:
Benjamin Sigg

Constructor Summary
SplitDockPlaceholderProperty()
          Creates a new empty property
SplitDockPlaceholderProperty(Path placeholder)
          Creates a new property.
SplitDockPlaceholderProperty(Path placeholder, SplitDockPathProperty backup)
          Creates a new property.
SplitDockPlaceholderProperty(Path placeholder, SplitDockProperty backup)
          Creates a new property.
 
Method Summary
 SplitDockPlaceholderProperty copy()
          Gets a copy of this property, the successor must be copied as well.
 DockableProperty getBackup()
          Gets the backup location that was set when this SplitDockPlaceholderProperty was created.
 String getFactoryID()
          Gets the unique name of the DockablePropertyFactory which can create this type of DockableProperty.
 Path getPlaceholder()
          Gets the placeholder this property references to.
 void load(DataInputStream in)
          Reads the contents of this DockableProperty from a stream.
 void load(XElement element)
          Reads the contents of this DockableProperty from an xml element.
 void setSuccessor(DockableProperty successor)
          Sets the property which will be used if this property was used and there is not yet a leaf in the tree of DockStations and Dockables reached.
For example: there is a DockStation root, a dockable DockStation node which is a child of root and a Dockable leaf which is a child of node.
A DockableProperty called one would describe the relationship between root and node.
 void store(DataOutputStream out)
          Stores the contents of this DockableProperty in a stream.
 void store(XElement element)
          Stores the contents of this property as xml element.
 DockableProperty toLocation(SplitNode target)
          Gets some DockableProperty that works as backup property if the referenced placeholder is not found.
 SplitDockProperty toSplitLocation(SplitNode target)
          Gets a SplitDockProperty that works as backup property if the referenced placeholder is not found.
 String toString()
           
 
Methods inherited from class bibliothek.gui.dock.layout.AbstractDockableProperty
copy, equals, equalsNoSuccessor, getSuccessor, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SplitDockPlaceholderProperty

public SplitDockPlaceholderProperty()
Creates a new empty property


SplitDockPlaceholderProperty

public SplitDockPlaceholderProperty(Path placeholder)
Creates a new property.

Parameters:
placeholder - the referenced placeholder

SplitDockPlaceholderProperty

public SplitDockPlaceholderProperty(Path placeholder,
                                    SplitDockProperty backup)
Creates a new property.

Parameters:
placeholder - the referenced placeholder
backup - backup location to be used if placeholder is not found

SplitDockPlaceholderProperty

public SplitDockPlaceholderProperty(Path placeholder,
                                    SplitDockPathProperty backup)
Creates a new property.

Parameters:
placeholder - the referenced placeholder
backup - backup location to be used if placeholder is not found
Method Detail

toString

public String toString()
Overrides:
toString in class Object

getPlaceholder

public Path getPlaceholder()
Gets the placeholder this property references to.

Returns:
the placeholder, not null

toLocation

public DockableProperty toLocation(SplitNode target)
Gets some DockableProperty that works as backup property if the referenced placeholder is not found.

Parameters:
target - the node that asks for this location
Returns:
the location, not null

toSplitLocation

public SplitDockProperty toSplitLocation(SplitNode target)
Gets a SplitDockProperty that works as backup property if the referenced placeholder is not found.

Parameters:
target - the node that asks for this location
Returns:
the location, not null

setSuccessor

public void setSuccessor(DockableProperty successor)
Description copied from interface: DockableProperty
Sets the property which will be used if this property was used and there is not yet a leaf in the tree of DockStations and Dockables reached.
For example: there is a DockStation root, a dockable DockStation node which is a child of root and a Dockable leaf which is a child of node.
A DockableProperty called one would describe the relationship between root and node. Another DockableProperty called two would describe the relationship between node and leaf. In this case, the successor of one would be two.

Specified by:
setSuccessor in interface DockableProperty
Overrides:
setSuccessor in class AbstractDockableProperty
Parameters:
successor - the location of a child

getBackup

public DockableProperty getBackup()
Gets the backup location that was set when this SplitDockPlaceholderProperty was created.

Returns:
the backup location, might be null

copy

public SplitDockPlaceholderProperty copy()
Description copied from interface: DockableProperty
Gets a copy of this property, the successor must be copied as well.

Returns:
an independent copy of this

getFactoryID

public String getFactoryID()
Description copied from interface: DockableProperty
Gets the unique name of the DockablePropertyFactory which can create this type of DockableProperty.

Returns:
the id
See Also:
DockablePropertyFactory

store

public void store(DataOutputStream out)
           throws IOException
Description copied from interface: DockableProperty
Stores the contents of this DockableProperty in a stream. The successor (if there is one) must not be saved.

Parameters:
out - the stream to write in
Throws:
IOException - if anything unexpected happens

load

public void load(DataInputStream in)
          throws IOException
Description copied from interface: DockableProperty
Reads the contents of this DockableProperty from a stream. The property can assume that a property with the same type has written into the stream.

Parameters:
in - the stream to read
Throws:
IOException - if anything unexpected happens

store

public void store(XElement element)
Description copied from interface: DockableProperty
Stores the contents of this property as xml element.

Parameters:
element - the element into which to write, the attributes of this element should not be changed

load

public void load(XElement element)
Description copied from interface: DockableProperty
Reads the contents of this DockableProperty from an xml element.

Parameters:
element - the element that was written earlier by this property