com.gargoylesoftware.htmlunit.javascript.host.html
Class HTMLOptionElement

java.lang.Object
  extended by net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
      extended by com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
          extended by com.gargoylesoftware.htmlunit.javascript.host.Node
              extended by com.gargoylesoftware.htmlunit.javascript.host.EventNode
                  extended by com.gargoylesoftware.htmlunit.javascript.host.Element
                      extended by com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement
                          extended by com.gargoylesoftware.htmlunit.javascript.host.FormChild
                              extended by com.gargoylesoftware.htmlunit.javascript.host.html.HTMLOptionElement
All Implemented Interfaces:
ScriptableWithFallbackGetter, Serializable, Cloneable, net.sourceforge.htmlunit.corejs.javascript.ConstProperties, net.sourceforge.htmlunit.corejs.javascript.debug.DebuggableObject, net.sourceforge.htmlunit.corejs.javascript.Scriptable

public class HTMLOptionElement
extends FormChild

The JavaScript object that represents an option.

Version:
$Revision: 7582 $
Author:
Mike Bowler, David K. Taylor, Chris Erskine, Marc Guillemot, Ahmed Ashour
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement
HTMLElement.ProxyDomNode
 
Field Summary
 
Fields inherited from class com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement
BEHAVIOR_ID_CLIENT_CAPS, BEHAVIOR_ID_DOWNLOAD, BEHAVIOR_ID_HOMEPAGE
 
Fields inherited from class com.gargoylesoftware.htmlunit.javascript.host.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Fields inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
 
Fields inherited from interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
NOT_FOUND
 
Constructor Summary
HTMLOptionElement()
          Creates an instance.
 
Method Summary
 boolean getDefaultSelected()
          Returns the value of the "defaultSelected" property.
 boolean getDisabled()
          Returns true if this element is disabled.
 HtmlOption getDomNodeOrNull()
          Returns the DOM node that corresponds to this JavaScript object or null if a node hasn't been set.
 String getLabel()
          Returns the value of the "label" property.
 boolean getSelected()
          Returns the value of the "selected" property.
 String getText()
          Returns the value of the "text" property.
 String getValue()
          Returns the value of the "value" property.
 void jsConstructor(String newText, String newValue, boolean defaultSelected, boolean selected)
          JavaScript constructor.
 void setDisabled(boolean disabled)
          Sets whether or not to disable this element.
 void setLabel(String label)
          Sets the value of the "label" property.
 void setSelected(boolean selected)
          Sets the value of the "selected" property.
 void setText(String newText)
          Sets the value of the "text" property.
 void setValue(String newValue)
          Sets the value of the "value" property.
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.FormChild
getForm
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement
addBehavior, addComponentRequest, blur, clearAttributes, clearComponentRequest, click, compareVersions, contains, createEventHandler, createTextRange, dispatchEvent, doComponentRequest, doScroll, fixAttributeName, focus, get, getAccessKey, getAlign, getAll, getAttribute, getAttributeNode, getAttributeNodeNS, getAvailHeight, getAvailWidth, getBoundingClientRect, getBoxObject, getBufferDepth, getCh, getChildren, getChOff, getClassList, getClassName_js, getClientHeight, getClientLeft, getClientRects, getClientTop, getClientWidth, getColorDepth, getComponentVersion, getConnectionType, getCookieEnabled, getCpuClass, getCurrentStyle, getDir, getDocument, getDomNodeOrDie, getElementsByClassName, getFilters, getHeight, getId, getInnerHTML, getInnerText, getJavaEnabled, getLang, getLanguage, getLocalName, getNamespaceURI, getNodeName, getOffsetHeight, getOffsetLeft, getOffsetParent_js, getOffsetTop, getOffsetWidth, getOuterHTML, getParentElement, getParentHTMLElement, getPlatform, getPosX, getPosY, getPrefix, getRuntimeStyle, getScopeName, getScrollHeight, getScrollLeft, getScrollTop, getScrollWidth, getSpellcheck, getStyle, getSystemLanguage, getTabIndex, getTagName, getTagUrn, getTitle, getUniqueID, getUserLanguage, getVAlign, getWidth, getWidthOrHeight, getWithFallback, hasAttribute, insertAdjacentElement, insertAdjacentHTML, isAncestorOfEventTarget, isAttributeName, isComponentInstalled, isHomePage, mergeAttributes, navigateHomePage, parseHtmlSnippet, querySelector, querySelectorAll, readAttributes, removeAttributeNode, removeBehavior, removeExpression, removeNode, scrollIntoView, setAccessKey, setActive, setAlign, setAttribute, setAttributeNode, setCh, setChOff, setClassName, setColorAttribute, setDir, setDomNode, setExpression, setHomePage, setId, setInnerHTML, setInnerText, setLang, setLanguage, setOuterHTML, setScrollLeft, setScrollTop, setSpellcheck, setTabIndex, setTagUrn, setTextContent, setTitle, setVAlign, setWidthOrHeight, startDownload, toString
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.Element
createAttributesObject, getAttributeNS, getAttributes, getBaseURI, getChildElementCount, getElementsByTagName, getElementsByTagNameNS, getFirstElementChild, getLastElementChild, getNextElementSibling, getPreviousElementSibling, hasAttributeNS, removeAttribute, removeAttributeNS, selectNodes, selectSingleNode, setAttributeNS, setDefaults
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.EventNode
fireEvent, getOnblur, getOnclick, getOncontextmenu, getOndblclick, getOnerror, getOnfocus, getOnfocusin, getOnfocusout, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getOnpropertychange, getOnresize, setOnblur, setOnclick, setOncontextmenu, setOndblclick, setOnerror, setOnfocus, setOnfocusin, setOnfocusout, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnpropertychange, setOnresize
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.Node
addEventListener, appendChild, attachEvent, cloneNode, compareDocumentPosition, detachEvent, executeEvent, fireEvent, fireEvent, getChildNodes, getEventHandler, getEventHandlerProp, getFirstChild, getJavaScriptNode, getLastChild, getNextSibling, getNodeType, getNodeValue, getOwnerDocument, getParent, getParentNode, getPreviousSibling, getTextContent, getXml, hasChildNodes, hasEventHandlers, insertBefore, insertBeforeImpl, isSameNode, normalize, removeChild, removeEventListener, replaceChild, setEventHandler, setEventHandlerProp, setNodeValue
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
clone, defineFunctionProperties, defineProperty, equivalentValues, getBrowserVersion, getClassName, getDefaultValue, getPrototype, getScriptableFor, getStartingScope, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, hasInstance, initParentScope, isReadOnlySettable, makeScriptableFor, setCaseSensitive, setDomNode, setHtmlElement
 
