Class JTreeHpr<T extends JTree>
java.lang.Object
com.inductiveautomation.snap.ui.UIHelper<T>
com.inductiveautomation.snap.swing.SwingHelper<T>
com.inductiveautomation.snap.swing.helpers.JComponentHpr<T>
com.inductiveautomation.snap.swing.helpers.JTreeHpr<T>
This class is a simple JTree subclass to support Ribs archival and to support Ribs unified accessor model.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
If expand is true, expands all nodes in the tree.protected static List
findTreeObjectPath
(TreeModel aModel, Object aNode, Object aValue) Finds a tree object.int
getChildCount
(T anObj) Override to suppress children.getRibsModel
(JTree aTree) Returns a Ribs tree model for a given tree, if available.int
getSelectedIndex
(T aTree) Returns the selected index property of given object.getSelectedItem
(T aTree) Returns the selected object property of given object.protected static Object
getTreeNodeObject
(Object aNode) Returns a value for a tree node.Returns a component's value as a string.void
Override to install TreeSelectionListener.static void
reloadTree
(JTree aTree, boolean doPreserveSelection, boolean doPreserveExpanded) Reloads tree.void
setSelectedIndex
(T aTree, int aValue) Sets the selected index property of given object to given value.void
setSelectedItem
(T aTree, Object aValue) Sets the selected object property of given object to given value.Methods inherited from class com.inductiveautomation.snap.swing.helpers.JComponentHpr
addBinding, createEventAdapter, getAutosizing, getBinding, getBindingCount, getBindings, getChangeListener, getChild, getConstraints, getEventAdapter, getName, getOwner, getParent, getPropertyNamesImpl, getSendActionOnFocusLost, getSendActionOnFocusLostDefault, isEnabled, removeBinding, setConstraints, setEnabled, setOwner, setSendActionOnFocusLost
Methods inherited from class com.inductiveautomation.snap.swing.SwingHelper
getHelper, getSwingHelper, getSwingHelper
Methods inherited from class com.inductiveautomation.snap.ui.UIHelper
enableEvents, getAction, getBinding, getChild, getItemDisplayKey, getItems, getKeyValue, getPropertyNameMapped, getPropertyNames, getSelectedIndexes, getSelectedIndexs, getText, initUIDeep, isEnabled, isPropertyName, isValueAdjusting, removeBinding, setAction, setEnabled, setItemDisplayKey, setItems, setItems, setKeyValue, setSelectedIndexes, setText, setValue
-
Constructor Details
-
JTreeHpr
public JTreeHpr()
-
-
Method Details
-
getChildCount
Override to suppress children.- Overrides:
getChildCount
in classJComponentHpr<T extends JTree>
-
initUI
Override to install TreeSelectionListener.- Overrides:
initUI
in classJComponentHpr<T extends JTree>
-
getValue
Returns a component's value as a string. -
getRibsModel
Returns a Ribs tree model for a given tree, if available. -
reloadTree
Reloads tree. -
expandAll
If expand is true, expands all nodes in the tree. Otherwise, collapses all nodes in the tree. -
getSelectedIndex
Returns the selected index property of given object.- Overrides:
getSelectedIndex
in classUIHelper<T extends JTree>
-
setSelectedIndex
Sets the selected index property of given object to given value.- Overrides:
setSelectedIndex
in classUIHelper<T extends JTree>
-
getSelectedItem
Returns the selected object property of given object.- Overrides:
getSelectedItem
in classUIHelper<T extends JTree>
-
setSelectedItem
Sets the selected object property of given object to given value.- Overrides:
setSelectedItem
in classUIHelper<T extends JTree>
-
findTreeObjectPath
Finds a tree object. -
getTreeNodeObject
Returns a value for a tree node.
-