Class JMeterTreeModel
-
- All Implemented Interfaces:
-
java.io.Serializable
,javax.swing.tree.TreeModel
public class JMeterTreeModel extends DefaultTreeModel
-
-
Constructor Summary
Constructors Constructor Description JMeterTreeModel(TestElement tp, TestElement wb)
Deprecated after remove WorkBench JMeterTreeModel(TestElement tp)
JMeterTreeModel()
JMeterTreeModel(Object o)
Hack to allow TreeModel to be used in non-GUI and headless mode.
-
Method Summary
Modifier and Type Method Description List<JMeterTreeNode>
getNodesOfType(Class<out Object> type)
Returns a list of tree nodes that hold objects of the given class type. JMeterTreeNode
getNodeOf(TestElement userObject)
Get the node for a given TestElement object. HashTree
addSubTree(HashTree subTree, JMeterTreeNode current)
Adds the sub tree at the given node. JMeterTreeNode
addComponent(TestElement component, JMeterTreeNode node)
Add a TestElement to a JMeterTreeNode void
removeNodeFromParent(JMeterTreeNode node)
HashTree
getCurrentSubTree(JMeterTreeNode node)
Get the current sub tree for a JMeterTreeNode HashTree
getTestPlan()
Get the TestPlan from the root of this tree void
clearTestPlan()
Clear the test plan, and use default node for test plan. void
clearTestPlan(TestElement testPlan)
Clear the test plan, and use specified node for test plan N.B. -
Methods inherited from class javax.swing.tree.DefaultTreeModel
addTreeModelListener, asksAllowsChildren, getChild, getChildCount, getIndexOfChild, getListeners, getPathToRoot, getRoot, getTreeModelListeners, insertNodeInto, isLeaf, nodeChanged, nodeStructureChanged, nodesChanged, nodesWereInserted, nodesWereRemoved, reload, removeNodeFromParent, removeTreeModelListener, setAsksAllowsChildren, setRoot, valueForPathChanged
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
JMeterTreeModel
JMeterTreeModel(TestElement tp, TestElement wb)
Deprecated after remove WorkBench- Parameters:
tp
- - Test Planwb
- - WorkBench
-
JMeterTreeModel
JMeterTreeModel(TestElement tp)
-
JMeterTreeModel
JMeterTreeModel()
-
JMeterTreeModel
JMeterTreeModel(Object o)
Hack to allow TreeModel to be used in non-GUI and headless mode.- Parameters:
o
- - dummy
-
-
Method Detail
-
getNodesOfType
List<JMeterTreeNode> getNodesOfType(Class<out Object> type)
Returns a list of tree nodes that hold objects of the given class type. If none are found, an empty list is returned.
- Parameters:
type
- The type of nodes, which are to be collected- Returns:
a list of tree nodes of the given
type
, or an empty list
-
getNodeOf
JMeterTreeNode getNodeOf(TestElement userObject)
Get the node for a given TestElement object.
- Parameters:
userObject
- The object to be found in this tree- Returns:
the node corresponding to the
userObject
-
addSubTree
HashTree addSubTree(HashTree subTree, JMeterTreeNode current)
Adds the sub tree at the given node. Returns a boolean indicating whether the added sub tree was a full test plan.
- Parameters:
subTree
- The HashTree which is to be inserted intocurrent
current
- The node in which thesubTree
is to be inserted.- Returns:
newly created sub tree now found at
current
-
addComponent
JMeterTreeNode addComponent(TestElement component, JMeterTreeNode node)
Add a TestElement to a JMeterTreeNode
- Parameters:
component
- The TestElement to be used as data for the newly created nodenode
- The JMeterTreeNode into which the newly created node is to be inserted- Returns:
new JMeterTreeNode for the given
component
-
removeNodeFromParent
void removeNodeFromParent(JMeterTreeNode node)
-
getCurrentSubTree
HashTree getCurrentSubTree(JMeterTreeNode node)
Get the current sub tree for a JMeterTreeNode
- Parameters:
node
- The JMeterTreeNode from which the sub tree is to be taken- Returns:
newly copied sub tree
-
getTestPlan
HashTree getTestPlan()
Get the TestPlan from the root of this tree
- Returns:
The TestPlan found at the root of this tree
-
clearTestPlan
void clearTestPlan()
Clear the test plan, and use default node for test plan. N.B. Should only be called by clearTestPlan
-
clearTestPlan
void clearTestPlan(TestElement testPlan)
Clear the test plan, and use specified node for test plan N.B. Should only be called by clearTestPlan
- Parameters:
testPlan
- the node to use as the testplan top node
-
-
-
-