public class Workspace
extends java.lang.Object
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).
Constructor and Description |
---|
Workspace()
Creates a workspace with a single default WSDesktop
|
Modifier and Type | Method and Description |
---|---|
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(int index)
Returns the index-th desktop contained
|
WSDesktop |
getDesktop(java.lang.String desktopName)
Returns a desktop identified by its name or null if not found
|
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(java.io.InputStream in) |
void |
writeXML(java.io.OutputStream stream)
Saves the workspace layout into an XML stream.
|
public void clear()
public void addDesktop(WSDesktop desktop)
public int getDesktopCount()
public WSDesktop getDesktop(int index)
public WSDesktop getDesktop(java.lang.String desktopName)
public void apply(DockingContext dockingContext) throws WorkspaceException
WorkspaceException
public void loadFrom(DockingContext context) throws WorkspaceException
The workspace is then ready to be applied or saved as a stream.
WorkspaceException
apply(DockingContext)
public void writeXML(java.io.OutputStream stream) throws java.io.IOException
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.
java.io.IOException
readXML(InputStream)
public void readXML(java.io.InputStream in) throws javax.xml.parsers.ParserConfigurationException, java.io.IOException, org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
org.xml.sax.SAXException
Copyright © 2010-2014 Pacific Biosciences. All Rights Reserved.