Skip to content

DockingRoot

Root visual widget for the IDE docking system hosting dock tree nodes, tab strips, split handles, drop previews, and tear-off floating window integrations.

Overview

DockingRoot is the top-level visual container integrating the entire docking system.

Core Features

  • Renders hierarchical split trees with draggable divider handles.
  • Renders tab strips with close buttons, icons, and active indicators.
  • Integrates with WindowWidget hosts for tear-off floating windows.
  • Displays drop preview highlights and cross-docking targets.
  • Dispatches docking lifecycle events (onLayoutChanged, onDropPreviewChanged).

Configuring Docking Root and Adding Panes

DockingRoot root = new DockingRoot();
root.addDocument("code-1", "CodeEditor.java", editorWidget);
root.addToolPane("proj-1", "Project", projectTreeWidget, DockArea.LEFT);
  • DockPane: Descriptor representing an individual dockable pane hosting arbitrary widget content, tab title, icon, dirty state, and close guards.
  • DockTheme: Styling theme for the docking system configuring palette colors (DockColor), tab geometry, split handles, shadows, and window resize grips.
  • DockingManager: Non-visual layout controller managing the hierarchical docking tree, pane additions, splits, tab reordering, and snapshot serialization/restoration.

API

DockingRoot()

Constructs a new DockingRoot widget initialized with default theme and styling.

DockingRoot::acceptsDockDrops()

Returns true if this docking root currently accepts drop operations based on window dock policy.

Returns boolean: True if the root accepts docking drop operations..

DockingRoot::addDocument(String, String, Widget)

Convenience method to add a DOCUMENT kind pane into the central editor workspace.

Parameter Type Description
id String Unique pane identifier.
title String Pane title text.
content Widget Widget content of the pane.

Returns DockingRoot: This DockingRoot for method chaining..

DockingRoot::addPane(DockPane)

Adds a pane to the docking layout.

Parameter Type Description
pane DockPane DockPane to add.

Returns DockingRoot: This DockingRoot for method chaining..

DockingRoot::addToolPane(String, String, Widget, DockArea)

Convenience method to add a TOOL kind utility pane docked to a perimeter area.

Parameter Type Description
id String Unique pane identifier.
title String Pane title text.
content Widget Widget content of the pane.
area DockArea DockArea where the pane should be placed.

Returns DockingRoot: This DockingRoot for method chaining..

DockingRoot::allowFloatingOutsideHost()

Returns true if floating dock windows are allowed to move outside host bounds.

Returns boolean: True if floating windows can move beyond the host bounds..

DockingRoot::allowFloatingOutsideHost(boolean)

Sets whether floating dock windows may move outside root host bounds.

Parameter Type Description
allowFloatingOutsideHost boolean Whether floating windows may move outside the host bounds.

Returns DockingRoot: This DockingRoot for method chaining..

DockingRoot::clearForeignWindowDropPreview(WindowWidget)

Clears any active foreign window drop preview highlighting.

Parameter Type Description
window WindowWidget Floating window being dragged.

DockingRoot::closeActivePane()

Closes the currently active tab.

Returns boolean: True if the pane was closed; false otherwise..

DockingRoot::crossCellRect(RectView, DockArea)

Calculates the geometric bounds of a drop cross directional trigger cell.

Parameter Type Description
leafBounds RectView Screen bounds of the dock leaf.
area DockArea DockArea where the pane should be placed.

Returns MutableRect: The bounding rectangle of the target docking cell..

DockingRoot::dockDragging()

Returns true if a docking tab drag gesture is currently underway.

Returns boolean: True if a docking drag operation is currently active..

DockingRoot::dockDropPreview()

Returns the current drop preview intent.

Returns DockDropIntent: Current drop preview intent, or null..

DockingRoot::dockForeignWindow(WindowWidget, float, float)

Docks the content of an external WindowWidget into this DockingRoot.

Parameter Type Description
window WindowWidget Floating window being dragged.
rootX float Pointer root X coordinate.
rootY float Pointer root Y coordinate.

Returns boolean: True if the pane was successfully docked; false otherwise..

DockingRoot::dockingManager()

Returns the non-visual DockingManager coordinating this root.

Returns DockingManager: The underlying DockingManager managing layout..

DockingRoot::dragController()

Returns the DockDragController managing tab and window dragging.

Returns DockDragController: The DockDragController managing tab gestures..

DockingRoot::dropPreviewRenderer()

Returns custom drop preview renderer delegate, or null if default.

Returns WidgetRender: The requested renderer..

DockingRoot::dropPreviewRenderer(WidgetRender)

Sets custom drop preview renderer delegate.

