tornadofx / tornadofx / javafx.beans.property.Property

Extensions for javafx.beans.property.Property

addValidator fun <T> Property<T>.addValidator(node: Node, trigger: ValidationTrigger = ValidationTrigger.OnChange(), validator: ValidationContext.(T?) -> ValidationMessage?): <ERROR CLASS>

Add the given validator to a property that resides inside a ViewModel. The supplied node will be decorated by the current decorationProvider for this context inside the ViewModel of the property if validation fails.

cleanBind fun <T> Property<T>.cleanBind(observable: ObservableValue<T>): Unit

Binds this property to an observable, automatically unbinding it before if already bound.

isDirty val <T> Property<T>.isDirty: Boolean

Check if a given property from the ViewModel is dirty. This is a shorthand form of:

isNotDirty val <T> Property<T>.isNotDirty: Boolean
markDirty fun Property<*>.markDirty(): Unit?

Mark this ViewModel facade property as dirty in its owning ViewModel.

mutateOnChange fun <T> Property<T>.mutateOnChange(mutator: (T?) -> T?): <ERROR CLASS>

Listen to changes and update the value of the property if the given mutator results in a different value

setValue operator fun <T> Property<T>.setValue(thisRef: Any, property: KProperty<*>, value: T?): Unit
viewModel val Property<*>.viewModel: ViewModel?

Extract the ViewModel from a property that is bound towards a ViewModel Facade