ChoiceBox
A ChoiceBox, has a list of items (of type V), one of which can be selected. (selection is a SingleSelectionModel).
When the ChoiceBox is pressed a PopupMenu appears, which contains all items as ToggleMenuItems. The selected item will have a tick-mark.
The text within the ChoiceBox and the ToggleMenuItems are generated from items using the converter. The default behaviour simply uses .toString()
, unless the selected item is null
, in which case nullString is used (which defaults to "
Theme DSL
"choice_box" {
"nullString"( String ) // What to display for `null` items. Defaults to ""
child( "button" ) {
... // The default theme places a `down` arrow graphic on the right hand side.
}
}
Properties
The base class Node has no children, so this is an empty list.
The string returned by the default converter for null
items. At present Glok has no I18N, and this is the English text "
Functions
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.