java.lang.Object
javafx.beans.binding.When
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 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 ObservableValue.
- Since:
- JavaFX 2.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassAn intermediate class needed while assembling the ternary expression.classIf-then-else expression returning a number.classAn intermediate class needed while assembling the ternary expression.classAn intermediate class needed while assembling the ternary expression. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionthen(boolean thenValue) Defines a constant value of the ternary expression, that is returned if the condition istrue.then(double thenValue) Defines a constant value of the ternary expression, that is returned if the condition istrue.then(float thenValue) Defines a constant value of the ternary expression, that is returned if the condition istrue.then(int thenValue) Defines a constant value of the ternary expression, that is returned if the condition istrue.then(long thenValue) Defines a constant value of the ternary expression, that is returned if the condition istrue.Defines a constant value of the ternary expression, that is returned if the condition istrue.then(ObservableBooleanValue thenValue) Defines theObservableBooleanValuewhich value is returned by the ternary expression if the condition istrue.then(ObservableNumberValue thenValue) Defines theObservableNumberValuewhich value is returned by the ternary expression if the condition istrue.<T> When.ObjectConditionBuilder<T> then(ObservableObjectValue<T> thenValue) Defines theObservableObjectValuewhich value is returned by the ternary expression if the condition istrue.then(ObservableStringValue thenValue) Defines theObservableStringValuewhich value is returned by the ternary expression if the condition istrue.<T> When.ObjectConditionBuilder<T> then(T thenValue) Defines a constant value of the ternary expression, that is returned if the condition istrue.
-
Constructor Details
-
When
The constructor ofWhen.- Parameters:
condition- the condition of the ternary expression
-
-
Method Details
-
then
Defines theObservableNumberValuewhich value is returned by the ternary expression if the condition istrue.- Parameters:
thenValue- the value- Returns:
- the intermediate result which still requires the otherwise-branch
-
then
Defines a constant value of the ternary expression, that is returned if the condition istrue.- Parameters:
thenValue- the value- Returns:
- the intermediate result which still requires the otherwise-branch
-
then
Defines a constant value of the ternary expression, that is returned if the condition istrue.- Parameters:
thenValue- the value- Returns:
- the intermediate result which still requires the otherwise-branch
-
then
Defines a constant value of the ternary expression, that is returned if the condition istrue.- Parameters:
thenValue- the value- Returns:
- the intermediate result which still requires the otherwise-branch
-
then
Defines a constant value of the ternary expression, that is returned if the condition istrue.- Parameters:
thenValue- the value- Returns:
- the intermediate result which still requires the otherwise-branch
-
then
Defines theObservableBooleanValuewhich value is returned by the ternary expression if the condition istrue.- Parameters:
thenValue- the value- Returns:
- the intermediate result which still requires the otherwise-branch
-
then
Defines a constant value of the ternary expression, that is returned if the condition istrue.- Parameters:
thenValue- the value- Returns:
- the intermediate result which still requires the otherwise-branch
-
then
Defines theObservableStringValuewhich value is returned by the ternary expression if the condition istrue.- Parameters:
thenValue- the value- Returns:
- the intermediate result which still requires the otherwise-branch
-
then
Defines a constant value of the ternary expression, that is returned if the condition istrue.- Parameters:
thenValue- the value- Returns:
- the intermediate result which still requires the otherwise-branch
-
then
Defines theObservableObjectValuewhich value is returned by the ternary expression if the condition istrue.- Type Parameters:
T- the type of the intermediate result- Parameters:
thenValue- the value- Returns:
- the intermediate result which still requires the otherwise-branch
-
then
Defines a constant value of the ternary expression, that is returned if the condition istrue.- Type Parameters:
T- the type of the intermediate result- Parameters:
thenValue- the value- Returns:
- the intermediate result which still requires the otherwise-branch
-