DockLayoutSnapshot
Immutable snapshot representing the recursive docking layout tree and active pane selection for serialization and layout persistence.
Overview
DockLayoutSnapshot captures the complete recursive docking tree structure for persistence.
Persistence Flow
- Capture:
DockLayoutSnapshot snapshot = dockingManager.snapshot(); - Serialize:
String encoded = DockLayoutSnapshotCodec.encode(snapshot); - Save: Persist
encodedstring into application settings or workspace file. - Restore:
dockingRoot.restoreLayout(snapshot, paneRegistry);
Capturing and Restoring Snapshots
Related links
- DockLayoutSnapshotCodec: Compact string serializer and deserializer (DLS1 format) for persisting docking layouts across application restarts.
- DockingManager: Non-visual layout controller managing the hierarchical docking tree, pane additions, splits, tab reordering, and snapshot serialization/restoration.
API
DockLayoutSnapshot(Node)
Creates a layout snapshot with empty active pane.
| Parameter | Type | Description |
|---|---|---|
root |
Node |
Root serialized node. |
DockLayoutSnapshot::from(DockNode)
Captures an immutable snapshot from a live DockNode hierarchy.
| Parameter | Type | Description |
|---|---|---|
root |
DockNode |
Live root dock node to snapshot. |
Returns DockLayoutSnapshot: Immutable snapshot of the docking hierarchy..
DockLayoutSnapshot::from(DockNode, String)
Captures an immutable snapshot from a live DockNode hierarchy with active pane identifier.
| Parameter | Type | Description |
|---|---|---|
root |
DockNode |
Live root dock node to snapshot. |
activePaneId |
String |
Identifier of the active dock pane. |
Returns DockLayoutSnapshot: Immutable snapshot of the docking hierarchy..