Package javax.swing.tree

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


   */
  private static void expandAll(final JTree tree, final TreePath parent, final boolean expand) {
    // Traverse children
    final TreeNode node = (TreeNode) parent.getLastPathComponent();
    if (node.getChildCount() >= 0)
      for (final Enumeration<?> e = node.children(); e.hasMoreElements();) {
        final TreeNode n = (TreeNode) e.nextElement();
        final TreePath path = parent.pathByAddingChild(n);
        expandAll(tree, path, expand);
      }
    // Expansion or collapse must be done bottom-up
View Full Code Here


    @SuppressWarnings("unchecked")
  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);
                this._expandAll(tree, path, expand);
            }
        }
View Full Code Here

    @SuppressWarnings("unchecked")
  private static 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

    @SuppressWarnings("unchecked")
  private static 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 fullyExpandTreeNode(final TreePath path) {
    // expand the path
    theTree.expandPath(path);
    // expand the children
    final TreeNode node = (TreeNode) path.getLastPathComponent();
    final Enumeration<?> children = node.children();
    while (children.hasMoreElements()) {
      TreeNode child = (TreeNode) children.nextElement();
      fullyExpandTreeNode(path.pathByAddingChild(child));
    }
  }
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 static void expandAll(JTree tree, TreePath parent, boolean expand) {
    // Traverse children
    TreeNode node = (TreeNode) parent.getLastPathComponent();
    if (node.getChildCount() >= 0) {
      for (Enumeration<TreeNode> en = node.children(); en
          .hasMoreElements();) {
        TreeNode n = en.nextElement();
        TreePath path = parent.pathByAddingChild(n);
        expandAll(tree, path, expand);
      }
View Full Code Here

    }

    private static void expandAll(JTree tree, 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(tree, path, expand);
            }
        }
View Full Code Here

    {
      // parentNode was a leaf before this insertion event only if every one of
      // its current children is in the event's list of children
      boolean wasLeaf = true;
      List<?> eventChildren = Arrays.asList(e.getChildren());
      Enumeration<?> treeChildren = parentNode.children();
      while (wasLeaf && treeChildren.hasMoreElements())
      {
        if (!eventChildren.contains(treeChildren.nextElement()))
        {
          wasLeaf = false;
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

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.