Top Fields Constructors Methods
com.sun.javafx.binding

public Class ConditionalBinding<T>

extends LazyObjectBinding<T>
Class Inheritance
Imports
java.util.Objects, javafx.beans.value.ObservableValue, javafx.util.Subscription

Field Summary

Modifier and TypeField and Description
private final ObservableValue<Boolean>
private final ObservableValue<T>
private Subscription

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected boolean
allowValidation()

Overrides com.sun.javafx.binding.LazyObjectBinding.allowValidation.

This binding is valid whenever it is observed, or it is currently inactive.

protected T
computeValue()

Implements abstract javafx.beans.binding.ObjectBinding.computeValue.

Calculates the current value of this binding.

private void
conditionChanged(boolean active)

private boolean
protected Subscription
observeSources()

Implements abstract com.sun.javafx.binding.LazyObjectBinding.observeSources.

Called when this binding was previously not observed and a new observer was added.

private void
private void
Inherited from com.sun.javafx.binding.LazyObjectBinding:
addListeneraddListenerremoveListenerremoveListener

Field Detail

nonNullConditionback to summary
private final ObservableValue<Boolean> nonNullCondition
sourceback to summary
private final ObservableValue<T> source
subscriptionback to summary
private Subscription subscription

Hides com.sun.javafx.binding.LazyObjectBinding.subscription.

Constructor Detail

ConditionalBindingback to summary
public ConditionalBinding(ObservableValue<T> source, ObservableValue<Boolean> condition)

Method Detail

allowValidationback to summary
protected boolean allowValidation()

Overrides com.sun.javafx.binding.LazyObjectBinding.allowValidation.

This binding is valid whenever it is observed, or it is currently inactive. When inactive, the binding has the value of its source at the time it became inactive.

Returns:boolean

Doc from javafx.beans.binding.ObjectBinding.allowValidation.

true if this binding is allowed to become valid, otherwise false

Annotations
@Override
computeValueback to summary
protected T computeValue()

Implements abstract javafx.beans.binding.ObjectBinding.computeValue.

Doc from javafx.beans.binding.ObjectBinding.computeValue.

Calculates the current value of this binding.

Classes extending ObjectBinding have to provide an implementation of computeValue.

Returns:T

the current value

Annotations
@Override
conditionChangedback to summary
private void conditionChanged(boolean active)
isActiveback to summary
private boolean isActive()
observeSourcesback to summary
protected Subscription observeSources()

Implements abstract com.sun.javafx.binding.LazyObjectBinding.observeSources.

Doc from com.sun.javafx.binding.LazyObjectBinding.observeSources.

Called when this binding was previously not observed and a new observer was added. Implementors must return a Subscription which will be cancelled when this binding no longer has any observers.

Returns:Subscription

a Subscription which will be cancelled when this binding no longer has any observers, never null

Annotations
@Override
unsubscribeback to summary
private void unsubscribe()
updateSubscriptionback to summary
private void updateSubscription()