Skip to content

WindowWidget

Desktop-style floating window widget supporting title bar, dragging, resizing, collapse, modal dialogs, and docking integrations.

Overview

WindowWidget is a full-featured desktop-style floating window container with title bar, window actions, dragging, resizing, collapse, modal dialogs, and docking system integrations.

Key capabilities: - Title bar with plain-text or RichText titles, icons, and action buttons (minimize, collapse, close). - 8-direction and corner resizing with configurable minimum size and resize grips. - Boundary snapping and host constraints (constrainToHost). - Modal mode support with background scrim dimming. - Seamless docking integration with DockingRoot and DockPane docking trees.

Creating and Positioning Window Widget

WindowWidget window = new WindowWidget("Settings", settingsForm);
window.position(100, 100).open();
  • 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.
  • OverlayLayer: Full-screen overlay root managing modal backdrops, dialogs, popups, and layer-based hit testing.
  • WindowManager: Manager controlling floating window z-order, focus stack, active states, and desktop window arrangements.

API

WindowWidget()

Constructs an empty WindowWidget with default title and dimensions.

WindowWidget(RichText, Widget)

Constructs a WindowWidget with a RichText formatted title and hosted content.

Parameter Type Description
title RichText RichText formatted title component.
content Widget Content widget hosted inside.

WindowWidget(String, Widget)

Constructs a WindowWidget with a plain-text title and hosted content widget.

Parameter Type Description
title String Title string.
content Widget Content widget hosted inside.

WindowWidget::acceptsDocking()

Returns true if this window accepts foreign panes dropped into it.

Returns boolean: True if this window accepts dragged dock panes..

WindowWidget::active()

Returns true if this window currently holds focus in its WindowManager.

Returns boolean: True if this window is currently focused and active..

WindowWidget::arrangeInHost(RectView)

Positions the window inside the host boundaries.

Parameter Type Description
bounds RectView Available host rectangular boundary.

WindowWidget::captionless()

Returns true if the window renders without a title bar header.

Returns boolean: True if the window has no header bar..

WindowWidget::close()

Closes the window.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::closeButton()

Returns the title bar close button widget.

Returns Button: The title bar button instance..

WindowWidget::closeButtonVisible()

Returns true if the title bar close button is visible.

Returns boolean: True if the close button is visible..

WindowWidget::closeButtonVisible(boolean)

Sets the visibility of the close button.

Parameter Type Description
closeButtonVisible boolean Whether the title bar close button is visible.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::closeOnOutsideClick()

Returns true if clicking outside dismisses this window.

Returns boolean: True if closing on outside click is enabled..

WindowWidget::closeOnOutsideClick(boolean)

Configures whether clicking outside closes the window.

Parameter Type Description
closeOnOutsideClick boolean Whether clicking outside automatically dismisses the widget.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::collapseButtonVisible()

Returns true if the collapse toggle button is shown in the header.

Returns boolean: True if the collapse button is visible..

WindowWidget::collapseButtonVisible(boolean)

Sets the visibility of the header collapse button.

Parameter Type Description
visible boolean Target visibility flag.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::collapsed()

Returns true if the window is currently collapsed to header-only.

Returns boolean: True if the window is currently collapsed..

WindowWidget::collapsed(boolean)

Sets whether the window is collapsed.

Parameter Type Description
collapsed boolean Whether the window is collapsed to its header bar.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::commitDockHost()

Commits an auto-created docking host, making it permanent.

WindowWidget::constrainToHost()

Returns true if window coordinates are clamped within the host boundary.

Returns boolean: True if window movement is constrained inside host boundaries..

WindowWidget::constrainToHost(boolean)

Configures host boundary clamping.

Parameter Type Description
constrainToHost boolean Whether window movement is strictly constrained inside host bounds.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::content()

Returns the hosted content widget.

Returns Widget: The hosted content widget..

WindowWidget::content(Widget)

Sets the hosted content widget.

Parameter Type Description
content Widget Content widget hosted inside.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::dockDocument(String, String, Widget)

Docks a document pane into this window's docking host.

Parameter Type Description
id String Unique string identifier.
title String Title string.
content Widget Content widget hosted inside.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::dockKind()

