bibliothek.gui.dock.common.perspective
Class CControlPerspective

java.lang.Object
  extended by bibliothek.gui.dock.common.perspective.CControlPerspective

public class CControlPerspective
extends Object

A CControlPerspective is a wrapper around a CControl allowing access to various CPerspectives.

Author:
Benjamin Sigg

Constructor Summary
CControlPerspective(CControlAccess control)
          Creates a new wrapper
 
Method Summary
 CPerspective createEmptyPerspective()
          Creates a new CPerspective that is set up with the root-stations of the CControl.
 String[] getNames()
          Gets the names of all the perspectives that are available.
 CPerspective getPerspective(boolean includeWorkingAreas)
          Gets a perspective that matches the current layout of the application.
 CPerspective getPerspective(String name)
          Gets the perspective which represents a layout that was stored using CControl.save(String).
 void setPerspective(CPerspective perspective, boolean includeWorkingAreas)
          Changes the layout of the associated CControl such that it matches perspective.
 void setPerspective(String name, CPerspective perspective)
          Stores perspective as a layout that can be selected by the user by calling CControl.load(String).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CControlPerspective

public CControlPerspective(CControlAccess control)
Creates a new wrapper

Parameters:
control - the control whose perspectives are modified
Method Detail

createEmptyPerspective

public CPerspective createEmptyPerspective()
Creates a new CPerspective that is set up with the root-stations of the CControl. There are no Dockables stored in the new perspective.

Returns:
the new perspective

getPerspective

public CPerspective getPerspective(boolean includeWorkingAreas)
Gets a perspective that matches the current layout of the application.

Parameters:
includeWorkingAreas - whether Dockables that are managed by a working-area should be included in the layout or not
Returns:
the current perspective

getNames

public String[] getNames()
Gets the names of all the perspectives that are available.

Returns:
all the names

getPerspective

public CPerspective getPerspective(String name)
Gets the perspective which represents a layout that was stored using CControl.save(String).

Parameters:
name - the name of the stored layout
Returns:
the perspective or null if name was not found

setPerspective

@Todo(description="handle modes")
public void setPerspective(CPerspective perspective,
                                           boolean includeWorkingAreas)
Changes the layout of the associated CControl such that it matches perspective.

Parameters:
perspective - the perspective to apply, not null
includeWorkingAreas - whether Dockables that are managed by a working-area should be included in the layout or not

setPerspective

public void setPerspective(String name,
                           CPerspective perspective)
Stores perspective as a layout that can be selected by the user by calling CControl.load(String).

Parameters:
name - the name of the layout
perspective - the new layout, not null