SingleSelectionModel

The selection model used by ListView and TreeView.

NOTE. selectedIndexProperty and selectedItemProperty should change atomically. i.e. when one value changes, the other value must change too, without a period of time when the application can see an inconstancy between them.

T is the type of the elements in the items. If T is nullable, then extra care must be taken when using selectedItem. Change the selection to none, by setting selectedIndex to -1, rather than setting selectedItem to null. When reading selectedIndex, a null value has an indeterminate meaning (either no selection, or null is selected).

Constructors

Link copied to clipboard
constructor(items: ObservableList<T>)

Properties

Link copied to clipboard
Link copied to clipboard

Either -1 (nothing is selected) or the index of the selected item.

Link copied to clipboard
Link copied to clipboard

Either null (when nothing is selected), or the selected item.