/** * Show an error message with the default title. * * @param message Text message */ public static void showError(String message) { showError(message, "@fujion.prompt.error.title"); }
/** * Present a confirmation (OK/Cancel) dialog with the specified prompt and return the user * response. * * @param message Prompt to present to the user. * @param title Caption of prompt dialog. * @param callback Callback to receive dialog response. */ public static void confirm(String message, String title, IConfirmCallback callback) { confirm(message, title, null, callback); }
/** * Can be used to popup any page as a modal dialog. * * @param fspPage Url of page. * @param closable If true, window closure button appears. * @param sizable If true, window sizing grips appear. * @return Reference to the opened window, if successful. */ public static Window popup(String fspPage, boolean closable, boolean sizable) { return popup(fspPage, closable, sizable, true); }
@EventHandler(value = "click", target = "@btnDelete") private void onClick$btnDelete() { IBaseResource resource = getSelectedResource(); DialogUtil.confirm("Delete " + FhirUtil.getResourceIdPath(resource, true) + "?", "Delete Resource", (confirm) -> { if (confirm) { try { fhirService.deleteResource(resource); model.remove(resource); root.setAttribute("modified", true); updateCaption(); displayResource(); } catch (Exception e) { DialogUtil.showError("Error deleting resource:\n\n" + CWFUtil.formatExceptionForDisplay(e)); } } }); }
public static void prompt(String message, String title, String responses, IResponseCallback<DialogResponse<String>> callback) { prompt(message, title, null, responses, null, null, null, callback); }
/** * Prompt user for input. * * @param prompt Prompt message to display. * @param title Text to display. * @param callback The callback to receive the text input. If the dialog was cancelled, the text * input will be returned as null. */ public static void input(String prompt, String title, IInputCallback callback) { input(prompt, title, null, callback); }
/** * Show an informational message with the specified title. * * @param message Text message * @param title Title of dialog */ public static void showInfo(String message, String title) { showDialog(message, title, STYLES_INFO); }
/** * Present a confirmation (OK/Cancel) dialog with the specified prompt and return the user * response. * * @param message Prompt to present to the user. * @param title Caption of prompt dialog. * @param responseId Optional response id if user response is to be cached. If null, the * response will not be cached. If specified, the response is cached and the user is * not prompted again. * @param callback Callback to receive dialog response. */ public static void confirm(String message, String title, String responseId, IConfirmCallback callback) { prompt(message, title, STYLES_QUESTION, LABEL_IDS_OK_CANCEL, LABEL_ID_CANCEL, null, responseId, (response) -> { IResponseCallback.invoke(callback, response != null && response.isOk()); }); }
@EventHandler(value = "click", target = "btnAddSubscription") private void onClick$btnAddSubscription() { DialogUtil.input("Enter the name of the channel to subscribe to:", "Subscribe to Channel", (channel) -> { if (channel != null && !channels.contains(channel)) { channels.add(channel); channels2.add(channel); subscribe(channel, true); } }); }
/** * Show a text message with the specified title and using a fixed pitch font. * * @param message Text message * @param title Title of dialog */ public static void showText(String message, String title) { showDialog(message, title, STYLE_FIXED_FONT); }
/** * Show an exception message with the default title. * * @param e Exception to display. */ public static void showError(Throwable e) { showError(CWFUtil.formatExceptionForDisplay(e)); }
/** * Present a confirmation (OK/Cancel) dialog with the specified prompt and return the user * response. * * @param message Prompt to present to the user. * @param callback Callback to receive dialog response. */ public static void confirm(String message, IConfirmCallback callback) { confirm(message, "@fujion.prompt.confirm.title", callback); }
/** * Demonstration Configuration Helper Class. */ public static void show() { DialogUtil.popup("web/org/hspconsortium/cwf/plugin/scenario/scenarioManagerWin.fsp", true, true, true); }
DialogUtil.prompt(msg, TITLE_TOO_MANY_MATCHES, REFINE_BUTTONS, (response) -> { if (response.hasResponse(BTN_REFINE_LABEL)) { matches.clear();
/** * Show a warning message with the specified title. * * @param message Text message * @param title Title of dialog */ public static void showWarning(String message, String title) { showDialog(message, title, STYLES_WARNING); }
/** * Invokes the property grid with this element as its target. */ public void editProperties() { try { PropertyGrid.create(this, null); } catch (Exception e) { DialogUtil.showError("Displaying property grid: \r\n" + e.toString()); } }
private void close(boolean cancel) { if (cancel && !changeSet.isEmpty()) { DialogUtil.confirm(label_cancel_message, label_cancel_title, (response) -> { if (response) { _close(cancel); } }); } else { _close(cancel); } }
/** * Opens any arbitrary page in a modal window. * * @param fspPage Url of page. * @return Reference to the opened window, if successful. */ public static Window popup(String fspPage) { return popup(fspPage, true, true, true); }
/** * Show an error message with the specified title. * * @param message Text message * @param title Title of dialog */ public static void showError(String message, String title) { showDialog(message, title, STYLES_ERROR); }
/** * Common entry point for displaying an about dialog. * * @param params Parameter map for about dialog. */ private static void showDialog(AboutParams params) { try { Map<String, Object> args = Collections.singletonMap("params", params); Window dlg = (Window) PageUtil.createPage(Constants.RESOURCE_PREFIX + "aboutDialog.fsp", null, args).get(0); dlg.modal(null); } catch (Exception e) { DialogUtil.showError(CWFUtil.formatExceptionForDisplay(e)); } }