bibliothek.gui.dock.common.perspective
Class MultipleCDockablePerspective

java.lang.Object
  extended by bibliothek.gui.dock.common.perspective.AbstractCDockablePerspective
      extended by bibliothek.gui.dock.common.perspective.MultipleCDockablePerspective
All Implemented Interfaces:
CDockablePerspective, CElementPerspective

public class MultipleCDockablePerspective
extends AbstractCDockablePerspective

Representation of a MultipleCDockable in a perspective.

Author:
Benjamin Sigg

Nested Class Summary
protected  class MultipleCDockablePerspective.Intern
          The default representation for a MultipleCDockablePerspective.
 
Constructor Summary
MultipleCDockablePerspective(String factoryId, MultipleCDockableLayout layout)
          Creates a new representation.
MultipleCDockablePerspective(String factoryId, String uniqueId, MultipleCDockableLayout layout)
          Creates a new representation.
 
Method Summary
 CDockablePerspective asDockable()
          Gets this as dockable, if this is a dockable.
 CStationPerspective asStation()
          Gets this as station, if this is a station.
protected  CommonElementPerspective create()
          Called the first time intern() is called, creates the internal representation of this dockable.
 String getFactoryID()
          Gets the unique identifier of the factory that handles this kind of dockable.
 MultipleCDockableLayout getLayout()
          Gets the layout which describes the content of this dockable.
 String getUniqueId()
          Gets the unique identifier of this element.
 CommonElementPerspective intern()
          Gets the internal representation for this element.
If CElementPerspective.asDockable() returns a non-null value, then intern().asDockable() must not return null either.
If CElementPerspective.asStation() returns a non-null value, then intern().asStation() must not return null either.
 void setLayout(MultipleCDockableLayout layout)
          Sets the layout which describes this dockable.
 void setUniqueId(String uniqueId)
          Sets the unique identifier of this element.
 
Methods inherited from class bibliothek.gui.dock.common.perspective.AbstractCDockablePerspective
getLocationHistory, getParent, getWorkingArea, remove, setWorkingArea
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultipleCDockablePerspective

public MultipleCDockablePerspective(String factoryId,
                                    MultipleCDockableLayout layout)
Creates a new representation. The identifier of the factory must match an identifier of a MultipleCDockableFactory that is registered at a CControl through the method CControl.addMultipleDockableFactory(String, MultipleCDockableFactory).

Parameters:
factoryId - the unique identifier of a MultipleCDockableFactory, not null
layout - description of the content of this dockable, will be given to the MultipleCDockableFactory that is accessed through factoryId

MultipleCDockablePerspective

public MultipleCDockablePerspective(String factoryId,
                                    String uniqueId,
                                    MultipleCDockableLayout layout)
Creates a new representation. The identifier of the factory must match an identifier of a MultipleCDockableFactory that is registered at a CControl through the method CControl.addMultipleDockableFactory(String, MultipleCDockableFactory).

Parameters:
factoryId - the unique identifier of a MultipleCDockableFactory, not null
uniqueId - a unique identifier for this dockable, can be null
layout - description of the content of this dockable, will be given to the MultipleCDockableFactory that is accessed through factoryId
Method Detail

setUniqueId

public void setUniqueId(String uniqueId)
Sets the unique identifier of this element. The identifier can be used to replace an existing MultipleCDockable with the dockable that is represented by this. If no identifier is set, then a random identifier will be set when the CPerspective is applied.

Parameters:
uniqueId - the unique id or null

getUniqueId

public String getUniqueId()
Gets the unique identifier of this element.

Returns:
the unique identifier, can be null

create

protected CommonElementPerspective create()
Called the first time intern() is called, creates the internal representation of this dockable.

Returns:
the internal representation, not null

intern

public CommonElementPerspective intern()
Description copied from interface: CElementPerspective
Gets the internal representation for this element.
If CElementPerspective.asDockable() returns a non-null value, then intern().asDockable() must not return null either.
If CElementPerspective.asStation() returns a non-null value, then intern().asStation() must not return null either.

Returns:
the internal representation

setLayout

public void setLayout(MultipleCDockableLayout layout)
Sets the layout which describes this dockable.

Parameters:
layout - the layout, not null

getLayout

public MultipleCDockableLayout getLayout()
Gets the layout which describes the content of this dockable.

Returns:
the layout, not null

asDockable

public CDockablePerspective asDockable()
Description copied from interface: CElementPerspective
Gets this as dockable, if this is a dockable.

Returns:
this or null

asStation

public CStationPerspective asStation()
Description copied from interface: CElementPerspective
Gets this as station, if this is a station.

Returns:
this or null

getFactoryID

public String getFactoryID()
Gets the unique identifier of the factory that handles this kind of dockable.

Returns:
the factory, not null