T
- The (generic) type parameter for the interface representing the type of input data entered by the
user via the virtual keypad. Relevant types are e.g. Integer
and Double
.public interface KeyboardNumberInput<T>
Modifier and Type | Method and Description |
---|---|
KeyboardNumberInput<T> |
setErrorValidator(InputValidator<T> validator)
Sets an input validator for the virtual numeric keypad.
|
KeyboardNumberInput<T> |
setInitialValue(T initialValue)
Sets the initial value which will be displayed when the virtual numeric keypad is shown.
|
void |
show(JButton component,
KeyboardInputCallback<T> callback)
This method requests the virtual keypad to be shown
|
void |
show(JLabel component,
KeyboardInputCallback<T> callback)
This method requests the virtual numeric keypad to be shown
|
void |
show(JTextField component,
KeyboardInputCallback<T> callback)
This method requests the virtual numeric keypad to be shown
|
KeyboardNumberInput<T> setErrorValidator(InputValidator<T> validator)
InputValidationFactory
.
Specifying an input validator is recommended, but optional.
In case InputValidator.isValid(Object)
returns false, the accept button on the virtual keypad will
be disabled and the error message from InputValidator.getMessage(Object)
will be shown.
validator
- the validator to be used to validate keypad user input.NullPointerException
- in case the validator is nullKeyboardNumberInput<T> setInitialValue(T initialValue)
initialValue
- the initial value for the virtual keypadvoid show(JTextField component, KeyboardInputCallback<T> callback)
component
- the JTextField that will be used to define the screen position of the virtual keypadcallback
- the callback to be used when the user exits the keypad by accepting or canceling the input.NullPointerException
- in case any parameter is nullvoid show(JLabel component, KeyboardInputCallback<T> callback)
component
- the JLabel that will be used to define the screen position of the virtual keypadcallback
- the callback to be used when the user exits the keypad by accepting or canceling the input.NullPointerException
- in case any parameter is nullvoid show(JButton component, KeyboardInputCallback<T> callback)
component
- the JButton that will be used to define the screen position of the virtual keypadcallback
- the callback to be used when the user exits the keypad by accepting or canceling the input.NullPointerException
- in case any parameter is nullCopyright © 2018. All rights reserved.