TitledPane
Combines a title
, and content
. The title
is displayed above the content
.
If the title
is clicked, the content
is hidden, and revealed when the title
is clicked again. This behaviour can be disabled by setting collapsable to false.
Note, this is structured differently to JavaFX, which extends Labelled. Glok's TitledPane is composed of a ButtonBase, and another content.
TitledPane implements Toggle, and can therefore be part of a ToggleGroup, where only one TitledPane is expanded at any time. If many TitledPanes are added to a VBox, then clicking one title will expand its content, and contract the previously expanded TitlePane. This is the same behaviour as JavaFX's Accordion
.
Theme DSL
"titled_pane" {
collapsable( value : Boolean )
expanded( value : Boolean )
":expanded" { ... } // Pseudo styles, either one
":contracted" { ... } // or the other are present.
child( ".title" ) {
// a ButtonBase
}
child( "single_container" ) {
// a SingleContainer
child {
// The `content` node
}
}
}
The child title
is a ButtonBase. The other child is a SingleContainer.
TitledPane inherits all the features of Region.
Properties
The base class Node has no children, so this is an empty list.
A synonym of expanded.
Part of the Toggle interface, so that TitledPanes can be grouped by a ToggleGroup, where only one TitledPane is expanded at any time.
Functions
The default implementation returns NO_MAXIMUM (an arbitrary large number : 100,000).
The default implementation returns NO_MAXIMUM (an arbitrary large number : 100,000).
Each subclass of node can determine the minimum width it requires. This can be overridden on an ad-hoc basis using overrideMinHeight. The default implementation returns 0.
Each subclass of node can determine the minimum width it requires. This can be overridden on an ad-hoc basis using overrideMinWidth. The default implementation returns 0.
Each subclass of node can determine its preferred height. As most nodes are composed of smaller nodes, this is typically calculated using evalPrefWidth of the child nodes, with extra added for spacing, padding and borders.
Each subclass of node can determine its preferred width. As most nodes are composed of smaller nodes, this is typically calculated using evalPrefWidth of the child nodes, with extra added for spacing, padding and borders.