Methods inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype, size
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
delete, delete, get, getClassName, getDefaultValue, getIds, getParentScope, getPrototype, has, has, hasInstance, put, put, setParentScope, setPrototype
 

Constructor Detail

HTMLOptionElement

public HTMLOptionElement()
Creates an instance.

Method Detail

jsConstructor

public void jsConstructor(String newText,
                          String newValue,
                          boolean defaultSelected,
                          boolean selected)
JavaScript constructor. This must be declared in every JavaScript file because the rhino engine won't walk up the hierarchy looking for constructors.

Parameters:
newText - the text
newValue - the value
defaultSelected - Whether the option is initially selected
selected - the current selection state of the option

getValue

public String getValue()
Returns the value of the "value" property.

Returns:
the value property

setValue

public void setValue(String newValue)
Sets the value of the "value" property.

Parameters:
newValue - the value property

getText

public String getText()
Returns the value of the "text" property.

Overrides:
getText in class Element
Returns:
the text property

getDomNodeOrNull

public HtmlOption getDomNodeOrNull()
Returns the DOM node that corresponds to this JavaScript object or null if a node hasn't been set.

Overrides:
getDomNodeOrNull in class HTMLElement
Returns:
the DOM node or null

setText

public void setText(String newText)
Sets the value of the "text" property.

Parameters:
newText - the text property

getSelected

public boolean getSelected()
Returns the value of the "selected" property.

Returns:
the text property

setSelected

public void setSelected(boolean selected)
Sets the value of the "selected" property.

Parameters:
selected - the new selected property

getDefaultSelected

public boolean getDefaultSelected()
Returns the value of the "defaultSelected" property.

Returns:
the text property

getLabel

public String getLabel()
Returns the value of the "label" property.

Returns:
the label property

setLabel

public void setLabel(String label)
Sets the value of the "label" property.

Parameters:
label - the new label property

getDisabled

public boolean getDisabled()
Returns true if this element is disabled. Overridden to modify browser configurations.

Overrides:
getDisabled in class HTMLElement
Returns:
true if this element is disabled

setDisabled

public void setDisabled(boolean disabled)
Sets whether or not to disable this element. Overridden to modify browser configurations.

Overrides:
setDisabled in class HTMLElement
Parameters:
disabled - True if this is to be disabled


Copyright © 2002-2012 Gargoyle Software Inc.. All Rights Reserved.