/** * Opens the window modally. */ public void modal() { modal(null); }
/** * Show viewer. * * @param clipboard Clipboard whose contents is to be accessed. */ public static void show(Clipboard clipboard) { Map<String, Object> args = Collections.singletonMap("clipboard", clipboard); Window dlg = (Window) PageUtil.createPage(DesignConstants.RESOURCE_PREFIX + "clipboardViewer.fsp", null, args) .get(0); dlg.modal(null); }
/** * Display the add component dialog, presenting a list of candidate plugins that may serve as * children to the specified parent element. * * @param parentElement Element to serve as parent to the newly created child element. * @param createChild If true, the selected element will be created. * @param callback The close event handler. */ private static void show(ElementBase parentElement, boolean createChild, IEventListener callback) { Map<String, Object> args = new HashMap<>(); args.put("parentElement", parentElement); args.put("createChild", createChild); Window dlg = (Window) PageUtil.createPage(DesignConstants.RESOURCE_PREFIX + "addComponent.fsp", null, args).get(0); dlg.modal(callback); }
/** * Prompts for a layout. * * @param dfltLayout Default layout. * @param hideScope If true, hide private/shared scope selection. * @param allowDups If true, duplicate names are allowed. * @param title Prompt dialog title. * @param prompt Prompt dialog text. * @param closeListener Notified when dialog is closed. */ public static void show(LayoutIdentifier dfltLayout, boolean hideScope, boolean allowDups, String title, String prompt, IEventListener closeListener) { Map<String, Object> args = new HashMap<>(); args.put("dfltLayout", dfltLayout); args.put("hideScope", hideScope); args.put("allowDups", allowDups); args.put("title", title); args.put("prompt", prompt); Window window = (Window) PageUtil.createPage(DIALOG, null, args).get(0); window.modal(closeListener); }
/** * Creates a property grid for the given target UI element. * * @param target UI element whose properties are to be edited. * @param parent Parent component for property grid (may be null). * @param embedded If true, the property grid is embedded within another component. * @return Newly created PropertyGrid instance. */ public static PropertyGrid create(ElementBase target, BaseComponent parent, boolean embedded) { Map<String, Object> args = new HashMap<>(); args.put("target", target); args.put("embedded", embedded); Window window = (Window) PageUtil.createPage(DesignConstants.RESOURCE_PREFIX + "propertyGrid.fsp", parent, args) .get(0); if (parent == null) { window.modal(null); } return window.getAttribute("controller", PropertyGrid.class); }
/** * Invokes the patient match dialog, displaying the specified list of patients. * * @param patientList List of patients from which to select. * @param callback Callback to receive the patient selected by the user or null if the operation * was canceled. */ public static void selectFromList(List<Patient> patientList, IResponseCallback<Patient> callback) { Map<String, Object> args = new HashMap<>(); args.put(Constants.RESULT_ATTRIB, patientList); Window window = (Window) PageUtil.createPage(Constants.RESOURCE_PREFIX + "patientMatches.fsp", null, args).get(0); window.modal(callback == null ? null : (event) -> { callback.onComplete(window.getAttribute(Constants.RESULT_ATTRIB, Patient.class)); }); }
/** * Displays the dialog. * * @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. * @param asModal If true, open as modal; otherwise, as popup. * @param callback Callback when dialog is closed. * @return The created dialog. */ public static Window show(String text, String title, boolean allowPrint, boolean asModal, IEventListener callback) { Map<String, Object> args = new HashMap<>(); args.put("text", text); args.put("title", title); args.put("allowPrint", allowPrint); Window dialog = PopupDialog.show(DialogConstants.RESOURCE_PREFIX + "reportDialog.fsp", args, true, true, false, null); if (asModal) { dialog.modal(callback); } else { dialog.popup(callback); } return dialog; }
/** * Displays the date range dialog. * * @param dateRange The initial date range. * @param callback Callback for returning a date range reflecting the inputs from the dialog. * This will be null if the input is cancelled or if an unexpected error occurs. */ public static void show(DateRange dateRange, IResponseCallback<DateRange> callback) { Map<String, Object> args = new HashMap<>(); args.put("dateRange", dateRange); Window dlg = (Window) PageUtil.createPage(DialogConstants.RESOURCE_PREFIX + "dateRangeDialog.fsp", null, args) .get(0); dlg.modal((event) -> { callback.onComplete((DateRange) dlg.getAttribute("result")); }); }
/** * Display view resources dialog. * * @param scenario Scenario whose resources are to be viewed. * @param callback Callback upon dialog closure. */ public static void show(Scenario scenario, IResponseCallback<Boolean> callback) { Map<String, Object> args = new HashMap<>(); args.put("scenario", scenario); Window dlg = (Window) PageUtil.createPage("web/org/hspconsortium/cwf/ui/scenario/viewResources.fsp", null, args) .get(0); dlg.modal((event) -> { if (callback != null) { callback.onComplete(dlg.hasAttribute("modified")); } }); }
/** * 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)); } }
/** * Prompt user for input. * * @param args The argument map. * @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 show(Map<String, Object> args, IInputCallback callback) { Window dialog = (Window) PageUtil .createPage(DialogConstants.RESOURCE_PREFIX + "inputDialog.fsp", ExecutionContext.getPage(), args).get(0); dialog.modal(callback == null ? null : (event) -> { callback.onComplete(dialog.getAttribute("result", String.class)); }); }
/** * Show detail for specified component. * * @param item The component containing the model object. */ protected void showDetail(BaseComponent item) { @SuppressWarnings("unchecked") M modelObject = item == null ? null : (M) item.getData(); String detail = modelObject == null ? null : getDetail(modelObject); if (!StringUtils.isEmpty(detail)) { if (getShowDetailPane()) { detailView.setContent(detail); } else { Map<String, Object> map = new HashMap<>(); map.put("title", detailTitle); map.put("content", detail); map.put("allowPrint", getAllowPrint()); try { Window window = (Window) PageUtil .createPage(Constants.RESOURCE_PREFIX + "resourceListDetailPopup.fsp", null, map).get(0); window.modal(null); } catch (Exception e) { DialogUtil.showError(e); } } } }
.createPage(DialogConstants.RESOURCE_PREFIX + "promptDialog.fsp", ExecutionContext.getPage(), args) .get(0); root.modal(null); } catch (Exception e) { log.error("Error Displaying Dialog", e);
window.modal(closeListener);