Class Dockable
java.lang.Object
com.dlsc.gemsfx.docking.Dockable
Represents a dockable component with an ID, a mutable display title and optional graphic, and a content node.
-
Property Summary
PropertiesTypePropertyDescriptionfinal javafx.beans.property.BooleanPropertyWhether this dockable can be closed through normal close requests.final javafx.beans.property.ReadOnlyObjectProperty<javafx.scene.Node> The optional graphic displayed in this dockable's tab, ornullfor no graphic.final javafx.beans.property.ObjectProperty<BooleanSupplier> The optional callback invoked on a normal close request after close permissions are checked.final javafx.beans.property.ObjectProperty<Runnable> The optional callback invoked when help is requested for this dockable.final javafx.beans.property.ObjectProperty<DockingSize> The preferred size when this dockable opens or moves into a new side split, including drops.final javafx.beans.property.BooleanPropertyWhether the user can edit the title by double-clicking the defaultDockingTab.final javafx.beans.property.ReadOnlyStringPropertyThe display title property.final javafx.beans.property.ObjectProperty<javafx.scene.Node> The optional toolbar displayed to the left of the menu, help and close buttons in the defaultDockingTab. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal javafx.beans.property.BooleanPropertyWhether this dockable can be closed through normal close requests.protected voiddispose()Releases resources after this dockable is removed from its docking context.javafx.scene.NodeReturns the content node of this Dockable.Returns the pane currently hosting this dockable, even when its content is not selected.final javafx.scene.NodeGets the value of thegraphicproperty.getId()Returns the unique identifier of this Dockable.final javafx.collections.ObservableList<javafx.scene.control.MenuItem> Returns the live list of actions displayed in the defaultDockingTab's More dropdown.final BooleanSupplierGets the value of theonCloseRequestproperty.final RunnableGets the value of theonHelpproperty.final DockingSizeGets the value of thepreferredDockingSizeproperty.javafx.scene.ScenegetScene()Returns the scene containing the hosting pane.javafx.stage.StagegetStage()Returns the stage containing the hosting pane.final StringgetTitle()Gets the value of thetitleproperty.final javafx.scene.NodeGets the value of thetoolbarproperty.final javafx.beans.property.ReadOnlyObjectProperty<javafx.scene.Node> The optional graphic displayed in this dockable's tab, ornullfor no graphic.final booleanGets the value of thecloseableproperty.final booleanGets the value of thetitleEditableproperty.final javafx.beans.property.ObjectProperty<BooleanSupplier> The optional callback invoked on a normal close request after close permissions are checked.final javafx.beans.property.ObjectProperty<Runnable> The optional callback invoked when help is requested for this dockable.final javafx.beans.property.ObjectProperty<DockingSize> The preferred size when this dockable opens or moves into a new side split, including drops.final voidsetCloseable(boolean closeable) Sets the value of thecloseableproperty.final voidsetGraphic(javafx.scene.Node graphic) Sets the value of thegraphicproperty.final voidsetOnCloseRequest(BooleanSupplier onCloseRequest) Sets the value of theonCloseRequestproperty.final voidSets the value of theonHelpproperty.final voidSets the value of thepreferredDockingSizeproperty.final voidSets the value of thetitleproperty.final voidsetTitleEditable(boolean titleEditable) Sets the value of thetitleEditableproperty.final voidsetToolbar(javafx.scene.Node toolbar) Sets the value of thetoolbarproperty.final javafx.beans.property.BooleanPropertyWhether the user can edit the title by double-clicking the defaultDockingTab.final javafx.beans.property.ReadOnlyStringPropertyThe display title property.final javafx.beans.property.ObjectProperty<javafx.scene.Node> The optional toolbar displayed to the left of the menu, help and close buttons in the defaultDockingTab.
-
Property Details
-
title
public final javafx.beans.property.ReadOnlyStringProperty titlePropertyThe display title property. The property is read-only; usesetTitle(String)to change the title.- See Also:
-
titleEditable
public final javafx.beans.property.BooleanProperty titleEditablePropertyWhether the user can edit the title by double-clicking the defaultDockingTab. Defaults totrue. Setting this tofalsecancels an active title edit; programmatic changes throughsetTitle(String)remain allowed.- See Also:
-
closeable
public final javafx.beans.property.BooleanProperty closeablePropertyWhether this dockable can be closed through normal close requests. Defaults totrue. The default tab hides its close button when this property isfalse. Layout restore and teardown of an already hidden window can still remove the dockable.- See Also:
-
preferredDockingSize
The preferred size when this dockable opens or moves into a new side split, including drops. Left/right docking uses width; top/bottom docking uses height. Weights are relative to the entire destination pane. Requests are constrained by available space and the content's minimum sizes. Anullvalue keeps the default equal split. Center/tab insertion and layout restore ignore this preference; changing it does not resize an already docked group. Pixel sizes are applied once the pane is measured, not maintained during later resizes. The resulting divider positions, rather than this preference, are saved in the layout. Moving a whole tab group uses its selected tab's preference. For external drags, the size becomes known only when the drop factory creates the dockable; the preceding preview uses the default size.- See Also:
-
onCloseRequest
The optional callback invoked on a normal close request after close permissions are checked. Returnfalseto veto the request ortrueto allow it. Anullcallback allows the request. The callback runs on the JavaFX application thread and is not invoked by permission queries, layout restore, or teardown of an already hidden window.- See Also:
-
graphic
public final javafx.beans.property.ReadOnlyObjectProperty<javafx.scene.Node> graphicPropertyThe optional graphic displayed in this dockable's tab, ornullfor no graphic. The property is read-only; usesetGraphic(Node)to replace or remove the graphic.- See Also:
-
toolbar
public final javafx.beans.property.ObjectProperty<javafx.scene.Node> toolbarPropertyThe optional toolbar displayed to the left of the menu, help and close buttons in the defaultDockingTab. Defaults tonull. Changes replace or remove the displayed toolbar immediately. The toolbar shares the action buttons' hover fade.- See Also:
-
onHelp
The optional callback invoked when help is requested for this dockable. Defaults tonull, hiding the help button in the defaultDockingTab. Changes update the button's availability immediately; the callback runs on the JavaFX application thread when the user activates the button.- See Also:
-
-
Constructor Details
-
Dockable
Constructs a Dockable without a graphic.- Parameters:
id- the unique identifier, must not be null or blanktitle- the display title, must not be null or blankcontent- the content node, must not be null- Throws:
IllegalArgumentException- if id or title is null/blank, or content is null
-
Dockable
Constructs a Dockable with an optional graphic.- Parameters:
id- the unique identifier, must not be null or blanktitle- the display title, must not be null or blankgraphic- the optional icon/graphic, may be nullcontent- the content node, must not be null- Throws:
IllegalArgumentException- if id or title is null/blank, or content is null
-
-
Method Details
-
getId
-
getDockingPane
Returns the pane currently hosting this dockable, even when its content is not selected.- Returns:
- the hosting pane, or
nullif this dockable is not open
-
getScene
public javafx.scene.Scene getScene()Returns the scene containing the hosting pane.- Returns:
- the hosting scene, or
nullif there is no hosting pane or scene
-
getStage
public javafx.stage.Stage getStage()Returns the stage containing the hosting pane.- Returns:
- the hosting stage, or
nullif there is no scene or its window is not a stage
-
titleProperty
public final javafx.beans.property.ReadOnlyStringProperty titleProperty()The display title property. The property is read-only; usesetTitle(String)to change the title.- Returns:
- the title property
- See Also:
-
getTitle
Gets the value of thetitleproperty.- Property description:
- The display title property. The property is read-only; use
setTitle(String)to change the title. - Returns:
- the value of the
titleproperty - See Also:
-
setTitle
Sets the value of thetitleproperty.- Property description:
- The display title property. The property is read-only; use
setTitle(String)to change the title. - Parameters:
title- the value for thetitleproperty- See Also:
-
titleEditableProperty
public final javafx.beans.property.BooleanProperty titleEditableProperty()Whether the user can edit the title by double-clicking the defaultDockingTab. Defaults totrue. Setting this tofalsecancels an active title edit; programmatic changes throughsetTitle(String)remain allowed.- Returns:
- the title editing permission property
- See Also:
-
isTitleEditable
public final boolean isTitleEditable()Gets the value of thetitleEditableproperty.- Property description:
- Whether the user can edit the title by double-clicking the default
DockingTab. Defaults totrue. Setting this tofalsecancels an active title edit; programmatic changes throughsetTitle(String)remain allowed. - Returns:
- the value of the
titleEditableproperty - See Also:
-
setTitleEditable
public final void setTitleEditable(boolean titleEditable) Sets the value of thetitleEditableproperty.- Property description:
- Whether the user can edit the title by double-clicking the default
DockingTab. Defaults totrue. Setting this tofalsecancels an active title edit; programmatic changes throughsetTitle(String)remain allowed. - Parameters:
titleEditable- the value for thetitleEditableproperty- See Also:
-
closeableProperty
public final javafx.beans.property.BooleanProperty closeableProperty()Whether this dockable can be closed through normal close requests. Defaults totrue. The default tab hides its close button when this property isfalse. Layout restore and teardown of an already hidden window can still remove the dockable.- Returns:
- the close permission property
- See Also:
-
isCloseable
public final boolean isCloseable()Gets the value of thecloseableproperty.- Property description:
- Whether this dockable can be closed through normal close requests. Defaults to
true. The default tab hides its close button when this property isfalse. Layout restore and teardown of an already hidden window can still remove the dockable. - Returns:
- the value of the
closeableproperty - See Also:
-
setCloseable
public final void setCloseable(boolean closeable) Sets the value of thecloseableproperty.- Property description:
- Whether this dockable can be closed through normal close requests. Defaults to
true. The default tab hides its close button when this property isfalse. Layout restore and teardown of an already hidden window can still remove the dockable. - Parameters:
closeable- the value for thecloseableproperty- See Also:
-
preferredDockingSizeProperty
The preferred size when this dockable opens or moves into a new side split, including drops. Left/right docking uses width; top/bottom docking uses height. Weights are relative to the entire destination pane. Requests are constrained by available space and the content's minimum sizes. Anullvalue keeps the default equal split. Center/tab insertion and layout restore ignore this preference; changing it does not resize an already docked group. Pixel sizes are applied once the pane is measured, not maintained during later resizes. The resulting divider positions, rather than this preference, are saved in the layout. Moving a whole tab group uses its selected tab's preference. For external drags, the size becomes known only when the drop factory creates the dockable; the preceding preview uses the default size.- Returns:
- the preferred docking size property
- See Also:
-
getPreferredDockingSize
Gets the value of thepreferredDockingSizeproperty.- Property description:
- The preferred size when this dockable opens or moves into a new side split, including drops.
Left/right docking uses width; top/bottom docking uses height. Weights are relative to the
entire destination pane. Requests are constrained by available space and the content's
minimum sizes. A
nullvalue keeps the default equal split. Center/tab insertion and layout restore ignore this preference; changing it does not resize an already docked group. Pixel sizes are applied once the pane is measured, not maintained during later resizes. The resulting divider positions, rather than this preference, are saved in the layout. Moving a whole tab group uses its selected tab's preference. For external drags, the size becomes known only when the drop factory creates the dockable; the preceding preview uses the default size. - Returns:
- the value of the
preferredDockingSizeproperty - See Also:
-
setPreferredDockingSize
Sets the value of thepreferredDockingSizeproperty.- Property description:
- The preferred size when this dockable opens or moves into a new side split, including drops.
Left/right docking uses width; top/bottom docking uses height. Weights are relative to the
entire destination pane. Requests are constrained by available space and the content's
minimum sizes. A
nullvalue keeps the default equal split. Center/tab insertion and layout restore ignore this preference; changing it does not resize an already docked group. Pixel sizes are applied once the pane is measured, not maintained during later resizes. The resulting divider positions, rather than this preference, are saved in the layout. Moving a whole tab group uses its selected tab's preference. For external drags, the size becomes known only when the drop factory creates the dockable; the preceding preview uses the default size. - Parameters:
size- the value for thepreferredDockingSizeproperty- See Also:
-
onCloseRequestProperty
The optional callback invoked on a normal close request after close permissions are checked. Returnfalseto veto the request ortrueto allow it. Anullcallback allows the request. The callback runs on the JavaFX application thread and is not invoked by permission queries, layout restore, or teardown of an already hidden window.- Returns:
- the close request callback property
- See Also:
-
getOnCloseRequest
Gets the value of theonCloseRequestproperty.- Property description:
- The optional callback invoked on a normal close request after close permissions are checked.
Return
falseto veto the request ortrueto allow it. Anullcallback allows the request. The callback runs on the JavaFX application thread and is not invoked by permission queries, layout restore, or teardown of an already hidden window. - Returns:
- the value of the
onCloseRequestproperty - See Also:
-
setOnCloseRequest
Sets the value of theonCloseRequestproperty.- Property description:
- The optional callback invoked on a normal close request after close permissions are checked.
Return
falseto veto the request ortrueto allow it. Anullcallback allows the request. The callback runs on the JavaFX application thread and is not invoked by permission queries, layout restore, or teardown of an already hidden window. - Parameters:
onCloseRequest- the value for theonCloseRequestproperty- See Also:
-
graphicProperty
public final javafx.beans.property.ReadOnlyObjectProperty<javafx.scene.Node> graphicProperty()The optional graphic displayed in this dockable's tab, ornullfor no graphic. The property is read-only; usesetGraphic(Node)to replace or remove the graphic.- Returns:
- the graphic property
- See Also:
-
getGraphic
public final javafx.scene.Node getGraphic()Gets the value of thegraphicproperty.- Property description:
- The optional graphic displayed in this dockable's tab, or
nullfor no graphic. The property is read-only; usesetGraphic(Node)to replace or remove the graphic. - Returns:
- the value of the
graphicproperty - See Also:
-
setGraphic
public final void setGraphic(javafx.scene.Node graphic) Sets the value of thegraphicproperty.- Property description:
- The optional graphic displayed in this dockable's tab, or
nullfor no graphic. The property is read-only; usesetGraphic(Node)to replace or remove the graphic. - Parameters:
graphic- the value for thegraphicproperty- See Also:
-
toolbarProperty
public final javafx.beans.property.ObjectProperty<javafx.scene.Node> toolbarProperty()The optional toolbar displayed to the left of the menu, help and close buttons in the defaultDockingTab. Defaults tonull. Changes replace or remove the displayed toolbar immediately. The toolbar shares the action buttons' hover fade.- Returns:
- the toolbar property
- See Also:
-
getToolbar
public final javafx.scene.Node getToolbar()Gets the value of thetoolbarproperty.- Property description:
- The optional toolbar displayed to the left of the menu, help and close buttons in the default
DockingTab. Defaults tonull. Changes replace or remove the displayed toolbar immediately. The toolbar shares the action buttons' hover fade. - Returns:
- the value of the
toolbarproperty - See Also:
-
setToolbar
public final void setToolbar(javafx.scene.Node toolbar) Sets the value of thetoolbarproperty.- Property description:
- The optional toolbar displayed to the left of the menu, help and close buttons in the default
DockingTab. Defaults tonull. Changes replace or remove the displayed toolbar immediately. The toolbar shares the action buttons' hover fade. - Parameters:
toolbar- the value for thetoolbarproperty- See Also:
-
getMenuItems
public final javafx.collections.ObservableList<javafx.scene.control.MenuItem> getMenuItems()Returns the live list of actions displayed in the defaultDockingTab's More dropdown. The list is initially empty, hiding the menu button without reserving layout space. Adding, removing or reordering items updates the dropdown immediately. Each menu item should belong to only one dockable.- Returns:
- the modifiable menu item list
-
onHelpProperty
The optional callback invoked when help is requested for this dockable. Defaults tonull, hiding the help button in the defaultDockingTab. Changes update the button's availability immediately; the callback runs on the JavaFX application thread when the user activates the button.- Returns:
- the help callback property
- See Also:
-
getOnHelp
Gets the value of theonHelpproperty.- Property description:
- The optional callback invoked when help is requested for this dockable.
Defaults to
null, hiding the help button in the defaultDockingTab. Changes update the button's availability immediately; the callback runs on the JavaFX application thread when the user activates the button. - Returns:
- the value of the
onHelpproperty - See Also:
-
setOnHelp
Sets the value of theonHelpproperty.- Property description:
- The optional callback invoked when help is requested for this dockable.
Defaults to
null, hiding the help button in the defaultDockingTab. Changes update the button's availability immediately; the callback runs on the JavaFX application thread when the user activates the button. - Parameters:
onHelp- the value for theonHelpproperty- See Also:
-
getContent
public javafx.scene.Node getContent()Returns the content node of this Dockable.- Returns:
- the content
-
dispose
protected void dispose()Releases resources after this dockable is removed from its docking context. Subclasses may override this method; it is not called when the dockable merely moves between panes. If the same instance is reopened, it can be disposed again when subsequently removed.
-