Module org.htmlunit

Class HtmlButtonInput

All Implemented Interfaces:
Serializable, Cloneable, DisabledElement, LabelableElement, SubmittableElement, ValidatableHtmlElement, Element, Node

public class HtmlButtonInput extends HtmlInput implements LabelableElement
Wrapper for the HTML element "input" where type is "button".
Author:
Mike Bowler, Christian Sell, Daniel Gredler, Ahmed Ashour, Ronald Brill, Frank Danek
See Also:
  • Method Details

    • reset

      public void reset()
      Returns the value of this element to the default value or checked state (usually what it was at the time the page was loaded, unless it has been modified via JavaScript). This method does nothing for button input elements.
      Specified by:
      reset in interface SubmittableElement
      Overrides:
      reset in class HtmlInput
      See Also:
    • doType

      protected void doType(int keyCode, boolean lastType) throws IOException
      Performs the effective type action, called after the keyPress event and before the keyUp event.

      An example of predefined values is KeyboardEvent.DOM_VK_PAGE_DOWN.

      Overrides:
      doType in class HtmlElement
      Parameters:
      keyCode - the key code wish to simulate typing
      lastType - is this the last to type
      Throws:
      IOException - in case of problems
    • setValue

      public void setValue(String newValue)
      Sets the value.
      Overrides:
      setValue in class HtmlInput
      Parameters:
      newValue - the new value
    • setDefaultChecked

      public void setDefaultChecked(boolean defaultChecked)
      Sets the default checked state to use when this element gets reset, if applicable. The default implementation is empty; only checkboxes and radio buttons really care what the default checked value is.
      Specified by:
      setDefaultChecked in interface SubmittableElement
      Parameters:
      defaultChecked - the default checked state to use when this element gets reset, if applicable
      See Also:
    • isRequiredSupported

      protected boolean isRequiredSupported()
      Returns whether this element supports the required constraint.
      Overrides:
      isRequiredSupported in class HtmlInput
      Returns:
      whether this element supports the required constraint
    • willValidate

      public boolean willValidate()
      Returns whether the element is a candidate for constraint validation.
      Specified by:
      willValidate in interface ValidatableHtmlElement
      Overrides:
      willValidate in class HtmlInput
      Returns:
      whether the element is a candidate for constraint validation
    • isCustomValidityValid

      protected boolean isCustomValidityValid()
      Overrides:
      isCustomValidityValid in class HtmlInput