Package jmri.util.swing
Class JTreeUtil
java.lang.Object
jmri.util.swing.GuiUtilBase
jmri.util.swing.JTreeUtil
Common utility methods for working with JTrees.
Chief among these is the loadTree method, for creating a tree from an XML definition
- Since:
- 2.9.4
-
Nested Class Summary
Nested classes/interfaces inherited from class jmri.util.swing.GuiUtilBase
GuiUtilBase.CallingAbstractAction -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DefaultMutableTreeNodeloadTree(String name, WindowInterface wi, Object context) (package private) static DefaultMutableTreeNodetreeFromElement(org.jdom2.Element main, WindowInterface wi, Object context) Methods inherited from class jmri.util.swing.GuiUtilBase
actionFromNode, createActionInCallingWindow, createEmptyMenuItem, rootFromName, setParameters
-
Constructor Details
-
JTreeUtil
public JTreeUtil()
-
-
Method Details
-
loadTree
- Parameters:
name- XML file to be read and processedwi- WindowInterface to be passed to the nodes in the treecontext- Blind context Object passed to the nodes in the tree- Returns:
- a mutable tree node
-
treeFromElement
static DefaultMutableTreeNode treeFromElement(org.jdom2.Element main, WindowInterface wi, Object context) - Parameters:
main- Element to be processedwi- WindowInterface to be passed to the nodes in the treecontext- Blind context Object passed to the nodes in the tree- Returns:
- a mutable tree node
-