Module com.dua3.utility.fx.controls
Package com.dua3.utility.fx.controls
Class ChoiceInputControl<T>
java.lang.Object
com.dua3.utility.fx.controls.ChoiceInputControl<T>
- Type Parameters:
T- the input result type
- All Implemented Interfaces:
InputControl<T>
Interface for an input field.
-
Property Summary
PropertiesTypePropertyDescriptionProvides a read-only property representing the error message for this input control.Provides a read-only property representing the validity of the input.Provides the property representing the value of this input control. -
Nested Class Summary
Nested classes/interfaces inherited from interface com.dua3.utility.fx.controls.InputControl
InputControl.State<R> -
Constructor Summary
ConstructorsConstructorDescriptionChoiceInputControl(com.dua3.utility.options.ChoiceOption<T> option, Supplier<? extends T> dfltValue) Constructs a ChoiceInputControl with the given options and default value supplier. -
Method Summary
Modifier and TypeMethodDescriptionProvides a read-only property representing the error message for this input control.node()Get theNodefor this input element.voidreset()Reset value to defaultProvides a read-only property representing the validity of the input.Provides the property representing the value of this input control.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.dua3.utility.fx.controls.InputControl
get, init, isValid, set
-
Property Details
-
value
- Specified by:
valuePropertyin interfaceInputControl<T>- Returns:
- the property containing the current value
-
valid
- Specified by:
validPropertyin interfaceInputControl<T>- Returns:
- a ReadOnlyBooleanProperty that is true if the input is valid and false otherwise
-
error
- Specified by:
errorPropertyin interfaceInputControl<T>- Returns:
- a ReadOnlyStringProperty containing the error message if there is a validation error, otherwise empty
-
-
Constructor Details
-
ChoiceInputControl
public ChoiceInputControl(com.dua3.utility.options.ChoiceOption<T> option, Supplier<? extends T> dfltValue) Constructs a ChoiceInputControl with the given options and default value supplier.- Parameters:
option- the ChoiceOption containing possible values for the input controldfltValue- a Supplier that provides the default value for the input control
-
-
Method Details
-
node
Description copied from interface:InputControlGet theNodefor this input element.- Specified by:
nodein interfaceInputControl<T>- Returns:
- the node
-
valueProperty
Description copied from interface:InputControlProvides the property representing the value of this input control.- Specified by:
valuePropertyin interfaceInputControl<T>- Returns:
- the property containing the current value
-
reset
public void reset()Description copied from interface:InputControlReset value to default- Specified by:
resetin interfaceInputControl<T>
-
validProperty
Description copied from interface:InputControlProvides a read-only property representing the validity of the input.- Specified by:
validPropertyin interfaceInputControl<T>- Returns:
- a ReadOnlyBooleanProperty that is true if the input is valid and false otherwise
-
errorProperty
Description copied from interface:InputControlProvides a read-only property representing the error message for this input control.This property contains an error message if the input is invalid, otherwise it is empty.
- Specified by:
errorPropertyin interfaceInputControl<T>- Returns:
- a ReadOnlyStringProperty containing the error message if there is a validation error, otherwise empty
-