Module is.codion.swing.common.ui
Package is.codion.swing.common.ui.dialog
Interface OkCancelDialogBuilder
- All Superinterfaces:
ActionDialogBuilder<OkCancelDialogBuilder>
,DialogBuilder<OkCancelDialogBuilder>
Builds a modal dialog for displaying the given
component
,
with OK and Cancel buttons based on the given actions.
An OK action must be provided and the default Cancel action simply disposes the dialog.-
Method Summary
Modifier and TypeMethodDescriptioncancelAction
(Action cancelAction) cancelEnabled
(StateObserver cancelEnabled) Note that this is overridden bycancelAction(Action)
.okEnabled
(StateObserver okEnabled) Note that this is overridden byokAction(Action)
.Methods inherited from interface is.codion.swing.common.ui.dialog.ActionDialogBuilder
action, build, buttonPanelBorder, buttonPanelConstraints, defaultAction, escapeAction, modal, onShown, resizable, show, size
Methods inherited from interface is.codion.swing.common.ui.dialog.DialogBuilder
icon, keyEvent, location, locationRelativeTo, owner, owner, title, title
-
Method Details
-
okEnabled
Note that this is overridden byokAction(Action)
.- Parameters:
okEnabled
- the state observer controlling the ok enabled state- Returns:
- this builder instance
- Throws:
IllegalStateException
- in case an ok action has already been set
-
cancelEnabled
Note that this is overridden bycancelAction(Action)
.- Parameters:
cancelEnabled
- the state observer controlling the cancel enabled state- Returns:
- this builder instance
- Throws:
IllegalStateException
- in case a cancel action has already been set
-
onOk
- Parameters:
onOk
- called on ok pressed, before the dialog has been disposed- Returns:
- this builder instance
- Throws:
IllegalStateException
- in case an ok action has already been set
-
onCancel
- Parameters:
onCancel
- called on cancel pressed, before the dialog has been disposed- Returns:
- this builder instance
- Throws:
IllegalStateException
- in case a cancel action has already been set
-
okAction
- Parameters:
okAction
- the action for the OK button, this action must dispose the dialog- Returns:
- this builder instance
-
cancelAction
- Parameters:
cancelAction
- the action for the Cancel button- Returns:
- this builder instance
-