Parameter Type Description
dropPreviewRenderer WidgetRender Custom drop preview renderer.

Returns DockingRoot: This DockingRoot for method chaining..

DockingRoot::findPane(String)

Finds a DockPane by its unique identifier.

Parameter Type Description
paneId String Identifier of the pane to find or select.

Returns DockPane: The matching DockPane, or null if not found..

DockingRoot::finishForeignWindowDrop(WindowWidget, float, float)

Completes drop of an external WindowWidget into the docking layout.

Parameter Type Description
window WindowWidget Floating window being dragged.
rootX float Pointer root X coordinate.
rootY float Pointer root Y coordinate.

Returns boolean: True if the pane was successfully docked; false otherwise..

DockingRoot::floatingWindowsRedockLocked()

Returns whether floating windows spawned from this root are prevented from redocking.

Returns boolean: True if floating windows cannot be re-docked..

DockingRoot::floatingWindowsRedockLocked(boolean)

Locks or unlocks redocking capability for floating windows.

Parameter Type Description
floatingWindowsRedockLocked boolean Whether floating windows are locked from re-docking.

Returns DockingRoot: This DockingRoot for method chaining..

DockingRoot::lastFloatingWindow()

Returns the last WindowWidget created by a float or tear-off operation, or null.

Returns WindowWidget: The most recently detached floating window, or null..

DockingRoot::manager()

Convenience shortcut returning the DockingManager.

Returns DockingManager: The underlying DockingManager managing layout..

DockingRoot::onDragEnded(EventListener)

Registers a listener called when a tab drag gesture ends.

Parameter Type Description
listener EventListener Listener for drop preview change events.

Returns EventSubscription: Subscription token for unregistering the listener..

DockingRoot::onDragMoved(EventListener)

Registers a listener called on pointer movement during tab drag.

Parameter Type Description
listener EventListener Listener for drop preview change events.

Returns EventSubscription: Subscription token for unregistering the listener..

DockingRoot::onDragStarted(EventListener)

Registers a listener called when a dock tab drag gesture starts.

Parameter Type Description
listener EventListener Listener for drop preview change events.

Returns EventSubscription: Subscription token for unregistering the listener..

DockingRoot::onDropPreviewChanged(EventListener)

Registers a listener called when the drop preview target intent updates.

Parameter Type Description
listener EventListener Listener for drop preview change events.

Returns EventSubscription: Subscription token for unregistering the listener..

DockingRoot::onLayoutChanged(EventListener)

Registers a listener called when docking layout structure changes.

Parameter Type Description
listener EventListener Listener for drop preview change events.

Returns EventSubscription: Subscription token for unregistering the listener..

DockingRoot::onLayoutRestored(EventListener)

Registers a listener called when layout is restored from snapshot.

Parameter Type Description
listener EventListener Listener for drop preview change events.

Returns EventSubscription: Subscription token for unregistering the listener..

DockingRoot::paneRenderer()

Returns custom pane renderer delegate, or null if default.

Returns WidgetRender: The requested renderer..

DockingRoot::paneRenderer(WidgetRender)

Sets custom pane renderer delegate.

Parameter Type Description
paneRenderer WidgetRender Custom drop preview renderer.

Returns DockingRoot: This DockingRoot for method chaining..

DockingRoot::previewForeignWindowDrop(WindowWidget, float, float)

Calculates and updates docking drop preview for an externally dragged WindowWidget.

Parameter Type Description
window WindowWidget Floating window being dragged.
rootX float Pointer root X coordinate.
rootY float Pointer root Y coordinate.

DockingRoot::restoreLayout(DockLayoutSnapshot, Map)

Restores layout structure from snapshot.

Parameter Type Description
snapshot DockLayoutSnapshot Layout snapshot to restore.
paneRegistry Map Registry mapping pane IDs to DockPane instances.

Returns DockingRoot: This DockingRoot for method chaining..

DockingRoot::rootNode()

Returns the root DockNode of the docking layout tree.

Returns DockNode: The root node of the docking tree..

DockingRoot::selectNextTab()

Selects the next tab in the active leaf.

Returns boolean: True if the active tab changed; false otherwise..

DockingRoot::selectPane(String)

Selects and brings into view the pane with the specified ID.

Parameter Type Description
paneId String Identifier of the pane to find or select.

Returns DockingRoot: This DockingRoot for method chaining..

DockingRoot::selectPreviousTab()

Selects the previous tab in the active leaf.

Returns boolean: True if the active tab changed; false otherwise..

DockingRoot::splitHandleRenderer()

Returns custom split handle renderer delegate, or null if default.

