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

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


          public void onFailure(Throwable reason) {
          }

          public void onSuccess() {
            popup.hide();
            PromptDialogBox dialogBox = new PromptDialogBox(getMessages().getString("fileManager", "File Manager"), getMessages().getString("close", "Close"),
                null, null, false, false);
            // create a new filemanager for this user
            FileManagerPanel fileManager = new FileManagerPanel(getMessages().getString("fileManager", "File Manager"));
            dialogBox.setContent(fileManager);
            dialogBox.center();
          }
        });
      }
    });
    myFilesMenuItem.setTitle(getMessages().getString("manageFiles", "Manage Files"));
View Full Code Here


    this.permissibleObject = permissibleObject;
    this.repositoryCallback = repositoryCallback;
  }

  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();
          }

          public void onSuccess(Void nothing) {
            repositoryCallback.fileDeleted();
          }
        };
        BaseServiceCache.getService().deletePermissibleObject(permissibleObject, deleteCallback);
      }

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

      public void onClick(ClickEvent event) {
        textBox.selectAll();
      }
    });
    PromptDialogBox linkDialog = new PromptDialogBox("Paste link in email or IM", "OK", null, null, true, true);
    // linkDialog.setAnimationEnabled(false);
    linkDialog.setContent(textBox);
    linkDialog.center();
    Timer selectAllTimer = new Timer() {
      public void run() {
        textBox.selectAll();
      }
    };
View Full Code Here

    this.repositoryCallback = repositoryCallback;
    this.permissibleObject = permissibleObject;
  }

  public void execute() {
    final PromptDialogBox uploadDialog = new PromptDialogBox("Upload File", "Send", null, "Cancel", false, true);
    IFileUploadCallback fileUploadCallback = new IFileUploadCallback() {
      public void uploadFailed() {
        uploadDialog.hide();
        MessageDialogBox messageDialog = new MessageDialogBox("Error", "Upload failed, check file permissions.", false, true, true);
        messageDialog.center();
      }
      public void fileUploaded(String id) {
        uploadDialog.hide();
        if (id == null || "".equals(id)) {
          MessageDialogBox messageDialog = new MessageDialogBox("Error", "Upload failed, check file permissions.", false, true, true);
          messageDialog.center();
          return;
        }
        repositoryCallback.fileUploaded(id);
      }
    };
    PermissibleObject parentFolder = null;
    if (permissibleObject instanceof File) {
      parentFolder = permissibleObject.getParent();
    } else if (permissibleObject instanceof Folder) {
      parentFolder = (Folder) permissibleObject;
    }
    final FileUploadPanel fileuploader = new FileUploadPanel(fileUploadCallback, parentFolder, BaseApplication.getSettings().getString("FileUploadService", BaseApplication.FILE_UPLOAD_SERVICE_PATH));
    uploadDialog.setContent(fileuploader);
    uploadDialog.setValidatorCallback(new IDialogValidatorCallback() {
      public boolean validate() {
        fileuploader.submit();
        return false;
      }
    });
    uploadDialog.center();
  }
View Full Code Here

                  public void okPressed() {
                    deleteComment(comment);
                  }
                };
                PromptDialogBox dialogBox = new PromptDialogBox("Question", "Yes", null, "No", false, true);
                dialogBox.setContent(new Label("Delete comment by " + (comment.getAuthor() == null ? comment.getEmail() : comment.getAuthor().getUsername())
                    + "?"));
                dialogBox.setCallback(callback);
                dialogBox.center();
              }
            });
            commentHeaderPanel.setWidget(0, columnIndex, deleteCommentImage);
            commentHeaderPanel.getFlexCellFormatter().setHorizontalAlignment(0, columnIndex, HasHorizontalAlignment.ALIGN_RIGHT);
            columnIndex++;
View Full Code Here

    if (parentComment.getAuthor() != null) {
      replyPromptMessage = "Reply To: " + parentComment.getAuthor().getUsername();
    } else if (!StringUtils.isEmpty(parentComment.getEmail())) {
      replyPromptMessage = "Reply To: " + parentComment.getEmail();
    }
    PromptDialogBox dialog = new PromptDialogBox(replyPromptMessage, "Submit", null, "Cancel", false, true);
    dialog.setAllowKeyboardEvents(false);
    VerticalPanel replyPanel = new VerticalPanel();

    final TextArea textArea = new TextArea();
    textArea.setCharacterWidth(60);
    textArea.setVisibleLines(4);
    final TextBox emailTextBox = new TextBox();
    if (AuthenticationHandler.getInstance().getUser() == null) {
      replyPanel.add(new Label("Email:"));
      replyPanel.add(emailTextBox);
    }
    replyPanel.add(textArea);

    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 execute() {
    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();
          }

          public void onSuccess(Void nothing) {
            repositoryCallback.objectRenamed(permissibleObject);
          }
        };

        if (permissibleObject instanceof File) {
          File file = (File) permissibleObject;
          file.setName(nameTextBox.getText());
          BaseServiceCache.getService().renameFile(file, renameCallback);
        } else if (permissibleObject instanceof Folder) {
          Folder folder = (Folder) permissibleObject;
          folder.setName(nameTextBox.getText());
          BaseServiceCache.getService().renameFolder(folder, renameCallback);
        }
      }

      public void cancelPressed() {
      }
    });
    dialogBox.setValidatorCallback(new IDialogValidatorCallback() {
      public boolean validate() {
        return (nameTextBox.getText() != null && !"".equals(nameTextBox.getText()));
      }
    });
    dialogBox.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);
                SecurityPrincipal principal = fetchedUsers.get(addPrincipalListBox.getItemText(i));
                if (principal == null) {
                  principal = fetchedGroups.get(addPrincipalListBox.getItemText(i));
                }
                newPerm.setSecurityPrincipal(principal);
                permissions.add(newPerm);
                dirty = true;
                populateUI();
                if (principalListBox.getItemCount() > 0) {
                  principalListBox.setSelectedIndex(principalListBox.getItemCount() - 1);
                }
                populatePermissionPanel();
              }
            }
          }

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

    Button removeButton = new Button("Remove...");
    removeButton.addClickHandler(new ClickHandler() {
View Full Code Here

        Photo photo = preview && ((Photo) object).getSlideshowImage() != null ? ((Photo) object).getSlideshowImage() : (Photo) object;
        String url = BaseApplication.getSettings().getString("GetFileService", BaseApplication.GET_FILE_SERVICE_PATH) + photo.getId() + "_inline_" + photo.getName();
        Image image = new Image(url);
        image.setHeight(photo.getHeight() + "px");
        image.setWidth(photo.getWidth() + "px");
        final PromptDialogBox promptDialog = new PromptDialogBox("Preview", "Close", null, null, true, true);
        promptDialog.setContent(image);
        promptDialog.center();
      } else if ("audio/mpeg".equals(object.getContentType())) {
        String url = BaseApplication.getSettings().getString("GetFileService", BaseApplication.GET_FILE_SERVICE_PATH) + object.getId() + "_inline_" + object.getName();
        String name = ((File) object).getName();
        MP3Player.getInstance().addSoundToPlayList(name, url);
        MP3Player.getInstance().play();
View Full Code Here

  public void execute() {
    popup.hide();
    EditGroupsPanel panel = new EditGroupsPanel(null, null, null, user, true, true);
    panel.setWidth("100%");
    PromptDialogBox promptDialog = new PromptDialogBox("Manage My Groups", "OK", null, null, false, true);
    promptDialog.setContent(panel);
    promptDialog.setWidth("640px");
    promptDialog.setHeight("200px");
    promptDialog.center();
  }
View Full Code Here

TOP

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

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.