ListView
type (joe.win
)
Extends: Control
The ListView
type is a JavaFX scrolling list widget.
Joe classes can extend the ListView
type.
- listView.getItems() → joe.List
- listView.getSelectedIndex() → joe.Number
- listView.getSelectedItem() → item
- listView.item(item) → this
- listView.items(list) → this
- listView.onSelect(callable) → this
- listView.placeholder(node) → this
- listView.placeholderText(text) → this
- listView.selectIndex(index) → this
- listView.selectItem(item) → this
- listView.stringifier(callable) → this
Control Methods
- control.tooltip(tooltip) → this
- control.tooltipText(text) → this
Region Methods
- region.height(height) → this
- region.padding(pixels) → this
- region.padding(top, right, bottom, left) → this
- region.prefHeight(height) → this
- region.prefWidth(width) → this
- region.width(width) → this
Node Methods
- node.disable([flag]) → this
- node.getProperty(keyword) → value
- node.gridColumn(index) → this
- node.gridColumnSpan(span) → this
- node.gridHalignment(hpos) → this
- node.gridHgrow([priority]) → this
- node.gridMargin(insets) → this
- node.gridRow(index) → this
- node.gridRowSpan(span) → this
- node.gridValignment(vpos) → this
- node.gridVgrow([priority]) → this
- node.hgrow([priority]) → this
- node.id(id) → this
- node.isDisabled() → joe.Boolean
- node.listenTo(keyword, listener) → this
- node.properties() → joe.Set
- node.setProperty(keyword, value) → this
- node.splitResizeWithParent(flag) → this
- node.styleClasses() → joe.List
- node.styles(style, ...) → this
- node.toString() → joe.String
- node.vgrow([priority]) → this
Properties
ListViewInstance
widgets have the following properties, in addition to
those inherited from superclasses.
Property | Type | Description |
---|---|---|
#placeholder | Node | Empty 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.