Package org.apache.jmeter.gui.tree
Class JMeterTreeModel
java.lang.Object
javax.swing.tree.DefaultTreeModel
org.apache.jmeter.gui.tree.JMeterTreeModel
- All Implemented Interfaces:
Serializable
,TreeModel
- See Also:
-
Field Summary
Fields inherited from class javax.swing.tree.DefaultTreeModel
asksAllowsChildren, listenerList, root
-
Constructor Summary
ConstructorDescriptionDeprecated.- only for use by JMeter class!JMeterTreeModel
(org.apache.jmeter.testelement.TestElement tp) JMeterTreeModel
(org.apache.jmeter.testelement.TestElement tp, org.apache.jmeter.testelement.TestElement wb) Deprecated.since 4.0 -
Method Summary
Modifier and TypeMethodDescriptionaddComponent
(org.apache.jmeter.testelement.TestElement component, JMeterTreeNode node) Add aTestElement
to aJMeterTreeNode
addSubTree
(HashTree subTree, JMeterTreeNode current) Adds the sub tree at the given node.void
Clear the test plan, and use default node for test plan.void
clearTestPlan
(org.apache.jmeter.testelement.TestElement testPlan) Clear the test plan, and use specified node for test plan N.B.Get the current sub tree for aJMeterTreeNode
getNodeOf
(org.apache.jmeter.testelement.TestElement userObject) Get the node for a given TestElement object.getNodesOfType
(Class<?> type) Returns a list of tree nodes that hold objects of the given class type.Get theTestPlan
from the root of this treevoid
Methods inherited from class javax.swing.tree.DefaultTreeModel
addTreeModelListener, asksAllowsChildren, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getChild, getChildCount, getIndexOfChild, getListeners, getPathToRoot, getPathToRoot, getRoot, getTreeModelListeners, insertNodeInto, isLeaf, nodeChanged, nodesChanged, nodeStructureChanged, nodesWereInserted, nodesWereRemoved, reload, reload, removeNodeFromParent, removeTreeModelListener, setAsksAllowsChildren, setRoot, valueForPathChanged
-
Constructor Details
-
JMeterTreeModel
@Deprecated public JMeterTreeModel(org.apache.jmeter.testelement.TestElement tp, org.apache.jmeter.testelement.TestElement wb) Deprecated.since 4.0Deprecated after remove WorkBench- Parameters:
tp
- - Test Planwb
- - WorkBench
-
JMeterTreeModel
public JMeterTreeModel(org.apache.jmeter.testelement.TestElement tp) -
JMeterTreeModel
public JMeterTreeModel() -
JMeterTreeModel
Deprecated.- only for use by JMeter class!Hack to allow TreeModel to be used in non-GUI and headless mode.- Parameters:
o
- - dummy
-
-
Method Details
-
getNodesOfType
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
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
public HashTree addSubTree(HashTree subTree, JMeterTreeNode current) throws IllegalUserActionException Adds the sub tree at the given node. Returns a boolean indicating whether the added sub tree was a full test plan.- Parameters:
subTree
- TheHashTree
which is to be inserted intocurrent
current
- The node in which thesubTree
is to be inserted. Will be overridden, when an instance ofTestPlan
- Returns:
- newly created sub tree now found at
current
- Throws:
IllegalUserActionException
- whencurrent
is not an instance ofAbstractConfigGui
and no instance ofTestPlan
subTree
-
addComponent
public JMeterTreeNode addComponent(org.apache.jmeter.testelement.TestElement component, JMeterTreeNode node) throws IllegalUserActionException Add aTestElement
to aJMeterTreeNode
- Parameters:
component
- TheTestElement
to be used as data for the newly created nodenode
- TheJMeterTreeNode
into which the newly created node is to be inserted- Returns:
- new
JMeterTreeNode
for the givencomponent
- Throws:
IllegalUserActionException
- when the user object for thenode
is not an instance ofAbstractConfigGui
-
removeNodeFromParent
-
getCurrentSubTree
Get the current sub tree for aJMeterTreeNode
- Parameters:
node
- TheJMeterTreeNode
from which the sub tree is to be taken- Returns:
- newly copied sub tree
-
getTestPlan
Get theTestPlan
from the root of this tree- Returns:
- The
TestPlan
found at the root of this tree
-
clearTestPlan
public void clearTestPlan()Clear the test plan, and use default node for test plan. N.B. Should only be called byGuiPackage.clearTestPlan()
-
clearTestPlan
public void clearTestPlan(org.apache.jmeter.testelement.TestElement testPlan) Clear the test plan, and use specified node for test plan N.B. Should only be called byGuiPackage.clearTestPlan(TestElement)
- Parameters:
testPlan
- the node to use as the testplan top node
-