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

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


    }
    uploadPhotosImage.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        final ColorPickerDialog picker = new ColorPickerDialog("00ff00");
        picker.center();
        picker.setCallback(new IDialogCallback() {
          public void cancelPressed() {
          }

          public void okPressed() {
            Window.alert(picker.getHexColor());
View Full Code Here


  }

  public void execute() {
    PromptDialogBox dialogBox = new PromptDialogBox("Question", "Yes", null, "No", false, true);
    dialogBox.setContent(new Label("Delete " + permissibleObject.getName() + "?"));
    dialogBox.setCallback(new IDialogCallback() {
      public void okPressed() {
        final AsyncCallback<Void> deleteCallback = new AsyncCallback<Void>() {
          public void onFailure(Throwable caught) {
            MessageDialogBox messageDialog = new MessageDialogBox("Error", caught.getMessage(), false, true, true);
            messageDialog.center();
View Full Code Here

        }
        return valid;
      }
    });

    loginDialog.setCallback(new IDialogCallback() {
      public void okPressed() {
        login(usernameTextBox.getText(), passwordTextBox.getText());
      }

      public void cancelPressed() {
View Full Code Here

    contentPanel.setWidget(row, 1, disclaimerCheckBox);
    contentPanel.getCellFormatter().setHorizontalAlignment(row, 1, HasHorizontalAlignment.ALIGN_LEFT);
    row++;

    accountDialog.setCallback(new IDialogCallback() {
      public void okPressed() {
        boolean validationFailed = false;
        String validationMessage = "";
        if (usernameTextBox.getText() == null || "".equals(usernameTextBox.getText())) {
          validationMessage += BaseApplication.getMessages().getString("mustEnterUsername", "You must enter a username.") + "<BR>";
          validationFailed = true;
        }
        if (passwordTextBox.getText() == null || "".equals(passwordTextBox.getText())) {
          validationMessage += BaseApplication.getMessages().getString("mustEnterPassword", "You must enter a password and a confirmation password.") + "<BR>";
          validationFailed = true;
        }
        if (!passwordTextBox.getText().equals(passwordConfirm.getText())) {
          validationMessage += BaseApplication.getMessages().getString("passwordsDoNotMatch", "Passwords do not match.") + "<BR>";
          validationFailed = true;
        }
        if (emailAddress.getText() == null || "".equals(emailAddress.getText()) || emailAddress.getText().indexOf("@") == -1) {
          validationMessage += BaseApplication.getMessages().getString("mustEnterValidEmail", "You must enter a valid email address.") + "<BR>";
          validationFailed = true;
        }
        if (dateBox.getValue() == null) {
          validationMessage += BaseApplication.getMessages().getString("mustEnterBirthdate", "You must enter your birthdate.") + "<BR>";
          validationFailed = true;
        }

        if (StringUtils.isEmpty(captchaValidationTextBox.getText())) {
          validationMessage += BaseApplication.getMessages().getString("captchaValidationFailed", "You must enter validation text.") + "<BR>";
          validationFailed = true;
        }

        if (!disclaimerCheckBox.getValue()) {
          validationMessage += BaseApplication.getMessages().getString("mustReadDisclaimer",
              "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() {
View Full Code Here

    dateBox.setValue(date);
    contentPanel.setWidget(row, 1, dateBox);
    contentPanel.getCellFormatter().setHorizontalAlignment(row, 1, HasHorizontalAlignment.ALIGN_LEFT);
    row++;

    accountDialog.setCallback(new IDialogCallback() {
      public void okPressed() {
        boolean validationFailed = false;
        String validationMessage = "";

        if (passwordTextBox.getText() != null && !"".equals(passwordTextBox.getText()) && !passwordTextBox.getText().equals(passwordConfirm.getText())) {
          validationMessage += BaseApplication.getMessages().getString("mustEnterMatchingPasswords",
              "You must enter a matching password and confirmation password.");
          validationMessage += "<BR>";
          validationFailed = true;
        }
        if (emailAddress.getText() == null || "".equals(emailAddress.getText()) || emailAddress.getText().indexOf("@") == -1) {
          validationMessage += BaseApplication.getMessages().getString("mustEnterValidEmail", "You must enter a valid email address.");
          validationMessage += "<BR>";
          validationFailed = true;
        }
        if (dateBox.getValue() == null) {
          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() {
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() {
View Full Code Here

      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() {
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() {
View Full Code Here

            deleteCommentImage.setStyleName("commentActionButton");
            deleteCommentImage.setTitle("Remove comment");
            deleteCommentImage.addClickHandler(new ClickHandler() {

              public void onClick(ClickEvent event) {
                IDialogCallback callback = new IDialogCallback() {

                  public void cancelPressed() {
                  }

                  public void okPressed() {
View Full Code Here

          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());
View Full Code Here

TOP

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

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.