Returns WidgetRender: The requested renderer..

DockingRoot::splitHandleRenderer(WidgetRender)

Sets custom split handle renderer delegate.

Parameter Type Description
splitHandleRenderer WidgetRender Custom drop preview renderer.

Returns DockingRoot: This DockingRoot for method chaining..

DockingRoot::splitHandleStyle()

Returns the visual rendering style of split handles.

Returns SplitHandleStyle: Current split handle visual style..

DockingRoot::splitHandleStyle(SplitHandleStyle)

Sets the visual rendering style of split handles (BLOCK or SEAM).

Parameter Type Description
splitHandleStyle SplitHandleStyle Visual style of split handles.

Returns DockingRoot: This DockingRoot for method chaining..

DockingRoot::splitHandleThickness()

Returns the split handle thickness in pixels.

Returns float: Split handle thickness in pixels..

DockingRoot::splitHandleThickness(float)

Sets the split handle thickness in pixels.

Parameter Type Description
splitHandleThickness float Thickness of split handles in pixels.

Returns DockingRoot: This DockingRoot for method chaining..

DockingRoot::splitPane(String, DockArea, DockPane)

Splits the leaf containing targetPaneId along the specified area.

Parameter Type Description
targetPaneId String Reference pane ID for split or tab placement.
area DockArea DockArea where the pane should be placed.
pane DockPane DockPane to add.

Returns DockingRoot: This DockingRoot for method chaining..

DockingRoot::splitPane(String, DockArea, DockPane, float)

Splits the leaf containing targetPaneId along the specified area with a custom split ratio.

Parameter Type Description
targetPaneId String Reference pane ID for split or tab placement.
area DockArea DockArea where the pane should be placed.
pane DockPane DockPane to add.
splitRatio float Split ratio dividing the area.

Returns DockingRoot: This DockingRoot for method chaining..

DockingRoot::tabBounds(String)

Returns the bounding rectangle of a tab in root coordinates, or null if invisible.

Parameter Type Description
paneId String Identifier of the pane to find or select.

Returns RectView: Screen-space bounds of the requested tab header..

DockingRoot::tabCloseBounds(String)

Returns the bounding rectangle of a tab close button in root coordinates, or null if invisible/unclosable.

Parameter Type Description
paneId String Identifier of the pane to find or select.

Returns RectView: Screen-space bounds of the tab close button..

DockingRoot::tabHeight()

Returns the height of tab strips in pixels.

Returns float: Height of docking tab bars in pixels..

DockingRoot::tabHeight(float)

Sets the height of tab strips in pixels.

Parameter Type Description
tabHeight float Height of tab headers in pixels.

Returns DockingRoot: This DockingRoot for method chaining..

DockingRoot::tabPane(String, DockPane)

Adds a pane as a tab into the leaf containing targetPaneId.

Parameter Type Description
targetPaneId String Reference pane ID for split or tab placement.
pane DockPane DockPane to add.

Returns DockingRoot: This DockingRoot for method chaining..

DockingRoot::tearOffOnDragOut()

Returns whether dragging a tab out of the docking area tears it off into a floating window.

Returns boolean: True if dragging tabs out creates floating windows..

DockingRoot::tearOffOnDragOut(boolean)

Enables or disables automatic tear-off of tabs into floating windows when dropped outside dock zones.

Parameter Type Description
tearOffOnDragOut boolean Whether dragging tabs outside tears them off into floating windows.

Returns DockingRoot: This DockingRoot for method chaining..

DockingRoot::theme()

Returns the active DockTheme applied to this root.

Returns DockTheme: The current docking theme..

DockingRoot::theme(DockTheme)

Applies a custom DockTheme to this root.

Parameter Type Description
theme DockTheme Docking theme configuration.

Returns DockingRoot: This DockingRoot for method chaining..

DockingRoot::useDefaultDockingRenderers()

Resets all custom renderers to built-in docking defaults.

Returns DockingRoot: This DockingRoot for method chaining..

DockingRoot::windowDragZoneAt(float, float)

Checks whether pressing at (rootX, rootY) initiates window drag for host WindowWidgets.

Parameter Type Description
rootX float Pointer root X coordinate.
rootY float Pointer root Y coordinate.

Returns boolean: True if pointer coordinates hit the window drag zone..

DockingRoot::windowHost()

Returns the parent WindowWidget hosting this docking root, or null if root is top-level.

Returns WindowWidget: The host widget containing floating windows..

DockingRoot::windowHost(WindowWidget)

Binds this docking root to a host WindowWidget.

Parameter Type Description
windowHost WindowWidget WindowWidget host for floating windows.