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

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


  }

  public void getPasswordHint(final String username) {
    final AsyncCallback<String> callback = new AsyncCallback<String>() {
      public void onFailure(Throwable caught) {
        final MessageDialogBox dialog = new MessageDialogBox(BaseApplication.getMessages().getString("error", "Error"), caught.getMessage(), true, true, true);
        dialog.center();
      }

      public void onSuccess(String hint) {
        if (hint == null) {
          MessageDialogBox dialog = new MessageDialogBox(BaseApplication.getMessages().getString("error", "Error"), "Could not retrieve password hint.", true,
              true, true);
          dialog.center();
        } else {
          MessageDialogBox dialog = new MessageDialogBox(BaseApplication.getMessages().getString("passwordHint", "Password Hint"), BaseApplication
              .getMessages().getString("yourPasswordHintIs", "Your password hint is: <b>{0}</b>", hint), true, true, true);
          dialog.center();
        }
      };
    };
    BaseServiceCache.getService().getLoginHint(username, callback);
  }
View Full Code Here


    final int index = allGroupsListBox.getSelectedIndex();
    final String groupName = allGroupsListBox.getItemText(index);
    final UserGroup group = groupMap.get(groupName);
    final AsyncCallback<GroupMembership> addUserCallback = new AsyncCallback<GroupMembership>() {
      public void onFailure(Throwable caught) {
        MessageDialogBox dialog = new MessageDialogBox("Error", caught.getMessage(), true, true, true);
        dialog.center();
      }

      public void onSuccess(GroupMembership membership) {
        groupsForUser.add(membership.getUserGroup());
        populateUI();
View Full Code Here

    }
    final String groupName = groupsForUserListBox.getItemText(index);
    final UserGroup group = groupMap.get(groupName);
    final AsyncCallback<Void> deleteUserCallback = 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) {
        groupsForUser.remove(group);
        populateUI();
View Full Code Here

              "You must read and agree with the disclaimer statement to continue.")
              + "<BR>";
          validationFailed = true;
        }
        if (validationFailed) {
          final MessageDialogBox dialog = new MessageDialogBox(BaseApplication.getMessages().getString("validationFailed", "Validation Failed"),
              validationMessage, true, true, true);
          dialog.setCallback(new IDialogCallback() {
            public void okPressed() {
              accountDialog.center();
            }

            public void cancelPressed() {
            }
          });
          dialog.center();
          return;
        }
        createNewAccount(usernameTextBox.getText(), firstname.getText(), lastname.getText(), passwordTextBox.getText(), passwordHint.getText(),
            emailAddress.getText(), dateBox.getValue().getTime());
      }
View Full Code Here

          validationMessage += BaseApplication.getMessages().getString("mustEnterBirthdate", "You must enter your birthdate.");
          validationMessage += "<BR>";
          validationFailed = true;
        }
        if (validationFailed) {
          final MessageDialogBox dialog = new MessageDialogBox(BaseApplication.getMessages().getString("validationFailed", "Validation Failed"),
              validationMessage, true, true, true);
          dialog.setCallback(new IDialogCallback() {
            public void okPressed() {
              accountDialog.center();
            }

            public void cancelPressed() {
            }
          });
          dialog.center();
          return;
        }
        user.setUsername(usernameTextBox.getText());
        user.setFirstname(firstname.getText());
        user.setLastname(lastname.getText());
