Examples of TreePath


Examples of charvax.swing.tree.TreePath

    /** Used to create an event when the node structure has changed in some way,
     * identifying the path to the root of a modified subtree as an array of
     * Objects.
     */
     public TreeModelEvent(Object source, Object[] objects) {
   this(source, new TreePath(objects), null, null);
     }
View Full Code Here

Examples of com.sun.source.util.TreePath

    ScannerTest test = new ScannerTest() {
      private boolean matched = false;

      @Override
      public Void visitAnnotation(AnnotationTree node, VisitorState visitorState) {
        TreePath currPath = getCurrentPath().getParentPath();
        Tree parent = currPath.getLeaf();
        if (parent.getKind() == Kind.MODIFIERS) {
          currPath = currPath.getParentPath();
          parent = currPath.getLeaf();
        }
        if (toMatch.matches(parent, visitorState)) {
          matched = true;
        }
        return super.visitAnnotation(node, visitorState);
View Full Code Here

Examples of echopointng.tree.TreePath

    /**
     * @return The selected node within the table
     */
    public DefaultMutableTreeNode getSelectedNode() {
        TreePath path = this.getSelectedPath();
        if ((path != null) && (path.getLastPathComponent() != null) && (path.getLastPathComponent() instanceof DefaultMutableTreeNode)) {
            return ((DefaultMutableTreeNode) path.getLastPathComponent());
        } else {
            return null;
        }
    }
View Full Code Here

Examples of javax.swing.tree.TreePath

    // create the tree, and find the path to the current class
    m_treeNodeOfCurrentObject = null;
    final JTree tree = createTree(m_ObjectNames);
    if (m_treeNodeOfCurrentObject != null) {
      tree.setSelectionPath(new TreePath(m_treeNodeOfCurrentObject.getPath()));
    }
    tree.getSelectionModel().setSelectionMode
      (TreeSelectionModel.SINGLE_TREE_SELECTION);

    // create the popup
View Full Code Here

Examples of javax.swing.tree.TreePath

      if (m_Capabilities != null)
  return;
      if (!isLeaf())
  return;
     
      classname = getClassnameFromPath(new TreePath(getPath()));
      try {
  cls = Class.forName(classname);
  if (!ClassDiscovery.hasInterface(CapabilitiesHandler.class, cls))
    return;
 
View Full Code Here

Examples of javax.swing.tree.TreePath

  }


  public void mouseClicked(MouseEvent e) {

    TreePath path = mTree.getPathForLocation(e.getX(), e.getY());
    if (path == null) {
      return;
    }
    boolean isDoubleClick = SwingUtilities.isLeftMouseButton(e) && (e.getClickCount() == 2);
View Full Code Here

Examples of javax.swing.tree.TreePath

  /**
   * Shows the Popup
   * @param e MouseEvent for X/Y Coordinates
   */
  private void showPopup(MouseEvent e) {
    TreePath path = mTree.getPathForLocation(e.getX(), e.getY());
    if (path == null) {
      path = new TreePath(mTree.getModel().getRoot());
      mTree.setSelectionPath(path);
    }

    // After Popup-Trigger, there is should be only one path selected
    if (!mTree.getSelectionModel().isPathSelected(path)) {
View Full Code Here

Examples of javax.swing.tree.TreePath

            if (n >= parent.getChildCount()) {
              n--;
            }
            if(n > 0) {
              setSelectionPath(new TreePath(((FavoriteNode)parent.getChildAt(n)).getPath()));
            } else {
              setSelectionPath(new TreePath(parent.getPath()));
            }
          }
        }
        else if (e.getKeyCode() == KeyEvent.VK_CONTEXT_MENU) {
          if(getSelectionPath() != null) {
View Full Code Here

Examples of javax.swing.tree.TreePath

      int row = getClosestRowForLocation(p.x, p.y);
      if (row >= 0 && row < getRowCount()) {
        setSelectionRow(row);
      }

      TreePath path1 = null;
      int[] selectionRows = getSelectionRows();
      if (selectionRows.length > 0) {
        path1 = getPathForRow(selectionRows[0]);
      }

      if(path1 == null) {
        path1 = new TreePath(mRootNode);
      }

      final TreePath path = path1;
      final FavoriteNode last = (FavoriteNode)path.getLastPathComponent();

      setSelectionPath(path);

      JMenuItem item;
View Full Code Here

Examples of javax.swing.tree.TreePath

    }
  }

  private void expandAll(FavoriteNode node) {
    if(node.isDirectoryNode()) {
      expandPath(new TreePath(node.getPath()));

      for(int i = 0; i < node.getChildCount(); i++) {
        FavoriteNode child = (FavoriteNode)node.getChildAt(i);

        if(child.isDirectoryNode()) {
          expandPath(new TreePath(child.getPath()));
          expandAll(child);
        }
      }
    }
  }
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.