ListView type (joe.win)


Extends: Control

The ListView type is a JavaFX scrolling list widget. Joe classes can extend the ListView type.

Initializer

Methods

Control Methods

Region Methods

Node Methods

Properties

ListViewInstance widgets have the following properties, in addition to those inherited from superclasses.

PropertyTypeDescription
#placeholderNodeEmpty list message

ListView Initializer


ListView() → ListView

Returns a ListView.

Methods


listView.getItems()


listView.getItems() → joe.List

Gets the list of the widget's items, which can be updated freely.

listView.getSelectedIndex()


listView.getSelectedIndex() → joe.Number

Gets the index of the selected item, or -1 if there is no selection.

listView.getSelectedItem()


listView.getSelectedItem() → item

Gets the selected item, or null if there is no selection.

listView.item()


listView.item(item) → this

Adds a value to the widget's list of items.

listView.items()


listView.items(list) → this

Adds the contents of the list to the widgets list of items.

listView.onSelect()


listView.onSelect(callable) → this

Specifies a callable to be called when the user selects an item in the list. The callable must take one argument, the ListView itself.

listView.placeholder()


listView.placeholder(node) → this

Sets the widget's placeholder graphic, a Node to display when the widget's items() list is empty.

listView.placeholderText()


listView.placeholderText(text) → this

Sets the widget's placeholder graphic to a label displaying the given text. The placeholder is shown when the widget's items() list is empty.

listView.selectIndex()


listView.selectIndex(index) → this

Selects the item at the given index. Throws an error if the index is not in range.

listView.selectItem()


listView.selectItem(item) → this

Selects the given item. The call is a no-op if the item isn't contained in the widget's list of items.

listView.stringifier()


listView.stringifier(callable) → this

Sets the widget's stringifier to the given callable, which must take one argument, a list item, and return a string representation for that item.