Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
com.vlsolutions.swing.docking.DockingContext
public class DockingContext
extends java.lang.Object
Field Summary | |
protected HashMap |
|
protected ArrayList |
|
Constructor Summary | |
|
Method Summary | |
void |
|
void |
|
void |
|
void |
|
void | |
void | |
ArrayList |
|
Dockable |
|
DockableResolver |
|
DockableState |
|
DockableState[] |
|
ArrayList |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void | |
void |
|
void |
|
void |
|
void |
|
protected HashMap dockableStates
inner state of the dockables
protected ArrayList registeredDockables
All dockables must be registered (even if not shown) in order to be processed by the XML Parser or to be displayed in the DockingSelectorDialog
public void addDockableSelectionListener(DockableSelectionListener listener)
Adds a new DockableSelectionListener to this desktop. DockableSelection Events are triggered when a dockable takes the focus.
public void addDockableStateChangeListener(DockableStateChangeListener listener)
Adds a new DockableStateChangeListener to this desktop. DockableStateChange Events are triggered after the state change. As of version 2.0 of the framework, this method can also be replaced by adding a propertychangeListener on the DockKey object (and react to its DockableState property).
public void addDockableStateWillChangeListener(DockableStateWillChangeListener listener)
Adds a new DockableStateWillChangeListener to this desktop. DockableStateWillChange Events are triggered before the state change, and are vetoable.
public ArrayList getDesktopList()
Returns a list of the desktops sharing this context
public Dockable getDockableByKey(String dockKey)
Returns the (registered) dockable corresponding to the given key id, or null if not found Note : since VLDocking 2.1.2, this method also tries to use its DockableResolver if null would have been returned.
- See Also:
DockableResolver
public DockableResolver getDockableResolver()
Returns the dockable resolver used by this context (or null if none defined)
- Since:
- 2.1.2
public DockableState getDockableState(Dockable dockable)
Returns the current state of a dockable (CLOSED, HIDDEN, DOCKED, MAXIMIZED, FLOATING)
public DockableState[] getDockables()
Creates and returns an array of all registered dockable with their current state. Visibility states are [DockableState.STATE_CLOSED, STATE_DOCKED, STATE_HIDDEN]
- Returns:
- an array of DockableState
public ArrayList getDockablesByState(DockingDesktop desktop, int state)
constructs and returns the list of dockables corresponding to a desktop, at a specific state
public void readXML(InputStream in) throws ParserConfigurationException, IOException, SAXException
Reads an XML encoded stream as the new desktop configuration. When the method returns, the desktops associated to this context are totally reconfigured with posiibly different dockables at different positions. Note : TheDockKey
s of the stream must be registered with theregisterDockable
method, prior readXML.
This is the case if the desktop is already open and dockables laid out, but might not be the case if this method is used at application startup to populate an empty desktop. Note : altenatively (since 2.1.2) if a DockableResolver has been set, it will be use to auto-register the new dockables encountered along the stream.
Dismisses all visible dockables (docked and auto-hidden), and clear their DockableState. The stream is not closed at the end of the operation. Note : When multiple desktops are loaded from the stream, the context uses their "desktopName" property (desk.getDesktopName()) to identify them.
public void registerDockable(Dockable dockable)
Every dockable must be registered in order to be managed by a DockingDesktop. if this method is invoked and the dockable is already registered, nothing happens. if the dockable is still unknown, it is added to the dockables set and (since 2.1.3) its state is set to CLOSED (prior 2.1.3, the state was null).
public void removeDockableSelectionListener(DockableSelectionListener listener)
Removes a DockableSelectionListener from this desktop.
public void removeDockableStateChangeListener(DockableStateChangeListener listener)
Removes a DockableStateChangeListener from this desktop.
public void removeDockableStateWillChangeListener(DockableStateWillChangeListener listener)
Removes a DockableStateWillChangeListener from this desktop.
public void setDockableResolver(DockableResolver dockableResolver)
Updates the dockable resolver used by this context (can be set to null)
- Since:
- 2.1.2
public void setDockableState(Dockable dockable, DockableState state)
Updates the current state of a dockable
public void unregisterDockable(Dockable dockable)
Unregisters the dockable, which can be garbage collected (no longer used by docking desktops.
public void writeXML(OutputStream stream) throws IOException
Saves the current desktop configuration into an XML stream. The workspace is composed of every desktop layouts associated with this context (desktops are identified by their 'desktopName' property). The stream is not closed at the end of the operation.
- See Also:
readXML(InputStream)