Holger's Java API

## com.antelmann.util.gui
Class TreeUtils

    java.lang.Object
      com.antelmann.util.gui.TreeUtils

    public final class TreeUtils

extends Object

provides utility methods for handling trees.

Since:
  10.08.2011, 00:37:35
Author:
  Holger Antelmann

Constructor Summary
`TreeUtils()`

Method Summary
`static void` `changeExpansionState(JTree tree, TreePath path, boolean expand)`
`static void` `collapseAll(JTree tree)`
`static DefaultTreeCellRenderer` `createTreePathTipRenderer(String delimiter)` creates a renderer that will use the complete path of the node as a ToolTip and utilizes `Imageable.getDisplayIcon()` if available
`static void` `expandAll(JTree tree)`
`static TreePath` `findPath(TreeModel model, Object node)`
`static TreePath` `getPath(TreeNode node)`
`static String` `getPathString(TreePath path, String delimiter)`
`static TreePath` `nextPath(TreeModel model, TreePath path)` returns the 'next path' of the given path; if null is given, the path to the root is returned.
`static AbstractIterator<Object>` `nodeIterator(TreeModel model)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TreeUtils

    public TreeUtils()

Method Detail

### nodeIterator

    public static AbstractIterator<Object> nodeIterator(TreeModel model)

### findPath

    public static TreePath findPath(TreeModel model,
                                    Object node)

  See Also:
    `getPath(TreeNode)`

### getPath

    public static TreePath getPath(TreeNode node)

### nextPath

    public static TreePath nextPath(TreeModel model,
                                    TreePath path)

  returns the 'next path' of the given path; if null is given, the path to the root is returned.

### expandAll

    public static void expandAll(JTree tree)

### collapseAll

    public static void collapseAll(JTree tree)

### changeExpansionState

    public static void changeExpansionState(JTree tree,
                                            TreePath path,
                                            boolean expand)

### createTreePathTipRenderer

    public static DefaultTreeCellRenderer createTreePathTipRenderer(String delimiter)

  creates a renderer that will use the complete path of the node as a ToolTip and utilizes `Imageable.getDisplayIcon()` if available

### getPathString

    public static String getPathString(TreePath path,
                                       String delimiter)

(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads