TitledPane

class TitledPane(title: String, content: Node?) : Region, Toggle, WithContent

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.

Constructors

Link copied to clipboard
constructor(title: String)
constructor(title: String, content: Node?)

Types

Link copied to clipboard
inner class Title : ButtonBase

Properties

Link copied to clipboard
open override val children: ObservableList<Node>

The base class Node has no children, so this is an empty list.

Link copied to clipboard
Link copied to clipboard
open override var content: Node?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override var selected: Boolean
Link copied to clipboard

A synonym of expanded.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Part of the Toggle interface, so that TitledPanes can be grouped by a ToggleGroup, where only one TitledPane is expanded at any time.

Link copied to clipboard
open override var userData: Any?

Part of the Toggle interface. Holds arbitrary data

Functions

Link copied to clipboard
open override fun nodeMaxHeight(): Float

The default implementation returns NO_MAXIMUM (an arbitrary large number : 100,000).

Link copied to clipboard
open override fun nodeMaxWidth(): Float

The default implementation returns NO_MAXIMUM (an arbitrary large number : 100,000).

Link copied to clipboard
open override fun nodeMinHeight(): Float

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.

Link copied to clipboard
open override fun nodeMinWidth(): Float

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.

Link copied to clipboard
open override fun nodePrefHeight(): Float

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.

Link copied to clipboard
open override fun nodePrefWidth(): Float

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.

Link copied to clipboard
open override fun toString(): String