public interface Dialogs
Modifier and Type | Interface and Description |
---|---|
static interface |
Dialogs.ExceptionDialogBuilder
Builder of unhandled exception dialog.
|
static interface |
Dialogs.InputDialogBuilder
Builder for dialogs with inputs.
|
static interface |
Dialogs.MessageDialogBuilder
Builder of information dialog.
|
static class |
Dialogs.MessageType
Message type of a dialog.
|
static interface |
Dialogs.OptionDialogBuilder
Builder of dialog with option buttons.
|
Modifier and Type | Method and Description |
---|---|
Dialogs.ExceptionDialogBuilder |
createExceptionDialog()
Creates exception dialog builder.
|
Dialogs.InputDialogBuilder |
createInputDialog(FrameOwner owner)
Creates input dialog builder.
|
Dialogs.MessageDialogBuilder |
createMessageDialog()
Creates message dialog builder.
|
Dialogs.MessageDialogBuilder |
createMessageDialog(Dialogs.MessageType messageType)
Creates message dialog builder with the passed message type.
|
Dialogs.OptionDialogBuilder |
createOptionDialog()
Creates option dialog builder.
|
Dialogs.OptionDialogBuilder |
createOptionDialog(Dialogs.MessageType messageType)
Creates option dialog builder with the passed message type.
|
Dialogs.OptionDialogBuilder createOptionDialog()
dialogs.createOptionDialog()
.withType(MessageType.CONFIRMATION)
.withCaption("Question")
.withMessage("Do you want to discard data?")
.withActions(
new DialogAction(DialogAction.Type.YES).withHandler(e -> {
// YES option selected
}),
new DialogAction(DialogAction.Type.NO).withHandler(e -> {
// NO option selected
})
)
.show();
Dialogs.OptionDialogBuilder createOptionDialog(Dialogs.MessageType messageType)
dialogs.createOptionDialog()
.withType(MessageType.CONFIRMATION)
.withCaption("Question")
.withMessage("Do you want to save data?")
.withActions(
new DialogAction(DialogAction.Type.YES).withHandler(e -> {
// YES option selected
}),
new DialogAction(DialogAction.Type.NO)
.withCaption("I am not sure")
.withHandler(e -> {
// NO option selected
}),
new DialogAction(DialogAction.Type.CANCEL).withHandler(e -> {
// CANCEL option selected
})
)
.show();
Dialogs.MessageDialogBuilder createMessageDialog()
dialogs.createMessageDialog()
.withType(MessageType.WARNING)
.withCaption("Alert")
.withMessage("Report has been saved")
.show();
Dialogs.MessageDialogBuilder createMessageDialog(Dialogs.MessageType messageType)
dialogs.createMessageDialog(MessageType.WARNING)
.withCaption("Alert")
.withMessage("Report has been saved")
.show();
Dialogs.ExceptionDialogBuilder createExceptionDialog()
dialogs.createExceptionDialog()
.withCaption("Alert")
.withMessage("Report has been saved")
.withThrowable(exception)
.show();
Dialogs.InputDialogBuilder createInputDialog(FrameOwner owner)
Example of showing an input dialog:
dialogs.createInputDialog(this)
.withParameters(
stringParameter("name").withCaption("Name"),
intParameter("count").withCaption("Count"))
.withActions(DialogActions.OK_CANCEL)
.withCloseListener(closeEvent ->
notifications.create(Notifications.NotificationType.TRAY)
.withCaption("Dialog is closed")
.show())
.withCaption("Goods")
.show();
owner
- origin screen from input dialog is invoked