public DateRangePicker() { super(); setReadonly(true); customItem = new Dateitem(); customItem.setLabel("Custom..."); addChild(customItem); setAllowCustom(false); loadChoices(DEFAULT_CHOICES); }
/** * Returns the date range item that is currently selected. * * @return Selected date range item, or null if none selected. */ public DateRange getSelectedRange() { Dateitem selected = getSelectedItem(); return selected == null ? null : (DateRange) selected.getData(); }
private void processButtonResponses() { List<?> responses = control.getResponses(); for (Object rsp : responses) { DialogResponse<?> response = (DialogResponse<?>) rsp; Button button = addButton(response.getLabel(), response.getFlavor(), clickListener); button.setData(response); if (response.isDefault()) { button.setFocus(true); } } }
/** * Demonstration Configuration Helper Class. */ public static void show() { DialogUtil.popup("web/org/hspconsortium/cwf/plugin/scenario/scenarioManagerWin.fsp", true, true, true); }
/** * 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); }
/** * Updates the visual appearance of the current selection. */ private void updateSelection() { Dateitem selectedItem = getSelectedItem(); if (selectedItem == null) { addStyle("color", "gray"); } else { addStyle("color", "inherit"); } setFocus(false); }
/** * Returns date range from picker. * * @return The date range. */ protected DateRange getDateRange() { return dateRangePicker == null ? null : dateRangePicker.getSelectedRange(); }
/** * 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); }
/** * Sets default property values. */ public DateTimebox() { super(); setReadonly(true); }
public DialogResponse(T response, String label, boolean excluded, boolean dflt, String flavor) { this.response = response; this.label = label; this.ok = isResponseType(label, LABEL_ID_OK); this.cancel = isResponseType(label, LABEL_ID_CANCEL); this.excluded = excluded; this.dflt = dflt; this.flavor = flavor != null ? flavor : ok ? "success" : cancel ? "danger" : dflt ? "primary" : "default"; }
/** * Show a warning message with the default title. * * @param message Text message */ public static void showWarning(String message) { showWarning(message, "@fujion.prompt.warning.title"); }
/** * Displays the dialog amodally. * * @param text The text or HTML content. HTML content is indicated by prefixing with the html * tag. * @param title Dialog title. * @param allowPrint If true, a print button is provided. * @return The created window. */ public static Window showReport(String text, String title, boolean allowPrint) { return ReportDialog.show(text, title, allowPrint, false, null); }
@SuppressWarnings({ "rawtypes", "unchecked" }) public void callback(DialogResponse response) { if (callback != null) { callback.onComplete(response); } }
/** * 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); }
public static void prompt(String message, String title, String styles, String responses, String exclusions, String defaultResponse, String responseId, IResponseCallback<DialogResponse<String>> callback) { DialogControl<String> ctl = DialogControl.create(message, title, styles, responses, exclusions, defaultResponse, responseId, (response) -> { IResponseCallback.invoke(callback, response); }); PromptDialog.show(ctl); }
/** * 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 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); }