com.vlsolutions.swing.docking.ws
public class Workspace extends 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).
Since: 2.1.2
Constructor Summary | |
---|---|
Workspace() Creates a workspace with a single default WSDesktop |
Method Summary | |
---|---|
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(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(InputStream in) |
void | writeXML(OutputStream stream) Saves the workspace layout into an XML stream.
|
The workspace is then ready to be applied or saved as a stream.
Since: 2.1.3
See Also: apply
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.