Returns the classification kind (DOCUMENT or TOOL) when docked.

Returns DockPaneKind: The dock pane kind configured for this window..

WindowWidget::dockKind(DockPaneKind)

Sets the docking classification kind.

Parameter Type Description
dockKind DockPaneKind Kind of the source dock pane.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::dockPane(DockPane)

Docks a pane into this window's embedded docking host.

Parameter Type Description
pane DockPane Dock pane instance.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::dockPaneId()

Returns the pane ID representing this window when docked.

Returns String: The string value..

WindowWidget::dockPaneId(String)

Sets the pane ID representing this window when docked.

Parameter Type Description
dockPaneId String Identifier of the source dock pane.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::dockPolicy()

Returns the docking policy (FULL, GUEST_ONLY, DISABLED).

Returns DockPolicy: The docking policy configured for this window..

WindowWidget::dockPolicy(DockPolicy)

Sets the docking integration policy.

Parameter Type Description
dockPolicy DockPolicy Docking placement policy.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::dockRedockLocked()

Returns true if redocking this window into other hosts is locked.

Returns boolean: True if redocking into the docking root is locked..

WindowWidget::dockRedockLocked(boolean)

Locks or unlocks redocking capability for this window.

Parameter Type Description
dockRedockLocked boolean Whether redocking back into the dock root is locked.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::dockSourceId()

Returns the source docking host ID if this window was torn off from a dock.

Returns String: The identifier of the source dock pane..

WindowWidget::dockSourcePane()

Returns the source DockPane representation when floating.

Returns DockPane: The source dock pane associated with this window..

WindowWidget::dockSourcePane(DockPane)

Sets the source DockPane representation.

Parameter Type Description
pane DockPane Dock pane instance.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::dockTool(String, String, Widget)

Docks a tool pane into this window's docking host.

Parameter Type Description
id String Unique string identifier.
title String Title string.
content Widget Content widget hosted inside.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::dockable()

Returns true if this window can be docked into an external host.

Returns boolean: True if the window can be docked..

WindowWidget::dockable(boolean)

Enables or disables docking capability.

Parameter Type Description
dockable boolean Whether the window can be docked into a docking container.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::dockingEnabled()

Returns true if docking features are actively enabled.

Returns boolean: True if docking features are enabled..

WindowWidget::dockingEnabled(boolean)

Enables or disables docking integration.

Parameter Type Description
dockingEnabled boolean Whether docking interactions are enabled for this window.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::dockingRoot()

Returns the internal DockingRoot hosted inside this window, or null.

Returns DockingRoot: The internal DockingRoot instance hosting dock panes for this window..

WindowWidget::draggable()

Returns true if window dragging by the header is enabled.

Returns boolean: True if the window can be dragged by its header..

WindowWidget::draggable(boolean)

Enables or disables window dragging.

Parameter Type Description
draggable boolean Whether the window can be moved by dragging its header.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::dragging()

Returns true if the window is currently being moved.

Returns boolean: True if the window is currently being dragged..

WindowWidget::ensureDockHost()

Initializes and returns an embedded DockingRoot instance as content.

Returns DockingRoot: The internal DockingRoot instance hosting dock panes for this window..

WindowWidget::fixedModal()

Returns true if the modal window is fixed and cannot be dragged.

Returns boolean: True if the modal window position is fixed in place..

WindowWidget::fixedModal(boolean)

Configures whether this modal window has a fixed non-draggable position.

Parameter Type Description
fixedModal boolean Whether the modal dialog position is locked in place.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::headerColor()

Returns the mutable background color of the title bar header.

Returns MutableColor: The mutable color instance..

WindowWidget::headerHeight()

Returns the title bar header height in UI pixels.

Returns float: The title bar header height..

WindowWidget::headerHeight(float)

Sets the title bar header height in UI pixels.

Parameter Type Description
headerHeight float Height of the title bar header in pixels.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::headerSeparatorColor()

Returns the mutable separator line color between header and content.

Returns MutableColor: The mutable color instance..

WindowWidget::icon()

Returns the title bar icon.

Returns UiIcon: The window title bar icon..

WindowWidget::icon(UiIcon)

