Module MaterialFX

Class BindingManager

java.lang.Object
io.github.palexdev.materialfx.bindings.BindingManager

public class BindingManager extends Object
This singleton class manages unidirectional bindings.

All bindings are stored in a map which associates the target property to a BindingHelper. For unidirectional bindings a given target property will always have one and only helper at any time.

When a binding is not necessary anymore it's opportune to dispose it either with dispose() or unbind(ObservableValue).

This mechanism is so flexible that it also allows to bind read-only properties on the sole condition that you must have a way to set that property and it must be specified with BindingBuilder.with(BiConsumer).

For these properties be careful during the unbind as in JavaFX the getReadOnlyProperty() method returns a completely different instance. For this reason the manager also offers unbind methods to unbind read-only wrappers.

To make the bindings building more readable it uses BindingBuilder.