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

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.FormField
                                  extended by com.gargoylesoftware.htmlunit.javascript.host.html.HTMLSelectElement
All Implemented Interfaces:
ScriptableWithFallbackGetter, Serializable, Cloneable, Map, net.sourceforge.htmlunit.corejs.javascript.ConstProperties, net.sourceforge.htmlunit.corejs.javascript.debug.DebuggableObject, net.sourceforge.htmlunit.corejs.javascript.Scriptable

public class HTMLSelectElement
extends FormField

The JavaScript object for HtmlSelect.

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

Nested Class Summary
 
Nested classes/interfaces inherited from class com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement
HTMLElement.ProxyDomNode
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
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
HTMLSelectElement()
          Creates an instance.
 
Method Summary
protected  void add_IE(HTMLOptionElement newOptionObject, Object index)
          Adds a new item to the list (optionally) at the specified index in IE way.
protected  void add(HTMLOptionElement newOptionObject, Object beforeOptionObject)
          Adds a new item to the list (optionally) before the specified item in Mozilla way.
protected  void addBefore(HTMLOptionElement newOptionObject, HtmlOption beforeOption)
          Adds the option (and create the associated DOM node if needed) before the specified one or at the end if the specified one in null.
 Object get(int index, net.sourceforge.htmlunit.corejs.javascript.Scriptable start)
          Returns the specified indexed property.
 void initialize()
          Initialize the object.
 void jsConstructor()
          JavaScript constructor.
 void jsxFunction_add(HTMLOptionElement newOptionObject, Object arg2)
          Adds a new item to the list (optionally) before the specified item.
 Object jsxFunction_appendChild(Object childObject)
          Adds a DOM node to the node.
 Object jsxFunction_insertBefore(Object[] args)
          Add a DOM node as a child to this node before the referenced node.
 void jsxFunction_remove(int index)
          Removes option at the specified index.
 int jsxGet_length()
          Returns the value of the "length" property.
 boolean jsxGet_multiple()
          Returns true if the multiple attribute is set.
 HTMLOptionsCollection jsxGet_options()
          Returns the value of the "options" property.
 int jsxGet_selectedIndex()
          Returns the value of the "selectedIndex" property.
 int jsxGet_size()
          Returns the size attribute.
 String jsxGet_type()
          Returns the type of this input.
 String jsxGet_value()
          Returns the actual value of the selected Option.
 void jsxSet_length(int newLength)
          Removes options by reducing the "length" property.
 void jsxSet_multiple(boolean multiple)
          Sets or clears the multiple attribute.
 void jsxSet_selectedIndex(int index)
          Sets the value of the "selectedIndex" property.
 void jsxSet_size(String size)
          Sets the size attribute.
 void jsxSet_value(String newValue)
          Selects the option with the specified value.
 void put(int index, net.sourceforge.htmlunit.corejs.javascript.Scriptable start, Object newValue)
          Sets the index property.
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.FormField
jsxGet_name, jsxGet_onchange, jsxSet_name, jsxSet_onchange, setDomNode
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.FormChild
jsxGet_form
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement
addComponentRequest, clearComponentRequest, compareVersions, createEventHandler, doComponentRequest, fixAttributeName, getAlign, getAvailHeight, getAvailWidth, getBoxObject, getBufferDepth, getCh, getChOff, getColorDepth, getComponentVersion, getConnectionType, getCookieEnabled, getCpuClass, getDomNodeOrDie, getDomNodeOrNull, getHeight, getJavaEnabled, getParentHTMLElement, getPlatform, getPosX, getPosY, getSystemLanguage, getUserLanguage, getVAlign, getWidth, getWidthOrHeight, getWithFallback, isAncestorOfEventTarget, isAttributeName, isComponentInstalled, isHomePage, jsxFunction_addBehavior, jsxFunction_blur, jsxFunction_clearAttributes, jsxFunction_click, jsxFunction_contains, jsxFunction_createTextRange, jsxFunction_dispatchEvent, jsxFunction_doScroll, jsxFunction_focus, jsxFunction_getAttributeNode, jsxFunction_getAttributeNodeNS, jsxFunction_getAttributeNS, jsxFunction_getBoundingClientRect, jsxFunction_getClientRects, jsxFunction_getElementsByClassName, jsxFunction_getElementsByTagName, jsxFunction_hasAttributeNS, jsxFunction_insertAdjacentElement, jsxFunction_insertAdjacentHTML, jsxFunction_mergeAttributes, jsxFunction_removeAttributeNode, jsxFunction_removeAttributeNS, jsxFunction_removeBehavior, jsxFunction_removeExpression, jsxFunction_removeNode, jsxFunction_scrollIntoView, jsxFunction_setActive, jsxFunction_setAttribute, jsxFunction_setAttributeNode, jsxFunction_setAttributeNS, jsxFunction_setExpression, jsxGet_accessKey, jsxGet_all, jsxGet_children, jsxGet_className, jsxGet_clientHeight, jsxGet_clientLeft, jsxGet_clientTop, jsxGet_clientWidth, jsxGet_currentStyle, jsxGet_dir, jsxGet_disabled, jsxGet_document, jsxGet_filters, jsxGet_id, jsxGet_innerHTML, jsxGet_innerText, jsxGet_lang, jsxGet_language, jsxGet_localName, jsxGet_namespaceURI, jsxGet_nodeName, jsxGet_offsetHeight, jsxGet_offsetLeft, jsxGet_offsetParent, jsxGet_offsetTop, jsxGet_offsetWidth, jsxGet_outerHTML, jsxGet_parentElement, jsxGet_prefix, jsxGet_runtimeStyle, jsxGet_scopeName, jsxGet_scrollHeight, jsxGet_scrollLeft, jsxGet_scrollTop, jsxGet_scrollWidth, jsxGet_spellcheck, jsxGet_style, jsxGet_tabIndex, jsxGet_tagUrn, jsxGet_title, jsxGet_uniqueID, jsxSet_accessKey, jsxSet_className, jsxSet_dir, jsxSet_disabled, jsxSet_id, jsxSet_innerHTML, jsxSet_innerText, jsxSet_lang, jsxSet_language, jsxSet_outerHTML, jsxSet_scrollLeft, jsxSet_scrollTop, jsxSet_spellcheck, jsxSet_tabIndex, jsxSet_tagUrn, jsxSet_textContent, jsxSet_title, navigateHomePage, parseHtmlSnippet, readAttributes, setAlign, setCh, setChOff, setColorAttribute, setDefaults, setHomePage, setVAlign, setWidthOrHeight, startDownload, toString
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.Element
createAttributesObject, jsxFunction_getAttribute, jsxFunction_getElementsByTagNameNS, jsxFunction_hasAttribute, jsxFunction_removeAttribute, jsxFunction_selectNodes, jsxFunction_selectSingleNode, jsxGet_attributes, jsxGet_tagName, jsxGet_text
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.EventNode
jsxFunction_fireEvent, jsxGet_onblur, jsxGet_onclick, jsxGet_oncontextmenu, jsxGet_ondblclick, jsxGet_onerror, jsxGet_onfocus, jsxGet_onfocusin, jsxGet_onfocusout, jsxGet_onkeydown, jsxGet_onkeypress, jsxGet_onkeyup, jsxGet_onmousedown, jsxGet_onmousemove, jsxGet_onmouseout, jsxGet_onmouseover, jsxGet_onmouseup, jsxGet_onpropertychange, jsxGet_onresize, jsxSet_onblur, jsxSet_onclick, jsxSet_oncontextmenu, jsxSet_ondblclick, jsxSet_onerror, jsxSet_onfocus, jsxSet_onfocusin, jsxSet_onfocusout, jsxSet_onkeydown, jsxSet_onkeypress, jsxSet_onkeyup, jsxSet_onmousedown, jsxSet_onmousemove, jsxSet_onmouseout, jsxSet_onmouseover, jsxSet_onmouseup, jsxSet_onpropertychange, jsxSet_onresize
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.Node
executeEvent, fireEvent, getEventHandler, getEventHandlerProp, getJavaScriptNode, getParent, hasEventHandlers, jsxFunction_addEventListener, jsxFunction_attachEvent, jsxFunction_cloneNode, jsxFunction_compareDocumentPosition, jsxFunction_detachEvent, jsxFunction_hasChildNodes, jsxFunction_insertBefore, jsxFunction_isSameNode, jsxFunction_normalize, jsxFunction_removeChild, jsxFunction_removeEventListener, jsxFunction_replaceChild, jsxGet_childNodes, jsxGet_firstChild, jsxGet_lastChild, jsxGet_nextSibling, jsxGet_nodeType, jsxGet_nodeValue, jsxGet_ownerDocument, jsxGet_parentNode, jsxGet_previousSibling, jsxGet_textContent, jsxGet_xml, jsxSet_nodeValue, setEventHandler, setEventHandlerProp
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
clone, defineFunctionProperties, defineProperty, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getPrototype, getScriptableFor, getStartingScope, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, hasInstance, initParentScope, makeScriptableFor, setCaseSensitive, setDomNode, setHtmlElement
 
