com.vividsolutions.jump.workbench.ui
Class TreeUtil

java.lang.Object
  extended by com.vividsolutions.jump.workbench.ui.TreeUtil

public class TreeUtil
extends java.lang.Object


Nested Class Summary
static interface TreeUtil.Visitor
           
 
Constructor Summary
TreeUtil()
           
 
Method Summary
static boolean contains(javax.swing.tree.TreeModel model, java.lang.Object node)
           
static javax.swing.tree.TreeCellRenderer createSimpleTreeCellRenderer(javax.swing.ImageIcon icon)
           
static javax.swing.tree.TreeCellRenderer createSimpleTreeCellRenderer(java.lang.String text, javax.swing.ImageIcon icon, java.awt.Font font)
           
static javax.swing.event.TreeModelEvent createTreeModelEvent(java.lang.Object source, java.lang.Object node, javax.swing.tree.TreeModel model)
           
static java.lang.String dump(javax.swing.tree.TreeModel model)
           
static void expandAll(javax.swing.JTree tree, javax.swing.tree.TreePath path)
           
static javax.swing.tree.TreePath findTreePath(java.lang.Object node, javax.swing.tree.TreeModel model)
           
static java.util.List lastPathComponents(javax.swing.tree.TreePath[] paths)
           
static java.util.Collection nodes(javax.swing.tree.TreePath path, javax.swing.tree.TreeModel model)
           
static void visit(javax.swing.tree.TreeModel model, javax.swing.tree.TreePath path, TreeUtil.Visitor visitor)
          Visit the path and all subpaths.
static void visit(javax.swing.tree.TreeModel model, TreeUtil.Visitor visitor)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeUtil

public TreeUtil()
Method Detail

createSimpleTreeCellRenderer

public static javax.swing.tree.TreeCellRenderer createSimpleTreeCellRenderer(javax.swing.ImageIcon icon)

createSimpleTreeCellRenderer

public static javax.swing.tree.TreeCellRenderer createSimpleTreeCellRenderer(java.lang.String text,
                                                                             javax.swing.ImageIcon icon,
                                                                             java.awt.Font font)
Parameters:
text - null to get the text by calling #toString on the value

visit

public static void visit(javax.swing.tree.TreeModel model,
                         TreeUtil.Visitor visitor)

visit

public static void visit(javax.swing.tree.TreeModel model,
                         javax.swing.tree.TreePath path,
                         TreeUtil.Visitor visitor)
Visit the path and all subpaths.


createTreeModelEvent

public static javax.swing.event.TreeModelEvent createTreeModelEvent(java.lang.Object source,
                                                                    java.lang.Object node,
                                                                    javax.swing.tree.TreeModel model)

dump

public static java.lang.String dump(javax.swing.tree.TreeModel model)

findTreePath

public static javax.swing.tree.TreePath findTreePath(java.lang.Object node,
                                                     javax.swing.tree.TreeModel model)
Returns:
null if the node is not in the tree model

contains

public static boolean contains(javax.swing.tree.TreeModel model,
                               java.lang.Object node)

lastPathComponents

public static java.util.List lastPathComponents(javax.swing.tree.TreePath[] paths)

expandAll

public static void expandAll(javax.swing.JTree tree,
                             javax.swing.tree.TreePath path)

nodes

public static java.util.Collection nodes(javax.swing.tree.TreePath path,
                                         javax.swing.tree.TreeModel model)