예제 #1
0
  /** Disable or enable toolbar buttons. If mailfolder is null all buttons get disabled. */
  private void changeToolbarButtonStatus(IGWTFolder mailFolder) {

    this.newFolderButton.setDisabled(
        mailFolder != null ? !mailFolder.isCreateSubfolderSupported() : true);
    this.deleteFolderButton.setDisabled(
        mailFolder != null ? !mailFolder.isDeleteSupported() : true);
    this.emptyFolderButton.setDisabled(mailFolder != null ? !mailFolder.isEmptySupported() : true);
  }
예제 #2
0
    public void onFolderDrop(FolderDropEvent event) {

      if (event.getNodes() != null && event.getNodes().length > 0) {
        TreeNode sourceNode = event.getNodes()[0];
        IGWTFolder sourceFolder = GWTUtil.getGwtFolder(sourceNode);
        if (sourceFolder.isMoveSupported()) {
          TreeNode targetNode = event.getFolder();
          IGWTFolder targetFolder = GWTUtil.getGwtFolder(targetNode);
          if (!isSame(sourceFolder.getParent(), targetFolder)) {
            ActionRegistry.MOVE_FOLDER.get(MoveFolderAction.class).setSourceNode(sourceNode);
            ActionRegistry.MOVE_FOLDER.get(MoveFolderAction.class).setTargetNode(targetNode);
            ActionRegistry.MOVE_FOLDER.execute();
          }
        }
      }
    }
예제 #3
0
    private boolean isSame(IGWTFolder folder1, IGWTFolder folder2) {

      return folder1.getId().equals(folder2.getId());
    }