Examples of AWorkspaceTreeNode


Examples of org.freeplane.plugin.workspace.model.AWorkspaceTreeNode

    super("workspace.action.file.new.mindmap", TextUtils.getRawText("workspace.action.file.new.mindmap.label"), icon);
  }
 
  public void actionPerformed(final ActionEvent e) {
    Controller.getCurrentController().selectMode(MModeController.MODENAME);
    AWorkspaceTreeNode targetNode = this.getNodeFromActionEvent(e);
    if(targetNode instanceof IFileSystemRepresentation ) {
      String fileName = JOptionPane.showInputDialog(Controller.getCurrentController().getViewController().getContentPane(),
        TextUtils.getText("add_new_mindmap"), TextUtils.getText("add_new_mindmap_title"),
        JOptionPane.OK_CANCEL_OPTION);
   
      if (fileName != null && fileName.length()>0) {
        if (!fileName.endsWith(".mm")) {
          fileName += ".mm";
        }
        File file = new File(((IFileSystemRepresentation) targetNode).getFile(), fileName);
        try {
          file = WorkspaceController.getFileSystemMgr().createFile(fileName, ((IFileSystemRepresentation) targetNode).getFile());
          if (createNewMindmap(file)) {
            targetNode.refresh();
          }
        }
        catch(Exception ex) {
          JOptionPane.showMessageDialog(UITools.getFrame(), ex.getMessage(), "Error ... ", JOptionPane.ERROR_MESSAGE);
          ex.printStackTrace();
View Full Code Here

Examples of org.freeplane.plugin.workspace.model.AWorkspaceTreeNode

 
  /**
   *
   */
  public void actionPerformed(ActionEvent e) {
    AWorkspaceTreeNode targetNode = getNodeFromActionEvent(e);
    if(targetNode instanceof IFileSystemRepresentation) {
      if(this.isSelected()==((IFileSystemRepresentation) targetNode).orderDescending()) {
        ((IFileSystemRepresentation) targetNode).orderDescending(!this.isSelected());
        targetNode.refresh();
      }
    }
  }
View Full Code Here

Examples of org.freeplane.plugin.workspace.model.AWorkspaceTreeNode

    }
    super.setEnabledFor(node, selectedPaths);
  }
 
  public void actionPerformed(final ActionEvent e) {
        AWorkspaceTreeNode targetNode = getNodeFromActionEvent(e);
        if(DnDController.isDropAllowed(targetNode)) {
          Clipboard clip = Toolkit.getDefaultToolkit().getSystemClipboard();
          Transferable transf = clip.getContents(null);
          if(transf == null) {
            return;
View Full Code Here

Examples of org.freeplane.plugin.workspace.model.AWorkspaceTreeNode

  }
 
 
 
  protected AWorkspaceProject getProjectFromActionEvent(ActionEvent e) {
    AWorkspaceTreeNode node = getNodeFromActionEvent(e);
    if(node == null) {
      return null;
    }
    return WorkspaceController.getProject(node);
  }
View Full Code Here

Examples of org.freeplane.plugin.workspace.model.AWorkspaceTreeNode

        ,JOptionPane.YES_NO_OPTION
        ,JOptionPane.QUESTION_MESSAGE
    );
    if(option == JOptionPane.YES_OPTION) {     
      for (AWorkspaceTreeNode targetNode : targetNodes) {
        AWorkspaceTreeNode parent = targetNode.getParent();
        if(targetNode instanceof DefaultFileNode) {
          //WORKSPACE - info: used in case of key events
          ((DefaultFileNode) targetNode).delete();
        }
        else {
          targetNode.getModel().removeNodeFromParent(targetNode);
        }
        if(parent != null) {
          parent.refresh();
        }
       
      }
     
    }
View Full Code Here

Examples of org.freeplane.plugin.workspace.model.AWorkspaceTreeNode

  public boolean isLeaf() {
    return false;
  }

  public AWorkspaceTreeNode getChildAt(int childIndex) {
    AWorkspaceTreeNode node = null;
    int offset = super.getChildCount();
    if(offset > 0) {
      node = super.getChildAt(childIndex);
    }
    if(node == null) {
View Full Code Here

Examples of org.freeplane.plugin.workspace.model.AWorkspaceTreeNode

    reload(root);
  }

  public void nodeChanged(AWorkspaceTreeNode node) {
    if (listenerList != null && node != null) {
      AWorkspaceTreeNode parent = node.getParent();

      if (parent != null) {
        int anIndex = parent.getIndex(node);
        if (anIndex != -1) {
          int[] cIndexs = new int[1];

          cIndexs[0] = anIndex;
          nodesChanged(parent, cIndexs);
View Full Code Here

Examples of org.freeplane.plugin.workspace.model.AWorkspaceTreeNode

  private void addToIndexRecursively(AWorkspaceTreeNode node, AWorkspaceTreeNode targetNode) {
    this.hashStringKeyIndex.put(node.getKey(), node);
    if (node.getChildCount() > 0) {
      int[] indices = new int[node.getChildCount()];
      for (int i = 0; i < node.getChildCount(); i++) {
        AWorkspaceTreeNode childNode = node.getChildAt(i);
        addToIndexRecursively(childNode, node);
        indices[i] = targetNode.getChildCount() - 1;
      }
      nodesWereInserted(targetNode, indices);
    }
View Full Code Here

Examples of org.freeplane.plugin.workspace.model.AWorkspaceTreeNode

  /**
   * @param node
   */
  public void removeAllElements(AWorkspaceTreeNode node) {
    Enumeration<AWorkspaceTreeNode> children = node.children();
    AWorkspaceTreeNode child = null;
    while (children.hasMoreElements()) {
      child = children.nextElement();
      this.hashStringKeyIndex.remove(child.getKey());
      child.disassociateReferences();
      fireTreeNodesRemoved(this, node.getTreePath(), null, new Object[] { child });
    }
    node.removeAllChildren();

  }
View Full Code Here

Examples of org.freeplane.plugin.workspace.model.AWorkspaceTreeNode

  /**
   * @param node
   */
  public void removeNodeFromParent(AWorkspaceTreeNode node) {
    this.hashStringKeyIndex.remove(node.getKey());
    AWorkspaceTreeNode parent = node.getParent();
    parent.removeChild(node);
    node.disassociateReferences();
    fireTreeNodesRemoved(this, parent.getTreePath(), null, new Object[] { node });
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.