Class XPathPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class XPathPanel extends JPanel
Gui component for representing a xpath expression
See Also:
  • Constructor Details

    • XPathPanel

      public XPathPanel()
  • Method Details

    • setDefaultValues

      public void setDefaultValues()
      Set default values on this component
    • getXPath

      public String getXPath()
      Get the XPath String
      Returns:
      String
    • setXPath

      public void setXPath(String xpath)
      Set the string that will be used in the xpath evaluation
      Parameters:
      xpath - The string representing the xpath expression
    • isNegated

      public boolean isNegated()
      Does this negate the xpath results
      Returns:
      boolean
    • setNegated

      public void setNegated(boolean negated)
      Set this to true, if you want success when the xpath does not match.
      Parameters:
      negated - Flag whether xpath match should be negated
    • getNegatedCheckBox

      public JCheckBox getNegatedCheckBox()
      Negated checkbox
      Returns:
      JCheckBox
    • getCheckXPathButton

      public JButton getCheckXPathButton()
      Check XPath button
      Returns:
      JButton
    • getXPathField

      public JSyntaxTextArea getXPathField()
      Returns the current JSyntaxTextArea for the xpath expression, or creates a new one, if none is found.
      Returns:
      JSyntaxTextArea for the xpath expression
    • isShowNegated

      public boolean isShowNegated()
      Returns:
      Returns the showNegate.
    • setShowNegated

      public void setShowNegated(boolean showNegate)
      Parameters:
      showNegate - The showNegate to set.
    • validXPath

      public static boolean validXPath(String xpathString, boolean showDialog)
      Test whether an XPath is valid. It seems the Xalan has no easy way to check, so this creates a dummy test document, then tries to evaluate the xpath against it.
      Parameters:
      xpathString - XPath String to validate
      showDialog - weather to show a dialog
      Returns:
      returns true if valid, false otherwise.