Exemplo n.º 1
0
    private void prepareActions(TreeNode selectedTreeNode) {

      ActionRegistry.NEW_FOLDER.get(GWTFolderAction.class).setSelectedTreeNode(selectedTreeNode);
      ActionRegistry.NEW_FOLDER.get(GWTFolderAction.class).setTree(tree);
      ActionRegistry.RENAME_FOLDER.get(GWTFolderAction.class).setSelectedTreeNode(selectedTreeNode);
      ActionRegistry.RENAME_FOLDER.get(GWTFolderAction.class).setTree(tree);
      ActionRegistry.DELETE_FOLDER.get(GWTFolderAction.class).setSelectedTreeNode(selectedTreeNode);
      ActionRegistry.DELETE_FOLDER.get(GWTFolderAction.class).setTree(tree);
      ActionRegistry.EMPTY_FOLDER.get(GWTFolderAction.class).setSelectedTreeNode(selectedTreeNode);
      ActionRegistry.EMPTY_FOLDER.get(GWTFolderAction.class).setTree(tree);
      ActionRegistry.MOVE_FOLDER.get(GWTFolderAction.class).setSelectedTreeNode(selectedTreeNode);
      ActionRegistry.MOVE_FOLDER.get(GWTFolderAction.class).setTree(tree);
    }
Exemplo n.º 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();
          }
        }
      }
    }