Methods inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, clear, containsKey, containsValue, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, entrySet, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypeOf, has, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, keySet, preventExtensions, put, put, putAll, putConst, putConstProperty, putProperty, putProperty, redefineProperty, remove, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype, size, values
 
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, setParentScope, setPrototype
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

HTMLSelectElement

public HTMLSelectElement()
Creates an instance.

Method Detail

jsConstructor

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


initialize

public void initialize()
Initialize the object.


jsxFunction_remove

public void jsxFunction_remove(int index)
Removes option at the specified index.

Parameters:
index - the index of the item to remove

jsxFunction_add

public void jsxFunction_add(HTMLOptionElement newOptionObject,
                            Object arg2)
Adds a new item to the list (optionally) before the specified item.

Parameters:
newOptionObject - the DomNode to insert
arg2 - for Firefox: the DomNode to insert the previous element before (null if at end), for Internet Explorer: the index where the element should be placed (optional).

jsxFunction_appendChild

public Object jsxFunction_appendChild(Object childObject)
Adds a DOM node to the node.

Overrides:
jsxFunction_appendChild in class Node
Parameters:
childObject - the node to add to this node
Returns:
the newly added child node

jsxFunction_insertBefore

public Object jsxFunction_insertBefore(Object[] args)
Add a DOM node as a child to this node before the referenced node. If the referenced node is null, append to the end.

