Class AbstractBindingHelper<T>
- Type Parameters:
T-
- Direct Known Subclasses:
BiBindingHelper,BindingHelper
- The 'target', which is the property that will be updated when the source changes
- The action to perform to update the target (also called targetUpdater), it's a BiConsumer that offers both the oldValue and the newValue
- A listener called 'sourceListener', which is added to the source property and triggers the updateTarget(ObservableValue, Object, Object)
- Abstract base methods to: 'bind' the target to the source, specify the targetUpdater, allow to 'invalidate' the binding and cause computations specified by the helper subclass, specify how to 'dispose' the helper and check if it's been disposed before
- The method responsible for updating the target (triggered by the sourceListener)
- The actions to perform: before/after the target update, before/after the binding, before/after the unbinding
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ChangeListener<? super T>protected ObservableValue<? extends T>protected BiConsumer<T,T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidEmpty by default.protected voidEmpty by default.protected voidEmpty by default.protected voidEmpty by default.protected voidEmpty by default.protected voidEmpty by default.abstract AbstractBindingHelper<T>bind(ObservableValue<? extends T> target) abstract voiddispose()abstract voidabstract booleanprotected voidupdateTarget(ObservableValue<? extends T> source, T oldValue, T newValue) Invoked by the sourceListener, it's responsible for updating the specified target using the specified targetUpdaterBiConsumer.abstract AbstractBindingHelper<T>with(BiConsumer<T, T> targetUpdater)
-
Field Details
-
target
-
targetUpdater
-
sourceListener
-
-
Constructor Details
-
AbstractBindingHelper
public AbstractBindingHelper()
-
-
Method Details
-
bind
-
with
-
invalidate
public abstract void invalidate() -
dispose
public abstract void dispose() -
isDispose
public abstract boolean isDispose() -
updateTarget
Invoked by the sourceListener, it's responsible for updating the specified target using the specified targetUpdaterBiConsumer.Also calls
beforeUpdateTarget()andafterUpdateTarget().- Parameters:
source- the source propertyoldValue- the source's oldValuenewValue- the source's newValue
-
beforeUpdateTarget
protected void beforeUpdateTarget()Empty by default. -
afterUpdateTarget
protected void afterUpdateTarget()Empty by default. -
beforeBind
protected void beforeBind()Empty by default. -
afterBind
protected void afterBind()Empty by default. -
beforeUnbind
protected void beforeUnbind()Empty by default. -
afterUnbind
protected void afterUnbind()Empty by default.
-