IDEMPIERE-5925: Method Dialog.info with callback (#2100)

* IDEMPIERE-5925: Method Dialog.info with callback

https://idempiere.atlassian.net/browse/IDEMPIERE-5925

* IDEMPIERE-5925: Method Dialog.info with callback

various fixes suggested by @hengsin
This commit is contained in:
Nicolas Micoud 2023-11-11 11:27:06 +01:00 committed by GitHub
parent 9794357e84
commit 14bff68342
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 9 deletions

View File

@ -591,17 +591,26 @@ public final class Dialog {
*/
public static void info(int windowNo, String adMessage, String additionalMessage, String title) {
if (logger.isLoggable(Level.INFO)) logger.info(adMessage + " - " + additionalMessage);
info(windowNo, adMessage, additionalMessage, title, null);
}
if (CLogMgt.isLevelFinest()) {
Trace.printStack();
}
String dialogTitle = getDialogTitle(title, windowNo);
/**
* Display dialog with information icon.
*
* @param windowNo Number of Window
* @param adMessage Message to be translated
* @param additionalMessage Additional message
* @param title If none then one will be generated
* @param callback (optional)
*/
public static void info(int windowNo, String adMessage, String additionalMessage, String title, Callback<Integer> callback) {
if (logger.isLoggable(Level.INFO)) logger.info(adMessage + " - " + additionalMessage);
String dialogTitle = getDialogTitle(title, windowNo);
String message = constructMessage(adMessage, additionalMessage);
message = formatDialogMessage(message);
Messagebox.showDialog(message, dialogTitle, Messagebox.OK, Messagebox.INFORMATION);
Messagebox.showDialog(message, dialogTitle, Messagebox.OK, Messagebox.INFORMATION, callback);
}
}