SelectableItem

open class SelectableItem(mutableState: MutableState<Boolean>, onUpdated: (Boolean) -> Unit? = null) : ObservableProperty<Boolean> (source)

Represents an item that can be selected or deselected. This class extends {@link ObservableProperty} to provide observable behavior for its selection state.

Parameters

mutableState

The underlying {@link MutableState} that holds the selection state.

onUpdated

An optional callback that is invoked when the selection state is updated.

Inheritors

Constructors

Link copied to clipboard
constructor(mutableState: MutableState<Boolean>, onUpdated: (Boolean) -> Unit? = null)

Properties

Link copied to clipboard

true if this item is selected, false otherwise. This property reflects the current state of the item's selection.

Functions

Link copied to clipboard
fun registerAfterChangeUpdateListener(onValueUpdateListener: (isSelected: Boolean) -> Unit): DisposableHandle

Registers a listener to be notified after the selection state changes.

Link copied to clipboard
fun registerBeforeChangeUpdateListener(onValueUpdateListener: (isSelected: Boolean) -> Boolean): DisposableHandle

Registers a listener to be notified before the selection state changes. This listener can prevent the change from occurring by returning false.