Java Code Examples for org.apache.jmeter.gui.tree.JMeterTreeNode#getTestElement()
The following examples show how to use
org.apache.jmeter.gui.tree.JMeterTreeNode#getTestElement() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WeightedSwitchControllerGui.java From jmeter-bzm-plugins with Apache License 2.0 | 6 votes |
private Map<JMeterTreeNode, Boolean> getChildItems(JMeterTreeNode root, WeightedSwitchController element) { Map<JMeterTreeNode, Boolean> result = new LinkedHashMap<>(); for (int i = 0; i < root.getChildCount(); i++) { JMeterTreeNode child = (JMeterTreeNode) root.getChildAt(i); TestElement te = child.getTestElement(); if (element != root.getTestElement()) { result.putAll(getChildItems(child, element)); } else { if (te instanceof Sampler || te instanceof Controller) { result.put(child, te.isEnabled()); } } } return result; }
Example 2
Source File: FixedJMeterTreeCellRenderer.java From jmeter-debugger with Apache License 2.0 | 5 votes |
@Override public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean p_hasFocus) { JMeterTreeNode node = (JMeterTreeNode) value; TestElement mc = node.getTestElement(); JMeterTreeNode fakeNode = (JMeterTreeNode) node.clone(); if (mc instanceof OriginalLink) { fakeNode.setUserObject(((OriginalLink) mc).getOriginal()); } else { fakeNode.setUserObject(mc); } Component treeCellRendererComponent = super.getTreeCellRendererComponent(tree, fakeNode, sel, expanded, leaf, row, p_hasFocus); hiliter.highlightNode(treeCellRendererComponent, node, mc); return treeCellRendererComponent; }
Example 3
Source File: DebuggerDialog.java From jmeter-debugger with Apache License 2.0 | 5 votes |
@Override public void valueChanged(TreeSelectionEvent treeSelectionEvent) { JMeterTreeNode node = (JMeterTreeNode) treeSelectionEvent.getPath().getLastPathComponent(); TestElement wrpElm = node.getTestElement(); if (wrpElm instanceof OriginalLink) { TestElement te = (TestElement) ((OriginalLink) wrpElm).getOriginal(); if (!(te instanceof AbstractThreadGroup)) { wrpElm = te; } } displayElementGui(wrpElm); }
Example 4
Source File: AbstractGraphPanelVisualizer.java From jmeter-plugins with Apache License 2.0 | 5 votes |
private void addRowToCompositeModels(String rowName, AbstractGraphRow row) { GuiPackage gui = GuiPackage.getInstance(); if (gui == null) { log.debug("No GUI Package present, ignored adding to composite"); return; } JMeterTreeModel testTree = gui.getTreeModel(); for (JMeterTreeNode obj : testTree.getNodesOfType(CompositeResultCollector.class)) { CompositeResultCollector compositeResultCollector = (CompositeResultCollector) obj.getTestElement(); compositeResultCollector.getCompositeModel().addRow(rowName, row); } }
Example 5
Source File: AbstractGraphPanelVisualizer.java From jmeter-plugins with Apache License 2.0 | 5 votes |
private void clearRowsFromCompositeModels(String vizualizerName) { GuiPackage gui = GuiPackage.getInstance(); if (gui == null) { log.debug("No GUI Package present, ignored removing from composite"); return; } JMeterTreeModel testTree = gui.getTreeModel(); for (JMeterTreeNode obj : testTree.getNodesOfType(CompositeResultCollector.class)) { //System.out.println("obj"); CompositeResultCollector compositeResultCollector = (CompositeResultCollector) obj.getTestElement(); compositeResultCollector.getCompositeModel().clearRows(vizualizerName); } }