TabBar

class TabBar : Region

A list of Tabs displayed in a row or column.

Clicking on a Tab sets currentContent to that tab's Tab.content and nothing more. The content is NOT part of the TabBar. To see the tab's contents, use a SingleContainer, and bind its SingleContainer.contentProperty to TabBar.currentContent. The pair will then act as a traditional tab-pane.

TabPane combines a TabBar and a SingleContainer, but greater flexibility can be had by keeping them separate. (and not using a TabPane).

For example

lateinit var tabBar: TabBar
borderPane {
    top {
        toolBar {
            items {
                tabBar {
                    tabs {
                        tab("Hello") {
                            content { label("Greetings") }
                        }
                        tab("World") {
                            content { label("World's content") }
                        }
                    }
                }
                // This is impossible with a regular TabPane.
                button( "Add Tab" )
                button( "Tabs Settings" )
            }
        }
    }
    center {
        singleContainer(tabBar.currentContentProperty)
    }
}

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
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
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var side: Side
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Nodes which appear in the ToolBar. Most commonly Buttons, but can be any Nodes.

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
operator fun Tab.unaryPlus()

Syntactic sugar for adding a Tab