View Full Code Here

  }

  public void login(final String username, final String password) {
    final AsyncCallback<User> loginCallback = new AsyncCallback<User>() {
      public void onFailure(Throwable caught) {
        MessageDialogBox dialog = new MessageDialogBox(BaseApplication.getMessages().getString("error", "Error"), caught.getMessage(), true, true, true);
        dialog.setCallback(new IDialogCallback() {
          public void okPressed() {
            loginDialog.center();
          }

          public void cancelPressed() {
          }
        });
        dialog.center();
      }

      public void onSuccess(User user) {
        AuthenticationHandler.this.user = user;
        if (user == null) {
          MessageDialogBox dialog = new MessageDialogBox(BaseApplication.getMessages().getString("error", "Error"), BaseApplication.getMessages().getString(
              "invalidUsernameOrPassword", "Invalid Username or Password."), true, true, true);
          dialog.center();
        } else {
          loginDialog.hide();
          fireSetAuthenticatedUser(user);
        }
      };
View Full Code Here

    dialog.setFocusWidget(textArea);
    dialog.setContent(replyPanel);
    dialog.setValidatorCallback(new IDialogValidatorCallback() {
      public boolean validate() {
        if (textArea.getText() == null || "".equals(textArea.getText())) {
          MessageDialogBox dialog = new MessageDialogBox("Error", "Comment is blank.", false, true, true);
          dialog.center();
          return false;
        }
        return true;
      }
    });
    dialog.setCallback(new IDialogCallback() {
      public void okPressed() {
        Comment newComment = new Comment();
        newComment.setGlobalRead(true);
        newComment.setOwner(permissibleObject.getOwner());
        newComment.setAuthor(AuthenticationHandler.getInstance().getUser());
        newComment.setComment(textArea.getText());
        newComment.setParent(permissibleObject);
        newComment.setParentComment(parentComment);
        newComment.setEmail(emailTextBox.getText());
        submitComment(newComment);
      }

      public void cancelPressed() {
      }
    });
    dialog.center();
  }
View Full Code Here

  public void createNewAccount(final String username, final String firstname, final String lastname, final String password, final String passwordHint,
      final String email, final long birthday) {
    final AsyncCallback<User> loginCallback = new AsyncCallback<User>() {
      public void onFailure(Throwable caught) {
        MessageDialogBox dialog = new MessageDialogBox(BaseApplication.getMessages().getString("error", "Error"), BaseApplication.getMessages().getString(
            "couldNotCreateAccount", "Could not create new account. {0}", caught.getMessage()), true, true, true);
        dialog.setCallback(new IDialogCallback() {
          public void okPressed() {
            accountDialog.center();
          }

          public void cancelPressed() {
          }
        });
        dialog.center();
      }

      public void onSuccess(User user) {
        AuthenticationHandler.this.user = user;
        if (user == null) {
          MessageDialogBox dialog = new MessageDialogBox(BaseApplication.getMessages().getString("error", "Error"), BaseApplication.getMessages().getString(
              "couldNotCreateAccount", "Could not create new account.  Try entering a different username."), true, true, true);
          dialog.center();
        } else if (user.isValidated()) {
          accountDialog.hide();
          fireSetAuthenticatedUser(user);
        } else if (!user.isValidated()) {
          MessageDialogBox
View Full Code Here

  }

  public void editAccount(User user, String password) {
    final AsyncCallback<User> loginCallback = new AsyncCallback<User>() {
      public void onFailure(Throwable caught) {
        MessageDialogBox dialog = new MessageDialogBox(BaseApplication.getMessages().getString("error", "Error"), caught.getMessage(), true, true, true);
        dialog.setCallback(new IDialogCallback() {
          public void okPressed() {
            accountDialog.center();
          }

          public void cancelPressed() {
          }
        });
        dialog.center();
      }

      public void onSuccess(User user) {
        AuthenticationHandler.this.user = user;
        if (user == null) {
          MessageDialogBox dialog = new MessageDialogBox(BaseApplication.getMessages().getString("error", "Error"), BaseApplication.getMessages().getString(
              "couldNotEditAccount", "Could not edit account."), true, true, true);
          dialog.center();
        } else {
          accountDialog.hide();
          fireSetAuthenticatedUser(user);
        }
      };
View Full Code Here

    dialogBox.setContent(nameTextBox);
    dialogBox.setCallback(new IDialogCallback() {
      public void okPressed() {
        final AsyncCallback<Void> renameCallback = new AsyncCallback<Void>() {
          public void onFailure(Throwable caught) {
            MessageDialogBox messageDialog = new MessageDialogBox("Error", caught.getMessage(), false, true, true);
            messageDialog.center();
          }

          public void onSuccess(Void nothing) {
            repositoryCallback.objectRenamed(permissibleObject);
          }
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.