Package com.explodingpixels.widgets
Class TreeUtils
java.lang.Object
com.explodingpixels.widgets.TreeUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
collapsePathOnEdt
(JTree tree, TreePath path) static void
expandPathOnEdt
(JTree tree, TreePath path) static void
static void
repaintSelection
(JTree tree) Repaints the selection.static void
setCollapsedIcon
(JTree tree, Icon icon) Set's the collapsed icon to use for the givenJTree
if that tree's UI delegate exetends fromBasicTreeUI
.static void
setExpandedIcon
(JTree tree, Icon icon) Set's the expanded icon to use for the givenJTree
if that tree's UI delegate extends fromBasicTreeUI
.static void
setExpandedOnEdt
(JTree tree, TreePath path, boolean expanded) static void
setLeftChildIndent
(JTree tree, int indent) Set's the left indent in pixels to use for the givenJTree
's collapsed and expanded icon.static void
setRightChildIndent
(JTree tree, int indent) Set's the right indent in pixels to use for the givenJTree
's collapsed and expanded icon.
-
Method Details
-
setCollapsedIcon
Set's the collapsed icon to use for the givenJTree
if that tree's UI delegate exetends fromBasicTreeUI
. If the given tree's UI delegate does not extend fromBasicTreeUI
then the given tree will not be changed.- Parameters:
tree
- the tree to set the collapsed icon for.icon
- the new collapsed icon to use.- See Also:
-
setExpandedIcon
Set's the expanded icon to use for the givenJTree
if that tree's UI delegate extends fromBasicTreeUI
. If the given tree's UI delegate does not extend fromBasicTreeUI
then the given tree will not be changed.- Parameters:
tree
- the tree to set the expanded icon for.icon
- the new collapsed icon to use.- See Also:
-
setLeftChildIndent
Set's the left indent in pixels to use for the givenJTree
's collapsed and expanded icon. This value in conjuction with the right indent comprises the total amount of space that the collapsed and expanded icon draw into. If the given tree's UI delegate does not extend fromBasicTreeUI
then the given tree will not be changed.- Parameters:
tree
- the tree to set the left indent for.indent
- the new left indent in pixels.- See Also:
-
setRightChildIndent
Set's the right indent in pixels to use for the givenJTree
's collapsed and expanded icon. This value in conjuction with the left indent comprises the total amount of space that the collapsed and expanded icon draw into. If the given tree's UI delegate does not extend fromBasicTreeUI
then the given tree will not be changed.- Parameters:
tree
- the tree to set the right indent for.indent
- the new left indent in pixels.- See Also:
-
repaintSelection
Repaints the selection. This allows the row selection to have a background color that changes based on the focus state of the component.- Parameters:
tree
- theJTree
to repaint the selection of.
-
setExpandedOnEdt
-
expandPathOnEdt
-
collapsePathOnEdt
-
installRootExpandingTreeModelListener
-