private void buildNodesModel(JMeterTreeNode node, String parent_name, int level) {
String seperator = " > ";
if (node != null) {
for (int i = 0; i < node.getChildCount(); i++) {
StringBuilder name = new StringBuilder();
JMeterTreeNode cur = (JMeterTreeNode) node.getChildAt(i);
TestElement te = cur.getTestElement();
/*
* Will never be true. Probably intended to use
* org.apache.jmeter.threads.ThreadGroup rather than
* java.lang.ThreadGroup However, that does not work correctly;
* whereas treating it as a Controller does. if (te instanceof
* ThreadGroup) { name.append(parent_name);
* name.append(cur.getName()); name.append(seperator);
* buildNodesModel(cur, name.toString(), level); } else
*/
if (te instanceof Controller) {
name.append(spaces(level));
name.append(parent_name);
name.append(cur.getName());
TreeNodeWrapper tnw = new TreeNodeWrapper(cur, name.toString());
targetNodesModel.addElement(tnw);
name = new StringBuilder();
name.append(cur.getName());
name.append(seperator);
buildNodesModel(cur, name.toString(), level + 1);
} else if (te instanceof TestPlan || te instanceof WorkBench) {
name.append(cur.getName());
name.append(seperator);
buildNodesModel(cur, name.toString(), 0);
}
// Ignore everything else
}