public abstract class AbstractUiPopupHelper extends AbstractLoggableComponent implements UiPopupHelper
UiPopupHelper
.Modifier and Type | Field and Description |
---|---|
private NlsBundleUtilCoreRoot |
nlsBundle
The instance of
NlsBundleUtilCoreRoot . |
BUTTON_ID_CANCEL, BUTTON_ID_OK
Constructor and Description |
---|
AbstractUiPopupHelper()
The constructor.
|
AbstractUiPopupHelper(NlsBundleUtilCoreRoot nlsBundle)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
protected String |
getTitle(MessageSeverity severity)
This method gets the title for the given
MessageSeverity . |
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,
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 |
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". |
createLogger, doInitialize, getLogger
doInitialized, getInitializationState, initialize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
showPopup, showPopup
private final NlsBundleUtilCoreRoot nlsBundle
NlsBundleUtilCoreRoot
.public AbstractUiPopupHelper()
public AbstractUiPopupHelper(NlsBundleUtilCoreRoot nlsBundle)
nlsBundle
- is the instance of NlsBundleUtilCoreRoot
.protected String getTitle(MessageSeverity severity)
MessageSeverity
.severity
- is the MessageSeverity
.public void showPopup(String message, MessageSeverity severity, String title)
message
.showPopup
in interface UiPopupHelper
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.public void showPopup(String message, MessageSeverity severity)
message
. The title of the popup is
automatically derived from the given MessageSeverity
.showPopup
in interface UiPopupHelper
message
- is the message to display.severity
- is the MessageSeverity
. Should NOT be MessageSeverity.QUESTION
.UiPopupHelper.showPopup(String, MessageSeverity, String)
public void showPopup(String message, MessageSeverity severity, Consumer<String> callback)
message
and an "OK" button.showPopup
in interface UiPopupHelper
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 UiPopupHelper.BUTTON_ID_OK
.public void showPopupYesNo(String message, String title, Consumer<String> callback)
message
and two buttons for the
options "Yes" and "No". It will use MessageSeverity.QUESTION
. UiPopupHelper.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.showPopupYesNo
in interface UiPopupHelper
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 UiPopupHelper.BUTTON_ID_OK
for "Yes" or UiPopupHelper.BUTTON_ID_CANCEL
for "No".public void showPopup(String message, MessageSeverity severity, String title, Consumer<String> callback)
message
and an "OK" button.showPopup
in interface UiPopupHelper
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
the "OK" button). The given String
value will always be UiPopupHelper.BUTTON_ID_OK
.public 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
.showPopup
in interface UiPopupHelper
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 UiPopupHelper.BUTTON_ID_OK
or UiPopupHelper.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.Copyright © 2001–2016 mmm-Team. All rights reserved.