Module is.codion.swing.common.ui
Package is.codion.swing.common.ui.dialog
Interface InputDialogBuilder<T>
- All Superinterfaces:
DialogBuilder<InputDialogBuilder<T>>
Displays the component from a given component value in a dialog and returns the value if the user accepts the input.
-
Method Summary
Modifier and TypeMethodDescriptionshow()
Shows the input dialog and returns the value if the user presses OKvoid
Shows the input dialog and callscloseDialog
with the current input when OK is pressed, closing the dialog if the predicate returns true.valid
(StateObserver valid) A StateObserver indicating whether the input is valid, this state controls the enabled state of the OK button.Sets thevalid(StateObserver)
according to the given predicate.Methods inherited from interface is.codion.swing.common.ui.dialog.DialogBuilder
icon, keyEvent, location, locationRelativeTo, owner, owner, title, title
-
Method Details
-
valid
A StateObserver indicating whether the input is valid, this state controls the enabled state of the OK button. Overridesvalidator(Predicate)
.- Parameters:
valid
- a StateObserver indicating whether the input value is valid- Returns:
- this builder instance
-
validator
Sets thevalid(StateObserver)
according to the given predicate.- Parameters:
validator
- the valididator predicate- Returns:
- this builder instance
-
show
Shows the input dialog and callscloseDialog
with the current input when OK is pressed, closing the dialog if the predicate returns true.- Parameters:
closeDialog
- called with the current input to determine if the the dialog should be closed
-
show
T show()Shows the input dialog and returns the value if the user presses OK- Returns:
- the value from the component value if the user accepts the input
- Throws:
CancelException
- in case the user cancels