public boolean isEnabled() { return getTestElement().isEnabled(); }
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; }
private void removeDisabledItems(HashTree tree) { for (Object o : new LinkedList<>(tree.list())) { TestElement item = (TestElement) o; if (!item.isEnabled()) { tree.remove(item); } else { removeDisabledItems(tree.getTree(item));// Recursive call } } }
/** * A newly created gui component can be initialized with the contents of a * Test Element object by calling this method. The component is responsible * for querying the Test Element object for the relevant information to * display in its GUI. * <p> * AbstractJMeterGuiComponent provides a partial implementation of this * method, setting the name of the component and its enabled status. * Subclasses should override this method, performing their own * configuration as needed, but also calling this super-implementation. * * @param element * the TestElement to configure */ @Override public void configure(TestElement element) { setName(element.getName()); enabled = element.isEnabled(); getCommentPanel().setText(element.getComment()); }
newNode.setEnabled(component.isEnabled()); } catch (Exception e) { // TODO - can this ever happen? newNode.setEnabled(true);
if (o instanceof TestElement) { TestElement item = (TestElement) o; if (item.isEnabled()) { if (item instanceof ReplaceableController) { ReplaceableController rc = ensureReplaceableControllerIsLoaded(item);