Class HtmlRadioButtonInput

    • Method Detail

      • isChecked

        public boolean isChecked()
        Returns true if this element is currently selected.
        Overrides:
        isChecked in class HtmlInput
        Returns:
        true if this element is currently selected
      • 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).
        Specified by:
        reset in interface SubmittableElement
        Overrides:
        reset in class HtmlInput
        See Also:
        SubmittableElement.reset()
      • setChecked

        public Page setChecked​(boolean isChecked)
        Sets the checked attribute.
        Overrides:
        setChecked in class HtmlInput
        Parameters:
        isChecked - true if this element is to be selected
        Returns:
        the page that occupies this window after setting checked status It may be the same window or it may be a freshly loaded one.
      • doClickStateUpdate

        protected boolean doClickStateUpdate​(boolean shiftKey,
                                             boolean ctrlKey)
                                      throws java.io.IOException
        Override of default clickAction that makes this radio button the selected one when it is clicked. This method implements the control state update part of the click action.

        The default implementation only calls doClickStateUpdate on parent's DomElement (if any). Subclasses requiring different behavior (like HtmlSubmitInput) will override this method.

        Overrides:
        doClickStateUpdate in class DomElement
        Parameters:
        shiftKey - true if SHIFT is pressed
        ctrlKey - true if CTRL is pressed
        Returns:
        true if doClickFireEvent method has to be called later on (to signal, that the value was changed)
        Throws:
        java.io.IOException - if an IO error occurred
      • doClickFireClickEvent

        protected ScriptResult doClickFireClickEvent​(org.htmlunit.javascript.host.event.Event event)
        This method implements the control onclick handler call during the click action.
        Overrides:
        doClickFireClickEvent in class DomElement
        Parameters:
        event - the click event used
        Returns:
        the script result
      • doClickFireChangeEvent

        protected void doClickFireChangeEvent()
        This method implements the control onchange handler call during the click action.
        Overrides:
        doClickFireChangeEvent in class DomElement
      • preventDefault

        protected void preventDefault()
        This method is called if the current fired event is canceled by preventDefault() in FireFox, or by returning false in Internet Explorer.

        The default implementation does nothing.

        Overrides:
        preventDefault in class DomElement
      • setValue

        public void setValue​(java.lang.String newValue)
        Sets the value. Also sets the default 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:
        SubmittableElement.setDefaultChecked(boolean)
      • isDefaultChecked

        public boolean isDefaultChecked()
        Returns the default checked state to use when this element gets reset, if applicable. The default implementation returns false; only checkboxes and radio buttons really care what the default checked value is.
        Specified by:
        isDefaultChecked in interface SubmittableElement
        Overrides:
        isDefaultChecked in class HtmlInput
        Returns:
        the default checked state to use when this element gets reset, if applicable
        See Also:
        SubmittableElement.isDefaultChecked()
      • isStateUpdateFirst

        protected boolean isStateUpdateFirst()
        Returns true if state updates should be done before onclick event handling. This method returns false by default, and is expected to be overridden to return true by derived classes like HtmlCheckBoxInput.
        Overrides:
        isStateUpdateFirst in class DomElement
        Returns:
        true if state updates should be done before onclick event handling
      • onAddedToPage

        protected void onAddedToPage()
        Lifecycle method invoked whenever a node is added to a page. Intended to be overridden by nodes which need to perform custom logic when they are added to a page. This method is recursive, so if you override it, please be sure to call super.onAddedToPage().
        Overrides:
        onAddedToPage in class DomNode
      • setAttributeNS

        protected void setAttributeNS​(java.lang.String namespaceURI,
                                      java.lang.String qualifiedName,
                                      java.lang.String attributeValue,
                                      boolean notifyAttributeChangeListeners,
                                      boolean notifyMutationObservers)
        Sets the value of the attribute specified by namespace and qualified name.
        Overrides:
        setAttributeNS in class HtmlInput
        Parameters:
        namespaceURI - the URI that identifies an XML namespace
        qualifiedName - the qualified name (prefix:local) of the attribute
        attributeValue - the value of the attribute
        notifyAttributeChangeListeners - to notify the associated HtmlAttributeChangeListeners
        notifyMutationObservers - to notify MutationObservers or not