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

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


    final TextBox nameTextBox = new TextBox();
    nameTextBox.setVisibleLength(60);
    nameTextBox.setText(permissibleObject.getName());
    PromptDialogBox dialogBox = new PromptDialogBox("Enter New Name", "OK", null, "Cancel", false, true);
    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();
View Full Code Here


          BaseServiceCache.getService().getGroups(AuthenticationHandler.getInstance().getUser(), getGroupsCallback);
        }

        PromptDialogBox dialog = new PromptDialogBox("Add New Permission", "OK", null, "Cancel", false, true);
        dialog.setContent(addPermissionPanel);
        dialog.setCallback(new IDialogCallback() {
          public void okPressed() {
            for (int i = 0; i < addPrincipalListBox.getItemCount(); i++) {
              if (addPrincipalListBox.isItemSelected(i)) {
                Permission newPerm = new Permission();
                newPerm.setPermissibleObject(permissibleObject);
View Full Code Here

  public void execute() {
    final TextBox folderNameTextBox = new TextBox();
    folderNameTextBox.setVisibleLength(60);
    PromptDialogBox dialogBox = new PromptDialogBox("Enter New Folder Name", "OK", null, "Cancel", false, true);
    dialogBox.setContent(folderNameTextBox);
    dialogBox.setCallback(new IDialogCallback() {
      public void okPressed() {
        PermissibleObject parentFolder = null;
        if (repositoryTree.getLastItem() != null && repositoryTree.getLastItem().getUserObject() instanceof PermissibleObject) {
          PermissibleObject permissibleObject = (PermissibleObject) repositoryTree.getLastItem().getUserObject();
          parentFolder = permissibleObject.getParent();
View Full Code Here

          return false;
        }
        return true;
      }
    });
    editGroupDialogBox.setCallback(new IDialogCallback() {
      public void okPressed() {
        if (!editGroupPanel.apply()) {
          editGroupDialogBox.center();
        }
      }
View Full Code Here

      if (permissibleObject != null) {
        final PromptDialogBox dialogBox = new PromptDialogBox("Properties", "OK", null, "Cancel", false, true);
        final AsyncCallback<Void> callback = new AsyncCallback<Void>() {
          public void onFailure(Throwable caught) {
            MessageDialogBox messageDialog = new MessageDialogBox("Error", caught.getMessage(), false, true, true);
            messageDialog.setCallback(new IDialogCallback() {
              public void okPressed() {
              }

              public void cancelPressed() {
                dialogBox.center();
              }
            });
            messageDialog.center();
          }

          public void onSuccess(Void result) {
          }
        };
        final PropertiesPanel propertiesPanel = new PropertiesPanel(permissibleObject, null, VIEW.GENERAL);
        dialogBox.setContent(propertiesPanel);
        dialogBox.setCallback(new IDialogCallback() {
          public void okPressed() {
            propertiesPanel.apply(callback);
          }

          public void cancelPressed() {
View Full Code Here

        final UserGroup group = new UserGroup();
        group.setOwner(user);
        editGroupPanel = new EditGroupPanel(callback, EditGroupsPanel.this, users, group, false, true);
        final PromptDialogBox editGroupDialogBox = new PromptDialogBox("Create New Group", "OK", null, "Cancel", false, true);
        editGroupDialogBox.setContent(editGroupPanel);
        editGroupDialogBox.setCallback(new IDialogCallback() {
          public void okPressed() {
            if (!editGroupPanel.apply()) {
              editGroupDialogBox.center();
            } else {
              populateUI();
              if (callback != null) {
                callback.userGroupsFetched(groups);
              }
            }
          }

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

    deleteGroupButton.setTitle("Delete Group");
    deleteGroupButton.setEnabled(false);
    deleteGroupButton.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {

        if (groupsList.getSelectedIndex() < 0) {
          return;
        }

        final UserGroup group = groupMap.get(groupsList.getItemText(groupsList.getSelectedIndex()));

        final PromptDialogBox deleteGroupDialogBox = new PromptDialogBox("Confirm", "Yes", null, "No", false, true);
        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;
                populateUI();
                if (callback != null) {
                  callback.userGroupsFetched(groups);
                }
              };
            };
            BaseServiceCache.getService().deleteGroup(group, deleteGroupCallback);

          }

          public void cancelPressed() {
          }
        });
        deleteGroupDialogBox.center();
      }
    });
    editGroupButton.setTitle("Edit Group Settings");
    editGroupButton.setEnabled(false);
    editGroupButton.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        if (groupsList.getSelectedIndex() < 0) {
          return;
        }
        final UserGroup group = groupMap.get(groupsList.getItemText(groupsList.getSelectedIndex()));
        editGroupPanel = new EditGroupPanel(callback, EditGroupsPanel.this, users, group, false, true);
        final PromptDialogBox editGroupDialogBox = new PromptDialogBox("Edit Group", "OK", null, "Cancel", false, true);
        editGroupDialogBox.setContent(editGroupPanel);
        editGroupDialogBox.setCallback(new IDialogCallback() {
          public void okPressed() {
            if (!editGroupPanel.apply()) {
              editGroupDialogBox.center();
            } else {
              if (callback != null) {
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.