Top Description Inners Fields Constructors Methods
javafx.beans.binding

public Class When

extends Object
Class Inheritance
Imports
java.lang.ref.WeakReference, javafx.beans.InvalidationListener, .NamedArg, .Observable, javafx.beans.value.ObservableBooleanValue, .ObservableDoubleValue, .ObservableFloatValue, .ObservableLongValue, .ObservableNumberValue, .ObservableObjectValue, .ObservableStringValue, .ObservableValue, javafx.collections.FXCollections, .ObservableList, com.sun.javafx.binding.DoubleConstant, .FloatConstant, .IntegerConstant, .Logging, .LongConstant

Starting point for a binding that calculates a ternary expression.

A ternary expression has the basic form new When(cond).then(value1).otherwise(value2);. The expression cond needs to be a javafx.beans.value.ObservableBooleanValue. Based on the value of cond, the binding contains the value of value1 (if cond.getValue() == true) or value2 (if cond.getValue() == false). The values value1 and value2 have to be of the same type. They can be constant values or implementations of javafx.beans.value.ObservableValue.

Since
JavaFX 2.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
When.BooleanCondition

If-then-else expression returning Boolean.

public class
When.BooleanConditionBuilder

An intermediate class needed while assembling the ternary expression.

public class
When.NumberConditionBuilder

If-then-else expression returning a number.

private class
When.ObjectCondition<T>

If-then-else expression returning general objects.

public class
When.ObjectConditionBuilder<
the type of the object being built
T
>

An intermediate class needed while assembling the ternary expression.

private class
When.StringCondition

If-then-else expression returning String.

public class
When.StringConditionBuilder

An intermediate class needed while assembling the ternary expression.

private static class

Field Summary

Modifier and TypeField and Description
private final ObservableBooleanValue

Constructor Summary

AccessConstructor and Description
public
When(final ObservableBooleanValue
the condition of the ternary expression
condition
)

The constructor of When.

Method Summary

Modifier and TypeMethod and Description
private static NumberBinding
createNumberCondition(final ObservableBooleanValue condition, final ObservableNumberValue thenValue, final ObservableNumberValue otherwiseValue)

public When.NumberConditionBuilder

Returns:

the intermediate result which still requires the otherwise-branch
then
(final ObservableNumberValue
the value
thenValue
)

Defines the javafx.beans.value.ObservableNumberValue which value is returned by the ternary expression if the condition is true.

public When.NumberConditionBuilder

Returns:

the intermediate result which still requires the otherwise-branch
then
(double
the value
thenValue
)

Defines a constant value of the ternary expression, that is returned if the condition is true.

public When.NumberConditionBuilder

Returns:

the intermediate result which still requires the otherwise-branch
then
(float
the value
thenValue
)

Defines a constant value of the ternary expression, that is returned if the condition is true.

public When.NumberConditionBuilder

Returns:

the intermediate result which still requires the otherwise-branch
then
(long
the value
thenValue
)

Defines a constant value of the ternary expression, that is returned if the condition is true.

public When.NumberConditionBuilder

Returns:

the intermediate result which still requires the otherwise-branch
then
(int
the value
thenValue
)

Defines a constant value of the ternary expression, that is returned if the condition is true.

public When.BooleanConditionBuilder

Returns:

the intermediate result which still requires the otherwise-branch
then
(final ObservableBooleanValue
the value
thenValue
)

Defines the javafx.beans.value.ObservableBooleanValue which value is returned by the ternary expression if the condition is true.

public When.BooleanConditionBuilder

Returns:

the intermediate result which still requires the otherwise-branch
then
(final boolean
the value
thenValue
)

Defines a constant value of the ternary expression, that is returned if the condition is true.

public When.StringConditionBuilder

Returns:

the intermediate result which still requires the otherwise-branch
then
(final ObservableStringValue
the value
thenValue
)

Defines the javafx.beans.value.ObservableStringValue which value is returned by the ternary expression if the condition is true.

public When.StringConditionBuilder

Returns:

the intermediate result which still requires the otherwise-branch
then
(final String
the value
thenValue
)

Defines a constant value of the ternary expression, that is returned if the condition is true.

public <
the type of the intermediate result
T
>
When.ObjectConditionBuilder<T>

Returns:

the intermediate result which still requires the otherwise-branch
then
(final ObservableObjectValue<T>
the value
thenValue
)

Defines the javafx.beans.value.ObservableObjectValue which value is returned by the ternary expression if the condition is true.

public <
the type of the intermediate result
T
>
When.ObjectConditionBuilder<T>

Returns:

the intermediate result which still requires the otherwise-branch
then
(final T
the value
thenValue
)

Defines a constant value of the ternary expression, that is returned if the condition is true.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait