private void initUserList(final ClientUser[] list) { // The user listing is downloaded by an async call. final RootPanel userPanel = RootPanel.get("email"); userPanel.add(users); users.addChangeHandler( new ChangeHandler() { @Override public void onChange(final ChangeEvent event) { userChanged(); } }); users.addItem(SELECT_USER_STRING, ""); userInfo.clear(); for (final ClientUser user : list) { users.addItem(user.getName(), user.getEmail()); userInfo.put(user.getEmail(), user); } // Select the user according to the cookie stored final String userEmail = Cookies.getCookie("email"); selectUser(userEmail); }
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(); }