@ComponentSpecification public interface UiPopupHelper
internationalization
whenever you supply messages,
labels or titles of a popup. Please also note that this component is designed for a client that only needs
to deal with a single Locale
.Modifier and Type | Field and Description |
---|---|
static String |
BUTTON_ID_CANCEL
The ID for the "Cancel" button.
|
static String |
BUTTON_ID_OK
The ID for the "OK" button.
|
Modifier and Type | Method and Description |
---|---|
void |
showPopup(String message,
MessageSeverity severity)
This method opens a popup dialog with the given
message . |
void |
showPopup(String message,
MessageSeverity severity,
Consumer<String> callback)
This method opens a confirmation popup dialog with the given
message and an "OK" button. |
void |
showPopup(String message,
MessageSeverity severity,
String title)
This method opens a popup dialog with the given
message . |
void |
showPopup(String message,
MessageSeverity severity,
String title,
Consumer<String> callback)
This method opens a confirmation popup dialog with the given
message and an "OK" button. |
void |
showPopup(String message,
MessageSeverity severity,
String title,
Consumer<String> callback,
Map<String,String> id2buttonLabelMap)
This method opens a confirmation popup dialog with the given
message . |
void |
showPopup(String message,
MessageSeverity severity,
String title,
Consumer<String> callback,
String labelOk,
String labelCancel)
This method opens a confirmation popup dialog with the given
message and two buttons for the
options "Yes" and "No". |
void |
showPopup(Throwable error)
This method opens a popup dialog showing the given
error . |
void |
showPopupYesNo(String message,
String title,
Consumer<String> callback)
This method opens a confirmation popup dialog with the given
message and two buttons for the
options "Yes" and "No". |
static final String BUTTON_ID_OK
static final String BUTTON_ID_CANCEL
void showPopup(String message, MessageSeverity severity, String title)
message
.message
- is the message to display.severity
- is the MessageSeverity
. Should NOT be MessageSeverity.QUESTION
.title
- is the title that will be displayed in the title-bar of the popup.void showPopup(String message, MessageSeverity severity)
message
. The title of the popup is
automatically derived from the given MessageSeverity
.message
- is the message to display.severity
- is the MessageSeverity
. Should NOT be MessageSeverity.QUESTION
.showPopup(String, MessageSeverity, String)
void showPopup(String message, MessageSeverity severity, Consumer<String> callback)
message
and an "OK" button.message
- is the message to display.severity
- is the MessageSeverity
. Should NOT be MessageSeverity.QUESTION
.callback
- is the Consumer
invoked after the popup has been confirmed (the user has clicked
the "OK" button). The given String
value will always be BUTTON_ID_OK
.void showPopup(String message, MessageSeverity severity, String title, Consumer<String> callback)
message
and an "OK" button.message
- is the message to display.title
- is the title that will be displayed in the title-bar of the popup.severity
- is the MessageSeverity
. Should NOT be MessageSeverity.QUESTION
.callback
- is the Consumer
invoked after the popup has been confirmed (the user has clicked
the "OK" button). The given String
value will always be BUTTON_ID_OK
.void showPopupYesNo(String message, String title, Consumer<String> callback)
message
and two buttons for the
options "Yes" and "No". It will use MessageSeverity.QUESTION
. showPopup(String, MessageSeverity, String, Consumer, String, String)
. An example for a misuse of
this method would be the message
"Do you want to delete this occurrence or the series of the appointment? Press "
Yes" to delete the series and "No" for this occurrence.". From this bad example that confuses the user,
you should learn that it is always better to use more explicit labels.message
- is the message to display.title
- is the title that will be displayed in the title-bar of the popup.callback
- is the Consumer
invoked after the popup has been confirmed (the user has clicked
on one of the buttons). The given String
value will be the ID of the button that has been
clicked. Here, either BUTTON_ID_OK
for "Yes" or BUTTON_ID_CANCEL
for "No".void showPopup(String message, MessageSeverity severity, String title, Consumer<String> callback, String labelOk, String labelCancel)
message
and two buttons for the
options "Yes" and "No". It will use MessageSeverity.QUESTION
.message
- is the message to display.severity
- is the MessageSeverity
- typically MessageSeverity.QUESTION
.title
- is the title that will be displayed in the title-bar of the popup.callback
- is the Consumer
invoked after the popup has been confirmed (the user has clicked
on one of the buttons). The given String
value will be the ID of the button that has been
clicked. Here, either BUTTON_ID_OK
or BUTTON_ID_CANCEL
.labelOk
- is the label for the OK-button (may also be something like "Save", "Approve", etc.).labelCancel
- is the label for the cancel button.void showPopup(String message, MessageSeverity severity, String title, Consumer<String> callback, Map<String,String> id2buttonLabelMap)
message
. It is the most generic
and flexible but also the most inconvenient method variant.message
- is the message to display.severity
- is the MessageSeverity
. Should NOT be MessageSeverity.QUESTION
.title
- is the title that will be displayed in the title-bar of the popup.callback
- is the Consumer
invoked after the popup has been confirmed (the user has clicked
on one of the buttons). The given String
value will be the ID of the button that has been
clicked. The ID is the key
of the given id2buttonLabelMap
.id2buttonLabelMap
- is a Map
defining the buttons for the popup. The values
are the labels of the buttons while the keys
are their IDs. The ID of
the button that has been clicked is passed to the given callback
.void showPopup(Throwable error)
error
. It will use
MessageSeverity.ERROR
.error
- is the Throwable
that has occurred.Copyright © 2001–2016 mmm-Team. All rights reserved.