Package javax.swing.tree

Examples of javax.swing.tree.TreeNode.children()


        
         DefaultMutableTreeNode result = new DefaultMutableTreeNode( concatenatedFunctions(node,context));
        
         if (node.getChildCount() > 0)
         {
            Enumeration children = node.children();
            while (children.hasMoreElements())
               treenode(children.nextElement(), context);
         }
        
         if (getAfterRecursionFunction() != null)
View Full Code Here


      System.out.println(a3.getAbsolutePath());
      TreeNode rootNode = FileBoostUtils.createTreeNode(tempDir, new InvocationContext());
      assertEquals(2, rootNode.getChildCount());
      assertFalse(rootNode.isLeaf());
     
      Enumeration<TreeNode> subdirs = rootNode.children();
      assertTrue(subdirs.hasMoreElements());
      TreeNode dirAnode = subdirs.nextElement();
      assertTrue(subdirs.hasMoreElements());
      TreeNode dirBnode = subdirs.nextElement();
      assertFalse(subdirs.hasMoreElements());
View Full Code Here

    private void expandAll(JTree tree, TreePath parent, boolean expand) {
        // Traverse children
        TreeNode node = (TreeNode)parent.getLastPathComponent();
        if (node.getChildCount() >= 0) {
            for (Enumeration<?> e = node.children(); e.hasMoreElements(); ) {
                TreeNode n = (TreeNode)e.nextElement();
                TreePath path = parent.pathByAddingChild(n);
                expandAll(tree, path, expand);
            }
        }
View Full Code Here

     */
    private void expandAll(TreePath parentPath, boolean expand) {
        // Expansion or collapsing must be done from the bottom-up.
        // Traverse children first.
        TreeNode parentNode = (TreeNode)parentPath.getLastPathComponent();
        for (Enumeration<TreeNode> e = UnsafeCast.unsafeCast(parentNode.children()); e.hasMoreElements(); ) {
            TreeNode nextChildNode = e.nextElement();
            TreePath childPath = parentPath.pathByAddingChild(nextChildNode);
            expandAll(childPath, expand);
        }
   
View Full Code Here

    public void treeExpanded(javax.swing.event.TreeExpansionEvent treeExpansionEvent) {
        TreeNode node = (TreeNode) treeExpansionEvent.getPath().getLastPathComponent();
        if (node instanceof AccessibilityNode) {
            // Calling oneway methods from an UNO thread may cause
            // deadlocks, so adding the listeners here.
            for (java.util.Enumeration e = node.children(); e.hasMoreElements(); ) {
                ((AccessibilityNode) e.nextElement()).setAttached(true);
            }
        }
    }
   
View Full Code Here

            throws javax.swing.tree.ExpandVetoException {
        TreeNode node = (TreeNode) treeExpansionEvent.getPath().getLastPathComponent();
        if (node instanceof AccessibilityNode) {
            // Calling oneway methods from an UNO thread may cause
            // deadlocks, so adding the listeners here.
            for (java.util.Enumeration e = node.children(); e.hasMoreElements(); ) {
                ((AccessibilityNode) e.nextElement()).setAttached(false);
            }
        }
    }
   
View Full Code Here

  private final void expandAll(TreePath parent, boolean expand)
  {
    TreeNode node = (TreeNode)parent.getLastPathComponent();
    if (node.getChildCount() >= 0)
    {
      for (Enumeration e = node.children(); e.hasMoreElements();)
      {
        TreeNode n = (TreeNode)e.nextElement();
        TreePath path = parent.pathByAddingChild(n);
        expandAll(path, expand);
      }
View Full Code Here

      @Override
      public void actionPerformed(ActionEvent e) {
        TreeNode root = (TreeNode) configTree.getModel().getRoot();
        TreePath parent = new TreePath(root);
        for (Enumeration categ = root.children(); categ.hasMoreElements();) {
          TreeNode n = (TreeNode) categ.nextElement();
          TreePath child = parent.pathByAddingChild(n);
          configTree.expandPath(child);
        }
      }
View Full Code Here

      @Override
      public void actionPerformed(ActionEvent e) {
        TreeNode root = (TreeNode) configTree.getModel().getRoot();
        TreePath parent = new TreePath(root);
        for (Enumeration categ = root.children(); categ.hasMoreElements();) {
          TreeNode n = (TreeNode) categ.nextElement();
          TreePath child = parent.pathByAddingChild(n);
          configTree.collapsePath(child);
        }
      }
View Full Code Here

      public TreeNode next() {
          Enumeration  enumer = (Enumeration)stack.peek();
          int level=levelStack.peek();
          TreeNode  node = (TreeNode)enumer.nextElement();
          Enumeration  children = level==maxLevel?null:node.children();

          if (!enumer.hasMoreElements()) {
        stack.pop();
        levelStack.pop();
          }
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.