public class HtmlCheckBoxInput extends HtmlInput
HtmlElement.ChildElementsIterator, HtmlElement.MapEntryWrappingIterator
DomNode.ChildIterator, DomNode.DescendantElementsIterator
ATTRIBUTE_NOT_DEFINED, ATTRIBUTE_VALUE_EMPTY, TAB_INDEX_OUT_OF_BOUNDS
ATTRIBUTE_NODE, COMMENT_NODE, DOCUMENT_NODE, ELEMENT_NODE, PROPERTY_ELEMENT, READY_STATE_COMPLETE, READY_STATE_INTERACTIVE, READY_STATE_LOADED, READY_STATE_LOADING, READY_STATE_UNINITIALIZED, TEXT_NODE
Constructor and Description |
---|
HtmlCheckBoxInput(HtmlPage page,
Map attributes)
Deprecated.
You should not directly construct HtmlCheckBoxInput.
|
Modifier and Type | Method and Description |
---|---|
String |
asText()
A checkbox does not have a textual representation,
but we invent one for it because it is useful for testing.
|
protected Page |
doClickAction(Page defaultPage)
Override so that checkbox can change its state correctly when its
click() method is called.
|
boolean |
isDefaultChecked()
Returns the default checked state to use when this element gets reset, if applicable.
|
protected boolean |
isStateUpdateFirst()
Both IE and Mozilla will first update the internal state of checkbox
and then handle "onclick" event.
|
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.
|
void |
reset()
Return 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).
|
Page |
setChecked(boolean isChecked)
Set the "checked" attribute
|
void |
setDefaultChecked(boolean defaultChecked)
Sets the default checked state to use when this element gets reset, if applicable.
|
void |
setDefaultValue(String defaultValue)
Sets the default value to use when this element gets reset, if applicable.
|
click, getAcceptAttribute, getAccessKeyAttribute, getAlignAttribute, getAltAttribute, getCheckedAttribute, getDefaultValue, getDisabledAttribute, getMaxLengthAttribute, getNameAttribute, getOnBlurAttribute, getOnChangeAttribute, getOnFocusAttribute, getOnSelectAttribute, getReadOnlyAttribute, getSizeAttribute, getSrcAttribute, getSubmitKeyValuePairs, getTabIndexAttribute, getTypeAttribute, getUseMapAttribute, getValueAttribute, isChecked, isDisabled, setDefaultValue, setValueAttribute
click, click, click, dblClick, dblClick, getLangAttribute, getOnClickAttribute, getOnDblClickAttribute, getOnKeyDownAttribute, getOnKeyPressAttribute, getOnKeyUpAttribute, getOnMouseDownAttribute, getOnMouseMoveAttribute, getOnMouseOutAttribute, getOnMouseOverAttribute, getOnMouseUpAttribute, getTextDirectionAttribute, getXmlLangAttribute
getClassAttribute, getIdAttribute, getStyleAttribute, getTitleAttribute, isRenderedVisible
addHtmlAttributeChangeListener, appendChildIfNoneExists, assertNotEmpty, blur, cloneDomNode, cloneNode, fireEvent, fireEvent, fireHtmlAttributeAdded, fireHtmlAttributeRemoved, fireHtmlAttributeReplaced, focus, getAttribute, getAttributeEntriesIterator, getAttributeNS, getAttributeValue, getChildElementsIterator, getEnclosingElement, getEnclosingForm, getEnclosingFormOrDie, getEventHandler, getHtmlElementById, getHtmlElementsByAttribute, getHtmlElementsByTagName, getHtmlElementsByTagNames, getId, getNodeName, getNodeType, getOneHtmlElementByAttribute, getTabIndex, getTagName, hasAttribute, hasAttributeNS, hasAttributes, hasHtmlElementWithId, isAttributeDefined, isEmptyXmlTagExpanded, isSubmittableByEnter, keyDown, keyDown, mouseDown, mouseDown, mouseMove, mouseMove, mouseOut, mouseOut, mouseOver, mouseOver, mouseUp, mouseUp, notImplemented, printOpeningTagContentAsXml, printXml, removeAttribute, removeAttributeNS, removeChild, removeEventHandler, removeHtmlAttributeChangeListener, rightClick, rightClick, setAttribute, setAttributeNS, setAttributeValue, setAttributeValue, setEventHandler, setEventHandler, setId, toString, type, type, type, type
getLocalName, getNamespaceURI, getPrefix, getQualifiedName, setPrefix
addDomChangeListener, addPropertyChangeListener, appendChild, appendDomChild, asXml, fireNodeAdded, fireNodeDeleted, firePropertyChange, getAllHtmlChildElements, getByXPath, getChildIterator, getChildrenAsText, getEndColumnNumber, getEndLineNumber, getFirstByXPath, getFirstChild, getFirstDomChild, getLastChild, getLastDomChild, getLog, getNativePage, getNextDomSibling, getNextSibling, getNodeValue, getPage, getParentDomNode, getParentNode, getPreviousDomSibling, getPreviousSibling, getReadyState, getScriptObject, getStartColumnNumber, getStartLineNumber, insertBefore, isAncestorOf, isTrimmedText, notifyIncorrectness, onAddedToPage, onAllChildrenAddedToPage, printChildrenAsXml, reduceWhitespace, remove, removeAllChildren, removeDomChangeListener, removePropertyChangeListener, replace, setNextSibling, setNodeValue, setParentNode, setPreviousSibling, setReadyState, setScriptObject
public HtmlCheckBoxInput(HtmlPage page, Map attributes)
page
- The page that contains this elementattributes
- the initial attributespublic void reset()
reset
in interface SubmittableElement
reset
in class HtmlInput
SubmittableElement.reset()
public Page setChecked(boolean isChecked)
setChecked
in class HtmlInput
isChecked
- true if this element is to be selectedpublic String asText()
protected Page doClickAction(Page defaultPage) throws IOException
false
.
This is the default behavior of clicking the element.
The default implementation returns
the current page - subclasses requiring different behavior (like
HtmlSubmitInput
) will override this method.doClickAction
in class ClickableElement
defaultPage
- The default page to return if the action does not
load a new page.IOException
- If an IO error occurredprotected boolean isStateUpdateFirst()
isStateUpdateFirst
in class ClickableElement
protected void preventDefault()
preventDefault
in class HtmlElement
public void setDefaultValue(String defaultValue)
setDefaultValue
in interface SubmittableElement
setDefaultValue
in class HtmlInput
defaultValue
- The default value to use when this element gets reset, if applicable.SubmittableElement.setDefaultValue(String)
public void setDefaultChecked(boolean defaultChecked)
setDefaultChecked
in interface SubmittableElement
setDefaultChecked
in class HtmlInput
defaultChecked
- The default checked state to use when this element gets reset, if applicable.SubmittableElement.setDefaultChecked(boolean)
public boolean isDefaultChecked()
isDefaultChecked
in interface SubmittableElement
isDefaultChecked
in class HtmlInput
SubmittableElement.isDefaultChecked()
Copyright © 2002-2012 Gargoyle Software Inc.. All Rights Reserved.