com.vlsolutions.swing.docking.ws
Class Workspace
java.lang.Object
com.vlsolutions.swing.docking.ws.Workspace
public class Workspace
extends java.lang.Object
A logical organization of dockables. Used to define and save desktop layouts (xml loading in not supported yet).
A Workspace is composed of WSDesktop elements (one per involved desktop).
Each WSDesktop supports an API similar to the DockingDesktop (addDockable, split, createTab), where
arguments are simple DockKeys (and not Dockables).
Currently this version doesn't support dockable removal : you can create a workspace, but shouldn't alter its
layout by moving already positionned dockables elsewhere (e.g. workspace will fail if you install a dockable
on an auto-hide border, then add is as a docked tab later).
Workspace() - Creates a workspace with a single default WSDesktop
|
void | addDesktop(WSDesktop desktop) - Adds a new desktop to this workspace
|
void | apply(DockingContext dockingContext) - Applies this workspace to the given docking context (this is equivalent as loading a
workspace file from DockingContext.readXML() : it removes every dockable from the context and
associated desktops, and clears their dockable states, then it reloads the dockables as specified
by this workspace layout.
|
void | clear() - Removes the contained desktops
|
WSDesktop | getDesktop(String desktopName) - Returns a desktop identified by its name or null if not found
|
WSDesktop | getDesktop(int index) - Returns the index-th desktop contained
|
int | getDesktopCount() - Return the number of desktops contained in this workspace (default is 1 )
|
void | loadFrom(DockingContext context) - Loads and configures this workspace from a given docking context.
|
void | readXML(InputStream in)
|
void | writeXML(OutputStream stream) - Saves the workspace layout into an XML stream.
|
Workspace
public Workspace()
Creates a workspace with a single default WSDesktop
addDesktop
public void addDesktop(WSDesktop desktop)
Adds a new desktop to this workspace
apply
public void apply(DockingContext dockingContext)
throws WorkspaceException
Applies this workspace to the given docking context (this is equivalent as loading a
workspace file from DockingContext.readXML() : it removes every dockable from the context and
associated desktops, and clears their dockable states, then it reloads the dockables as specified
by this workspace layout.
clear
public void clear()
Removes the contained desktops
getDesktop
public WSDesktop getDesktop(String desktopName)
Returns a desktop identified by its name or null if not found
getDesktop
public WSDesktop getDesktop(int index)
Returns the index-th desktop contained
getDesktopCount
public int getDesktopCount()
Return the number of desktops contained in this workspace (default is 1 )
loadFrom
public void loadFrom(DockingContext context)
throws WorkspaceException
Loads and configures this workspace from a given docking context.
The workspace is then ready to be applied or saved as a stream.
readXML
public void readXML(InputStream in)
throws ParserConfigurationException,
IOException,
SAXException
writeXML
public void writeXML(OutputStream stream)
throws IOException
Saves the workspace layout into an XML stream.
The workspace is composed of every desktop layouts associated
with this workspace (desktops are identified by their 'desktopName' property).
The stream is not closed at the end of the operation.
© Copyright 2004-2006 VLSolutions. All Rights Reserved.
www.vlsolutions.com : Java Components - Smart Client Applications