public interface IFluentBinding<TValue>
extends javafx.beans.binding.Binding<TValue>, javafx.beans.WeakListener
ObservableValue or Property.| Modifier and Type | Method and Description |
|---|---|
default <TConvertedValue> |
convertTo(@NotNull Function<TValue,TConvertedValue> converter)
Creates a new
IFluentBinding that converts the value of this IFluentBinding into another type. |
@NotNull IFluentBinding<TValue> |
fallbackOn(TValue fallbackValue)
Sets a fallback value that will be returned if the underlying
ObservableValue is not yet set. |
boolean |
hasFallbackValue()
Determines if the binding has as fallback value.
|
boolean |
hasListeners()
Determines if this binding has any
ChangeListener or InvalidationListener attached to it. |
boolean |
hasReplacement()
Determines if the binding has a replacement.
|
@NotNull IFluentBinding<TValue> |
replaceWith(@Nullable Function<TValue,TValue> valueReplacer)
Applies the given
Function whenever the underlying ObservableValue is changed, allowing for certain values to be replaced or ignored. |
default @NotNull IFluentBinding<TValue> |
replaceWith(@NotNull Predicate<TValue> fallbackTriggerValue,
TValue fallbackValue)
Fallback on the given fallback value if the value of the underlying
ObservableValue computes to true using the given Predicate. |
@NotNull IFluentBinding<TValue> |
stopFallbackOn()
Removes the fallback value, so that null will be returned instead of the fallback value.
|
@NotNull IFluentBinding<TValue> |
stopListeners()
Removes all the
ChangeListener and InvalidationListener that have been attached to this binding. |
@NotNull IFluentBinding<TValue> |
stopReplacement()
Stops replacing the value of the underlying
ObservableValue. |
default <TRelayedValue,TRelayedObservedValue extends javafx.beans.value.ObservableValue<TRelayedValue>> |
thenObserve(@NotNull Function<TValue,TRelayedObservedValue> relayResolver)
Creates a new
IFluentBinding that listens to changes of this IFluentBinding and then relays to another ObservableValue that is being watched. |
default <TRelayedValue,TRelayedProperty extends javafx.beans.property.Property<TRelayedValue>> |
thenObserveProperty(@NotNull Function<TValue,TRelayedProperty> relayResolver)
Creates a new
IFluentBinding that listens to changes of this IFluentBinding and then relays to another Property that is being watched. |
dispose, getDependencies, invalidate, isValid@NotNull @NotNull IFluentBinding<TValue> fallbackOn(@Nullable TValue fallbackValue)
ObservableValue is not yet set.fallbackValue - the value to fallback on.IFluentBinding.stopFallbackOn(),
hasFallbackValue()@NotNull @NotNull IFluentBinding<TValue> stopFallbackOn()
IFluentBinding.fallbackOn(Object),
hasFallbackValue()boolean hasFallbackValue()
fallbackOn(Object),
stopFallbackOn()@NotNull default @NotNull IFluentBinding<TValue> replaceWith(@NotNull @NotNull Predicate<TValue> fallbackTriggerValue, @Nullable TValue fallbackValue)
ObservableValue computes to true using the given Predicate.fallbackTriggerValue - determine when the value of the underlying ObservableValue will be replaced with the given fallback value.fallbackValue - the value to fallback on.IFluentBinding.replaceWith(Function),
stopReplacement(),
hasReplacement()@NotNull @NotNull IFluentBinding<TValue> replaceWith(@Nullable @Nullable Function<TValue,TValue> valueReplacer)
Function whenever the underlying ObservableValue is changed, allowing for certain values to be replaced or ignored. In order to stop this behaviour a call
to stopReplacement() is required. A call to this method should overwrite previous call, so only the last applied behaviour is used.valueReplacer - the Function which decided if the value of the underlying ObservableValue will be replaced with the fallback value.IFluentBinding.replaceWith(Predicate, Object),
stopReplacement(),
stopReplacement(),
hasReplacement()@NotNull @NotNull IFluentBinding<TValue> stopReplacement()
ObservableValue.IFluentBinding.replaceWith(Function),
replaceWith(Predicate, Object),
hasReplacement()boolean hasReplacement()
replaceWith(Predicate, Object),
replaceWith(Function),
stopReplacement()@NotNull @NotNull IFluentBinding<TValue> stopListeners()
ChangeListener and InvalidationListener that have been attached to this binding.IFluentBinding.ObservableValue.addListener(ChangeListener),
Observable.addListener(InvalidationListener),
hasListeners()boolean hasListeners()
ChangeListener or InvalidationListener attached to it.ChangeListener or InvalidationListener attached to it, otherwise false.stopListeners(),
ObservableValue.addListener(ChangeListener),
Observable.addListener(InvalidationListener)@NotNull default <TConvertedValue> @NotNull IFluentBinding<TConvertedValue> convertTo(@NotNull @NotNull Function<TValue,TConvertedValue> converter)
IFluentBinding that converts the value of this IFluentBinding into another type.TConvertedValue - the desired type to convert into.converter - the Function to use when converting form the type of this IFluentBinding into the desired type.IFluentBinding which listens to changes of this IFluentBinding.ConverterBinding@NotNull default <TRelayedValue,TRelayedObservedValue extends javafx.beans.value.ObservableValue<TRelayedValue>> @NotNull IFluentBinding<TRelayedValue> thenObserve(@NotNull @NotNull Function<TValue,TRelayedObservedValue> relayResolver)
IFluentBinding that listens to changes of this IFluentBinding and then relays to another ObservableValue that is being watched.TRelayedValue - the type of value of the relayed ObservableValue.TRelayedObservedValue - the type of the ObservableValue.relayResolver - the Function that is used to determine the new ObservableValue that is to be watched by the newly created IFluentBinding.IFluentBinding.RelayBinding@NotNull default <TRelayedValue,TRelayedProperty extends javafx.beans.property.Property<TRelayedValue>> @NotNull IPropertyBinding<TRelayedValue> thenObserveProperty(@NotNull @NotNull Function<TValue,TRelayedProperty> relayResolver)
IFluentBinding that listens to changes of this IFluentBinding and then relays to another Property that is being watched.TRelayedValue - the type of value of the relayed Property.TRelayedProperty - the type of the Property.relayResolver - the Function that is used to determine the new Property that is to be watched by the newly created IFluentBinding.IFluentBinding.PropertyBindingCopyright © 2016 Saxonia Systems AG. All rights reserved.