Module MaterialFX
Class SynchronizedObjectProperty<T>
java.lang.Object
javafx.beans.binding.ObjectExpression<T>
javafx.beans.property.ReadOnlyObjectProperty<T>
javafx.beans.property.ObjectProperty<T>
javafx.beans.property.ObjectPropertyBase<T>
javafx.beans.property.SimpleObjectProperty<T>
javafx.beans.property.ReadOnlyObjectWrapper<T>
io.github.palexdev.materialfx.beans.properties.synced.SynchronizedObjectProperty<T>
- Type Parameters:
T- the type of the wrapped Object
- All Implemented Interfaces:
SynchronizedProperty<T>,Observable,Property<T>,ReadOnlyProperty<T>,ObservableObjectValue<T>,ObservableValue<T>,WritableObjectValue<T>,WritableValue<T>
public class SynchronizedObjectProperty<T>
extends ReadOnlyObjectWrapper<T>
implements SynchronizedProperty<T>
Implementation of
SynchronizedProperty for generic values.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.palexdev.materialfx.beans.properties.base.SynchronizedProperty
SynchronizedProperty.Helper -
Constructor Summary
ConstructorsConstructorDescriptionSynchronizedObjectProperty(Object bean, String name) SynchronizedObjectProperty(Object bean, String name, T initialValue) SynchronizedObjectProperty(T initialValue) -
Method Summary
Modifier and TypeMethodDescriptionvoidawake()Awakes the property by settingSynchronizedProperty.waiting()to false.voidbind(ObservableValue<? extends T> source) Creates a unidirectional bindings with the given observable.voidbindBidirectional(Property<T> other) Creates a bidirectional bindings between this property and the given property.voidDelegate method forBiBindingManager.disposeFor(ObservableValue).protected voidbooleanisBound()Overridden to check theBindingManager.isBound(ObservableValue)flag value andBindingManager.isIgnoreBinding(ObservableValue).booleanvoidsetAndWait(T value, ObservableValue<?> observable) Sets this property's state to "waiting" then usesExecutionUtils.executeWhen(Observable, Runnable, boolean, Supplier, boolean)to "awake" the property when the given observable changes.voidunbind()Overridden to callBindingManager.unbind(ObservableValue).voidunbindBidirectional(Property<T> other) Overridden to callBiBindingManager.unbind(ObservableValue, ObservableValue).waiting()Methods inherited from class javafx.beans.property.ReadOnlyObjectWrapper
getReadOnlyPropertyMethods inherited from class javafx.beans.property.SimpleObjectProperty
getBean, getNameMethods inherited from class javafx.beans.property.ObjectPropertyBase
addListener, addListener, get, invalidated, removeListener, removeListener, set, toStringMethods inherited from class javafx.beans.property.ObjectProperty
setValueMethods inherited from class javafx.beans.binding.ObjectExpression
asString, asString, asString, getValue, isEqualTo, isEqualTo, isNotEqualTo, isNotEqualTo, isNotNull, isNull, objectExpressionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface javafx.beans.Observable
addListener, removeListenerMethods inherited from interface javafx.beans.value.ObservableValue
addListener, getValue, removeListenerMethods inherited from interface javafx.beans.property.ReadOnlyProperty
getBean, getNameMethods inherited from interface javafx.beans.value.WritableValue
getValue, setValue
-
Constructor Details
-
SynchronizedObjectProperty
public SynchronizedObjectProperty() -
SynchronizedObjectProperty
-
SynchronizedObjectProperty
-
SynchronizedObjectProperty
-
-
Method Details
-
setAndWait
Sets this property's state to "waiting" then usesExecutionUtils.executeWhen(Observable, Runnable, boolean, Supplier, boolean)to "awake" the property when the given observable changes. Just like JavaFX properties if the new value is the same as the current value the method returns and does nothing.- Specified by:
setAndWaitin interfaceSynchronizedProperty<T>- Parameters:
value- the new value of the propertyobservable- the observable to wait for
-
isWaiting
public boolean isWaiting()- Specified by:
isWaitingin interfaceSynchronizedProperty<T>- Returns:
- whether this property is in waiting state
-
waiting
- Specified by:
waitingin interfaceSynchronizedProperty<T>- Returns:
- the waiting state property as a read only property
-
awake
public void awake()Awakes the property by settingSynchronizedProperty.waiting()to false. This method should never be invoked by the user, the awakening is automatically managed by the property. If for some reason the property stays in waiting state you are probably doing something wrong.- Specified by:
awakein interfaceSynchronizedProperty<T>
-
fireValueChangedEvent
protected void fireValueChangedEvent()Overridden to not fire a change event ifwaiting()is true.- Overrides:
fireValueChangedEventin classReadOnlyObjectWrapper<T>
-
bind
Creates a unidirectional bindings with the given observable.The binding is created using the new
If the property is already bound it is automatically unbound before bindings to the new observable.BindingManagermechanism.- Specified by:
bindin interfaceProperty<T>- Overrides:
bindin classObjectPropertyBase<T>- Throws:
IllegalArgumentException- if the given observable is the property itself- See Also:
-
bindBidirectional
Creates a bidirectional bindings between this property and the given property.The binding is created using the new
If the property is already bound unidirectionally it is automatically unbound.BiBindingManagermechanism.If the property is already bound bidirectionally it won't be automatically unbound, just like JavaFX, this way you can have multiple bidirectional bindings
- Specified by:
bindBidirectionalin interfaceProperty<T>- Overrides:
bindBidirectionalin classObjectProperty<T>- Throws:
IllegalArgumentException- if the given observable is the property itself- See Also:
-
unbind
public void unbind()Overridden to callBindingManager.unbind(ObservableValue). -
unbindBidirectional
Overridden to callBiBindingManager.unbind(ObservableValue, ObservableValue).- Specified by:
unbindBidirectionalin interfaceProperty<T>- Overrides:
unbindBidirectionalin classObjectProperty<T>
-
clearBidirectional
public void clearBidirectional()Delegate method forBiBindingManager.disposeFor(ObservableValue). -
isBound
public boolean isBound()Overridden to check theBindingManager.isBound(ObservableValue)flag value andBindingManager.isIgnoreBinding(ObservableValue).
-