/** * Show the dialog, loading the specified document. * * @param document The XML document. * @param parent If specified, show viewer in embedded mode. Otherwise, show as modal dialog. * @return The dialog. */ public static Window showXML(Document document, BaseUIComponent parent) { Map<String, Object> args = Collections.singletonMap("document", document); boolean modal = parent == null; Window dialog = PopupDialog.show(XMLConstants.VIEW_DIALOG, args, modal, modal, modal, null); if (parent != null) { dialog.setParent(parent); } return dialog; }
private void doShow(Mode mode, IEventListener closeListener) { Assert.state(this.closeListener == null, () -> "Window is already open"); if (getParent() == null) { setParent(ExecutionContext.getPage()); } this.closeListener = closeListener == null ? dummyListener : closeListener; setMode(mode); setVisible(true); fireEvent("open"); }
Window parent = new Window(); // Temporary parent in case materialize fails, so can cleanup. Page currentPage = ExecutionContext.getPage(); parent.setParent(currentPage); Window window = null; window.setParent(null); BaseComponent child; window.setParent(currentPage); } else { // Otherwise, use the temp parent as the window window = parent;
Window window = getPopupWindow(); window.setTitle(popupData.getTitle()); window.setParent(currentPage); String pos = getPosition(); window.addStyle("left", pos);