Package org.damour.base.client.ui.dialogs

Examples of org.damour.base.client.ui.dialogs.MessageDialogBox


    BaseServiceCache.getService().getUsers(getUsersCallback);
  }

  public boolean apply() {
    if (nameTextBox.getText() == null || "".equals(nameTextBox.getText())) {
      MessageDialogBox dialog = new MessageDialogBox("Error", "Enter a group name.", true, true, true);
      dialog.center();
      return false;
    }

    group.setName(nameTextBox.getText());
    group.setDescription(descriptionTextBox.getText());
    if (showUsers) {
      for (User user : users) {
        if (user.getUsername().equals(ownerListBox.getItemText(ownerListBox.getSelectedIndex()))) {
          group.setOwner(user);
        }
      }
    }
    group.setAutoJoin(autoJoinCheckBox.getValue());
    group.setLocked(lockGroupCheckBox.getValue());
    group.setVisible(visibleCheckBox.getValue());

    final AsyncCallback<UserGroup> updateGroupCallback = new AsyncCallback<UserGroup>() {
      public void onFailure(Throwable caught) {
        MessageDialogBox dialog = new MessageDialogBox("Error", "Could not save group: " + caught.getMessage(), true, true, true);
        dialog.center();
      }

      public void onSuccess(UserGroup group) {
        if (group == null) {
          MessageDialogBox dialog = new MessageDialogBox("Error", "Could not save group.", true, true, true);
          dialog.center();
        } else if (callback != null) {
          callback.invoke(group);
        }
      };
    };
View Full Code Here


        deleteGroupDialogBox.setContent(new Label("Delete Group: " + group.getName() + "?"));
        deleteGroupDialogBox.setCallback(new IDialogCallback() {
          public void okPressed() {
            final AsyncCallback<Void> deleteGroupCallback = new AsyncCallback<Void>() {
              public void onFailure(Throwable caught) {
                MessageDialogBox dialog = new MessageDialogBox("Error", caught.getMessage(), true, true, true);
                dialog.center();
              }

              public void onSuccess(Void nothing) {
                groups.remove(group);
                lastListSelection = null;
View Full Code Here

TOP

Related Classes of org.damour.base.client.ui.dialogs.MessageDialogBox

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.