/** Override show to also center the dialog. */ @Override public void show() { super.show(); super.center(); // set a body class to mark the dialog show RootPanel.get().addStyleName("gwt-ModalDialog-show"); }
/** * Centers this dialog on the screen. * * @see DialogBox#center() */ public void center() { // PopupPanel#center calls PopupPanel#hide if the dialog was not showing. We call // PopupPanel#show before in // order to avoid this behavior. // @see http://code.google.com/p/google-web-toolkit/issues/detail?id=3007 dialog.setVisible(false); dialog.show(); dialog.center(); dialog.setVisible(true); }
private void popupDbCurator() { ClientSequenceDatabase csd = (ClientSequenceDatabase) dlb.getSelected(); Integer selected = csd.getId(); Map<String, String> emailInitialPairs = new TreeMap<String, String>(); for (Map.Entry<String, ClientUser> me : userInfo.entrySet()) { emailInitialPairs.put(me.getKey(), me.getValue().getInitials()); } final DialogBox dialogBox = new DialogBox(false); CurationEditor ce = new CurationEditor( selected, user.getEmail(), emailInitialPairs, new EditorCloseCallback() { public void editorClosed(final Integer openCurationID) { validationController.getAllowedValues( dlb, new Callback() { public void done() { if (openCurationID != null) { dlb.select(openCurationID, validationController); } dialogBox.hide(); } }); } }); DOM.setElementAttribute(dialogBox.getElement(), "id", "db-curator"); dialogBox.setStyleName("dbCuratorEmbed"); dialogBox.setWidget(ce); dialogBox.setSize(Window.getClientWidth() * .8 + "px", Window.getClientHeight() * .8 + "px"); ce.setPixelSize( Math.max((int) (Window.getClientWidth() * .8), 770), (int) (Window.getClientHeight() * .8)); // LightBox lb = new LightBox(dialogBox); // try { // lb.show(); // } catch (Exception ignore) { dialogBox.show(); // } dialogBox.center(); }
protected void positionAndShowDialog() { super.center(); }