Sets the title bar icon.

Parameter Type Description
icon UiIcon Icon displayed in the window title bar.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::lastDragRootX()

Returns the last pointer root X coordinate during dragging.

Returns float: The window coordinate position..

WindowWidget::lastDragRootY()

Returns the last pointer root Y coordinate during dragging.

Returns float: The window coordinate position..

WindowWidget::mergeDockingFrom(WindowWidget)

Merges docking panes from another window into this window's dock host.

Parameter Type Description
source WindowWidget Parameter value for source.

Returns boolean: True if docking state was successfully merged..

WindowWidget::minWindowSize(float, float)

Sets minimum width and height limits for window resizing.

Parameter Type Description
width float Width dimension in pixels.
height float Height dimension in pixels.

Returns WindowWidget: This widget instance for chaining..

Returns true if the window is modal, blocking interaction with windows below.

Returns boolean: True if the window is in modal mode..

WindowWidget::modal(boolean)

Configures modal behavior for this window.

Parameter Type Description
modal boolean Whether the window operates as a modal dialog blocking underlying content.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::open()

Opens the window.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::open(boolean)

Sets the open state of the window.

Parameter Type Description
open boolean Target open state flag.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::openModal()

Opens this window as a modal dialog.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::opened()

Returns true if the window is currently opened and active in the overlay.

Returns boolean: True if currently open..

WindowWidget::padding()

Returns the window content padding.

Returns EdgeInsets: The content padding insets..

WindowWidget::padding(EdgeInsets)

Sets the window content padding.

Parameter Type Description
padding EdgeInsets Internal content padding.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::position(float, float)

Sets the window coordinates in UI pixels.

Parameter Type Description
x float Horizontal X coordinate.
y float Vertical Y coordinate.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::releaseAutoDockHost()

Releases an automatically created docking host if empty.

WindowWidget::resizable()

Returns true if window border and grip resizing is enabled.

Returns boolean: True if the window boundaries are resizable..

WindowWidget::resizable(boolean)

Enables or disables border and grip resizing.

Parameter Type Description
resizable boolean Whether the window boundaries can be resized.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::resizeGrip()

Returns the active resize grip visual style.

Returns ResizeGripStyle: The corner resize grip visual style..

WindowWidget::resizeGrip(ResizeGripStyle)

Sets the corner resize grip visual style.

Parameter Type Description
resizeGrip ResizeGripStyle Visual style of the corner resize grip.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::resizeGripVisible()

Returns true if the corner resize grip is rendered.

Returns boolean: True if the corner resize grip is visible..

WindowWidget::resizeGripVisible(boolean)

Sets whether the corner resize grip is visible.

Parameter Type Description
visible boolean Target visibility flag.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::resizeHandle()

Returns the name of the active resize handle (e.g. BOTTOM_RIGHT).

Returns String: The currently hovered resize edge or corner identifier..

WindowWidget::resizing()

Returns true if the window is actively being resized.

Returns boolean: True if the window is currently being resized..

WindowWidget::richTitle()

Returns the RichText formatted title component.

Returns RichText: The RichText formatted title component..

WindowWidget::richTitle(RichText)

Sets the RichText formatted title component.

Parameter Type Description
title RichText RichText formatted title component.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::theme()

Returns the active DockTheme applied to window chrome.

Returns DockTheme: The DockTheme value..

WindowWidget::theme(DockTheme)

Applies a custom DockTheme to window chrome and controls.

Parameter Type Description
theme DockTheme Dock theme configuration.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::title()

Returns the window title string.

Returns String: The title text string..

WindowWidget::title(String)

Sets the window plain-text title.

Parameter Type Description
title String Title string.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::titleColor()

Returns the mutable title text color.

Returns MutableColor: The mutable color instance..

WindowWidget::toggle()

Toggles between open and closed states.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::toggleCollapsed()

Toggles collapsed state between full and header-only.

Returns WindowWidget: This widget instance for chaining..

WindowWidget::windowX()

Returns the window horizontal X coordinate.

Returns float: The window coordinate position..

WindowWidget::windowY()

Returns the window vertical Y coordinate.

Returns float: The window coordinate position..