Module org.htmlunit

Interface DisabledElement

All Superinterfaces:
Element, Node
All Known Implementing Classes:
HtmlButton, HtmlButtonInput, HtmlCheckBoxInput, HtmlColorInput, HtmlDateInput, HtmlDateTimeLocalInput, HtmlEmailInput, HtmlFieldSet, HtmlFileInput, HtmlHiddenInput, HtmlImageInput, HtmlInput, HtmlMonthInput, HtmlNumberInput, HtmlOption, HtmlOptionGroup, HtmlPasswordInput, HtmlRadioButtonInput, HtmlRangeInput, HtmlResetInput, HtmlSearchInput, HtmlSelect, HtmlSelectableTextInput, HtmlSubmitInput, HtmlTelInput, HtmlTextArea, HtmlTextInput, HtmlTimeInput, HtmlUrlInput, HtmlWeekInput

public interface DisabledElement extends Element
A marker interface for those classes that can be disabled.
Author:
David D. Kilzer, Ronald Brill
  • Field Details

  • Method Details

    • isDisabled

      default boolean isDisabled()
      Returns true if the disabled attribute is set for this element.

      Per spec, a disabled HtmlFieldSet ancestor disables its descendants EXCEPT for descendants of that fieldset's first <legend> child, if any. This is checked cheaply while walking up the ancestor chain: at each step, the node we just came from (tracked as previous) is by construction a direct child of the node we're currently examining, so when that node turns out to be a disabled fieldset we already know its relevant direct child without any second traversal -- see isFirstLegendChild(HtmlFieldSet, Node).

      Returns:
      true if the disabled attribute is set for this element
    • getDisabledAttribute

      String getDisabledAttribute()
      Returns the value of the attribute disabled. Refer to the HTML 4.01 documentation for details on the use of this attribute.
      Returns:
      the value of the attribute disabled or an empty string if that attribute isn't defined