Overrides:
jsxFunction_insertBefore in class Node
Parameters:
args - the arguments
Returns:
the newly added child node

add_IE

protected void add_IE(HTMLOptionElement newOptionObject,
                      Object index)
Adds a new item to the list (optionally) at the specified index in IE way.

Parameters:
newOptionObject - the DomNode to insert
index - (optional) the index where the node should be inserted

add

protected void add(HTMLOptionElement newOptionObject,
                   Object beforeOptionObject)
Adds a new item to the list (optionally) before the specified item in Mozilla way.

Parameters:
newOptionObject - the DomNode to insert
beforeOptionObject - the DomNode to insert the previous element before (null if at end)

addBefore

protected void addBefore(HTMLOptionElement newOptionObject,
                         HtmlOption beforeOption)
Adds the option (and create the associated DOM node if needed) before the specified one or at the end if the specified one in null.

Parameters:
newOptionObject - the new option to add
beforeOption - the option that should be after the option to add

jsxGet_type

public String jsxGet_type()
Returns the type of this input.

Overrides:
jsxGet_type in class FormField
Returns:
the type

jsxGet_options

public HTMLOptionsCollection jsxGet_options()
Returns the value of the "options" property.

Returns:
the options property

jsxGet_selectedIndex

public int jsxGet_selectedIndex()
Returns the value of the "selectedIndex" property.

Returns:
the selectedIndex property

jsxSet_selectedIndex

public void jsxSet_selectedIndex(int index)
Sets the value of the "selectedIndex" property.

Parameters:
index - the new value

jsxGet_value

public String jsxGet_value()
Returns the actual value of the selected Option.

Overrides:
jsxGet_value in class FormField
Returns:
the value

jsxGet_length

public int jsxGet_length()
Returns the value of the "length" property.

Returns:
the length property

jsxSet_length

public void jsxSet_length(int newLength)
Removes options by reducing the "length" property.

Parameters:
newLength - the new length property value

get

public Object get(int index,
                  net.sourceforge.htmlunit.corejs.javascript.Scriptable start)
Returns the specified indexed property.

Specified by:
get in interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
Overrides:
get in class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
Parameters:
index - the index of the property
start - the scriptable object that was originally queried for this property
Returns:
the property

put

public void put(int index,
                net.sourceforge.htmlunit.corejs.javascript.Scriptable start,
                Object newValue)
Sets the index property.

Specified by:
put in interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
Overrides:
put in class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
Parameters:
index - the index
start - the scriptable object that was originally invoked for this property
newValue - the new value

jsxSet_value

public void jsxSet_value(String newValue)
Selects the option with the specified value.

Overrides:
jsxSet_value in class FormField
Parameters:
newValue - the value of the option to select

jsxGet_size

public int jsxGet_size()
Returns the size attribute.

Returns:
the size attribute

jsxSet_size

public void jsxSet_size(String size)
Sets the size attribute.

Parameters:
size - the size attribute

jsxGet_multiple

public boolean jsxGet_multiple()
Returns true if the multiple attribute is set.

Returns:
true if the multiple attribute is set

jsxSet_multiple

public void jsxSet_multiple(boolean multiple)
Sets or clears the multiple attribute.

Parameters:
multiple - true to set the multiple attribute, false to clear it


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