/**
  * Modifies a given TestElement to mirror the data in the gui components.
  *
  * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement)
  */
 public void modifyTestElement(TestElement el) {
   super.configureTestElement(el);
   if (el instanceof XPathAssertion) {
     XPathAssertion assertion = (XPathAssertion) el;
     assertion.setNegated(xpath.isNegated());
     assertion.setXPathString(xpath.getXPath());
     xml.modifyTestElement(assertion);
   }
 }
  @Override
  public void configure(TestElement el) {
    super.configure(el);
    XPathAssertion assertion = (XPathAssertion) el;
    xpath.setXPath(assertion.getXPathString());
    xpath.setNegated(assertion.isNegated());

    xml.configure(assertion);
  }
  /** Implements JMeterGUIComponent.clearGui */
  @Override
  public void clearGui() {
    super.clearGui();

    xpath.setXPath("/"); // $NON-NLS-1$
    xpath.setNegated(false);

    xml.setDefaultValues();
  }
  private void init() {
    setLayout(new VerticalLayout(5, VerticalLayout.BOTH, VerticalLayout.TOP));
    setBorder(makeBorder());

    add(makeTitlePanel());

    // USER_INPUT
    JPanel sizePanel = new JPanel(new BorderLayout());
    sizePanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10));
    sizePanel.setBorder(
        BorderFactory.createTitledBorder(
            BorderFactory.createEtchedBorder(), getXPathAttributesTitle()));
    xpath = new XPathPanel();
    sizePanel.add(xpath);

    xml = new XMLConfPanel();
    xml.setBorder(
        BorderFactory.createTitledBorder(
            BorderFactory.createEtchedBorder(),
            JMeterUtils.getResString("xpath_assertion_option"))); // $NON-NLS-1$
    add(xml);

    add(sizePanel);
  }