tornadofx / tornadofx / javafx.scene.control.TreeView

Extensions for javafx.scene.control.TreeView

bindSelected fun <T> TreeView<T>.bindSelected(property: Property<T>): Unitfun <T> TreeView<T>.bindSelected(model: ItemViewModel<T>): Unit

Binds the currently selected object of type T in the given TreeView to the corresponding ItemViewModel.

cellDecorator fun <S> TreeView<S>.cellDecorator(decorator: TreeCell<S>.(S) -> Unit): Unit
cellFormat fun <S> TreeView<S>.cellFormat(scope: Scope = FX.defaultScope, formatter: TreeCell<S>.(S) -> Unit): Unit
cellFragment fun <T, F : TreeCellFragment<T>> TreeView<T>.cellFragment(scope: Scope = FX.defaultScope, fragment: KClass<F>): Unit

Registers a Fragment which should be used to represent a TreeItem for the given TreeView.

lazyPopulate fun <T : Any> TreeView<T>.lazyPopulate(leafCheck: (LazyTreeItem<T>) -> Boolean = { !it.hasChildren() }, itemProcessor: (LazyTreeItem<T>) -> Unit = {}, childFactory: (TreeItem<T>) -> List<T>?): Unit
multiSelect fun <T> TreeView<T>.multiSelect(enable: Boolean = true): Unit
onUserDelete fun <T> TreeView<T>.onUserDelete(action: (T) -> Unit): Unit
onUserSelect fun <T> TreeView<T>.onUserSelect(action: (T) -> Unit): Unit
populate fun <T> TreeView<T>.populate(itemFactory: (T) -> TreeItem<T> = { TreeItem(it) }, childFactory: (TreeItem<T>) -> Iterable<T>?): Unit
selectFirst fun <T> TreeView<T>.selectFirst(): Unit

This functions is the same as calling.

selectedValue val <T> TreeView<T>.selectedValue: T?

Returns the currently selected value of type T (which is currently the selected value represented by the current selection model). If there are multiple values selected, it will return the most recently selected value.