Examples of pathByAddingChild()


Examples of javax.swing.tree.TreePath.pathByAddingChild()

   */
  public Object getUniqueKey(Object objTarget, Object objParentUniqueKey) {
    TreePath objPath = (TreePath)objParentUniqueKey;
    Object objTargetUID = null;
    if(objPath != null){
      objTargetUID = objPath.pathByAddingChild(objTarget);
    }else{
      objTargetUID = new TreePath(objTarget);
    }
    return objTargetUID;
  }
View Full Code Here

Examples of javax.swing.tree.TreePath.pathByAddingChild()

            mChannel.writeNack("config tree not found");
            return;
        }
        TreePath tp = new TreePath(configTree.getModel().getRoot());
        Object node = Utils.findChildNode(configTree.getModel(), configTree.getModel().getRoot(), "API");
        tp = tp.pathByAddingChild(node);

        // later versions of TWS have a Settings node below the API node
        node = Utils.findChildNode(configTree.getModel(), node, "Settings");
        if (!(node == null)) tp = tp.pathByAddingChild(node);
View Full Code Here

Examples of javax.swing.tree.TreePath.pathByAddingChild()

        Object node = Utils.findChildNode(configTree.getModel(), configTree.getModel().getRoot(), "API");
        tp = tp.pathByAddingChild(node);

        // later versions of TWS have a Settings node below the API node
        node = Utils.findChildNode(configTree.getModel(), node, "Settings");
        if (!(node == null)) tp = tp.pathByAddingChild(node);

        Utils.logToConsole("getExpandsSelectedPaths = " + configTree.getExpandsSelectedPaths());
        Utils.logToConsole("Selection path = " + tp.toString());
        configTree.setSelectionPath(tp);
View Full Code Here

Examples of javax.swing.tree.TreePath.pathByAddingChild()

                {
                    // Then we need to perform a drag-and-drop operation!
                    moveNode(currentDragDropNode, (JreepadNode)selPath.getLastPathComponent());

                    // Ensure that the destination node is open
                    setSelectionPath(selPath.pathByAddingChild(currentDragDropNode));
                }
            }
            setCursor(Cursor.getDefaultCursor());
            currentDragDropNode = null;
        }
View Full Code Here

Examples of javax.swing.tree.TreePath.pathByAddingChild()

    JreepadNode newParent = ((JreepadNode)currentNode.getParent().getChildAt(pos-1));

    if(currentNode.indent())
    {
      treeModel.reload(currentNode.getParent().getParent());
      parentPath = parentPath.pathByAddingChild(newParent);
      TreePath myPath = parentPath.pathByAddingChild(currentNode);
      // Now use scrollPathToVisible() or scrollRowToVisible() to make sure it's visible
      tree.scrollPathToVisible(myPath);
      tree.setSelectionPath(myPath);
    }
View Full Code Here

Examples of javax.swing.tree.TreePath.pathByAddingChild()

    //DEL storeForUndo();
    TreePath parentPath = tree.getSelectionPath().getParentPath();
    JreepadNode parent = currentNode.getParentNode();
    JreepadNode ret = parent.addChild(index+1);
    treeModel.nodesWereInserted(parent, new int[]{index+1});
    tree.startEditingAtPath(parentPath.pathByAddingChild(ret));
    return ret;
  }

  public JreepadNode addNode()
  {
View Full Code Here

Examples of javax.swing.tree.TreePath.pathByAddingChild()

    JreepadNode ret = currentNode.addChild();
    TreePath nodePath = tree.getSelectionPath();
    treeModel.nodesWereInserted(currentNode, new int[]{currentNode.getIndex(ret)});

//    tree.setSelectionPath(nodePath.pathByAddingChild(ret));
    tree.scrollPathToVisible(nodePath.pathByAddingChild(ret));
    tree.startEditingAtPath(nodePath.pathByAddingChild(ret));
    return ret;
  }

  public JreepadNode removeNode()
View Full Code Here

Examples of javax.swing.tree.TreePath.pathByAddingChild()

    TreePath nodePath = tree.getSelectionPath();
    treeModel.nodesWereInserted(currentNode, new int[]{currentNode.getIndex(ret)});

//    tree.setSelectionPath(nodePath.pathByAddingChild(ret));
    tree.scrollPathToVisible(nodePath.pathByAddingChild(ret));
    tree.startEditingAtPath(nodePath.pathByAddingChild(ret));
    return ret;
  }

  public JreepadNode removeNode()
  {
View Full Code Here

Examples of javax.swing.tree.TreePath.pathByAddingChild()

      for(int i=1; i<pathNames.size(); i++)
      {
        nextNode = nextNode.getChildByTitle((String)pathNames.get(i));
        if(nextNode == null)
          return false;
        goTo = goTo.pathByAddingChild(nextNode);
      }
      tree.setSelectionPath(goTo);
    tree.scrollPathToVisible(goTo);
    return true;
  }
View Full Code Here

Examples of javax.swing.tree.TreePath.pathByAddingChild()

        TreePath newPath;
      newNode = new JreepadNode(text, "");
      addChild(newNode);
      TreePath leadPath = tree.getLeadSelectionPath();
      if(leadPath != null)
        newPath = leadPath.pathByAddingChild(newNode);
      else
        newPath = new TreePath(newNode);

      // Now we need to select it... how do we do that?
      tree.setSelectionPath(newPath);
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.