org.apache.html.dom
Class HTMLSelectElementImpl

java.lang.Object
  |
  +--org.apache.xerces.dom.NodeImpl
        |
        +--org.apache.xerces.dom.ChildNode
              |
              +--org.apache.xerces.dom.ParentNode
                    |
                    +--org.apache.xerces.dom.ElementImpl
                          |
                          +--org.apache.html.dom.HTMLElementImpl
                                |
                                +--org.apache.html.dom.HTMLSelectElementImpl
All Implemented Interfaces:
java.lang.Cloneable, Element, EventTarget, HTMLElement, HTMLFormControl, HTMLSelectElement, Node, NodeList, java.io.Serializable

public class HTMLSelectElementImpl
extends HTMLElementImpl
implements HTMLSelectElement, HTMLFormControl

Version:
$Revision: 316847 $ $Date: 2001-01-30 18:58:06 -0500 (Tue, 30 Jan 2001) $
Author:
Assaf Arkin
See Also:
HTMLSelectElement, ElementImpl, Serialized Form

Fields inherited from class org.apache.xerces.dom.ElementImpl
attributes, name
 
Fields inherited from class org.apache.xerces.dom.ParentNode
fCachedChild, fCachedChildIndex, fCachedLength, firstChild, ownerDocument
 
Fields inherited from class org.apache.xerces.dom.ChildNode
nextSibling, previousSibling
 
Fields inherited from class org.apache.xerces.dom.NodeImpl
ELEMENT_DEFINITION_NODE, FIRSTCHILD, flags, HASSTRING, IGNORABLEWS, OWNED, ownerNode, READONLY, SPECIFIED, SYNCCHILDREN, SYNCDATA, UNNORMALIZED
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Constructor Summary
HTMLSelectElementImpl(HTMLDocumentImpl owner, java.lang.String name)
          Constructor requires owner document.
 
Method Summary
 void add(HTMLElement element, HTMLElement before)
          Add a new element to the collection of OPTION elements for this SELECT .
 void blur()
          Removes keyboard focus from this element.
 void focus()
          Gives keyboard focus to this element.
 NodeList getChildNodes()
          A NodeList that contains all children of this node.
 boolean getDisabled()
          The control is unavailable in this context.
 int getLength()
          The number of options in this SELECT .
 boolean getMultiple()
          If true, multiple OPTION elements may be selected in this SELECT .
 java.lang.String getName()
          Form control or object name when submitted with a form.
 HTMLCollection getOptions()
          The collection of OPTION elements contained by this element.
 int getSelectedIndex()
          The ordinal index of the selected option, starting from 0.
 int getSize()
          Number of visible rows.
 int getTabIndex()
          Index that represents the element's position in the tabbing order.
 java.lang.String getType()
          The type of this form control.
 java.lang.String getValue()
          The current form control value.
 void remove(int index)
          Remove an element from the collection of OPTION elements for this SELECT .
 void setDisabled(boolean disabled)
           
 void setMultiple(boolean multiple)
           
 void setName(java.lang.String name)
           
 void setSelectedIndex(int selectedIndex)
           
 void setSize(int size)
           
 void setTabIndex(int tabIndex)
           
 void setValue(java.lang.String value)
           
 
Methods inherited from class org.apache.html.dom.HTMLElementImpl
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getClassName, getDir, getElementsByTagName, getElementsByTagNameNS, getForm, getId, getLang, getTitle, setClassName, setDir, setId, setLang, setTitle
 
Methods inherited from class org.apache.xerces.dom.ElementImpl
cloneNode, getAttributes, getDefaultAttributes, getNodeName, getNodeType, getTagName, hasAttribute, hasAttributeNS, hasAttributes, normalize, reconcileDefaultAttributes, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setReadOnly, setupDefaultAttributes, synchronizeData
 
Methods inherited from class org.apache.xerces.dom.ParentNode
getChildNodesUnoptimized, getFirstChild, getLastChild, getOwnerDocument, hasChildNodes, insertBefore, item, removeChild, replaceChild, synchronizeChildren
 
Methods inherited from class org.apache.xerces.dom.ChildNode
getNextSibling, getParentNode, getPreviousSibling
 
Methods inherited from class org.apache.xerces.dom.NodeImpl
addEventListener, appendChild, changed, changes, dispatchEvent, getLocalName, getNamespaceURI, getNodeValue, getPrefix, getReadOnly, getUserData, isSupported, removeEventListener, setNodeValue, setPrefix, setUserData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.html.HTMLSelectElement
getForm
 
Methods inherited from interface org.w3c.dom.html.HTMLElement
getClassName, getDir, getId, getLang, getTitle, setClassName, setDir, setId, setLang, setTitle
 
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, getAttributes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 

Constructor Detail

HTMLSelectElementImpl

public HTMLSelectElementImpl(HTMLDocumentImpl owner,
                             java.lang.String name)
Constructor requires owner document.
Parameters:
owner - The owner HTML document
Method Detail

getType

public java.lang.String getType()
Description copied from interface: HTMLSelectElement
The type of this form control. This is the string "select-multiple" when the multiple attribute is true and the string "select-one" when false .
Specified by:
getType in interface HTMLSelectElement

getValue

public java.lang.String getValue()
Description copied from interface: HTMLSelectElement
The current form control value.
Specified by:
getValue in interface HTMLSelectElement

setValue

public void setValue(java.lang.String value)
Specified by:
setValue in interface HTMLSelectElement

getSelectedIndex

public int getSelectedIndex()
Description copied from interface: HTMLSelectElement
The ordinal index of the selected option, starting from 0. The value -1 is returned if no element is selected. If multiple options are selected, the index of the first selected option is returned.
Specified by:
getSelectedIndex in interface HTMLSelectElement

setSelectedIndex

public void setSelectedIndex(int selectedIndex)
Specified by:
setSelectedIndex in interface HTMLSelectElement

getOptions

public HTMLCollection getOptions()
Description copied from interface: HTMLSelectElement
The collection of OPTION elements contained by this element.
Specified by:
getOptions in interface HTMLSelectElement

getLength

public int getLength()
Description copied from interface: HTMLSelectElement
The number of options in this SELECT .
Specified by:
getLength in interface HTMLSelectElement
Overrides:
getLength in class ParentNode
Following copied from class: org.apache.xerces.dom.ParentNode
Returns:
int

getDisabled

public boolean getDisabled()
Description copied from interface: HTMLSelectElement
The control is unavailable in this context. See the disabled attribute definition in HTML 4.0.
Specified by:
getDisabled in interface HTMLSelectElement

setDisabled

public void setDisabled(boolean disabled)
Specified by:
setDisabled in interface HTMLSelectElement

getMultiple

public boolean getMultiple()
Description copied from interface: HTMLSelectElement
If true, multiple OPTION elements may be selected in this SELECT . See the multiple attribute definition in HTML 4.0.
Specified by:
getMultiple in interface HTMLSelectElement

setMultiple

public void setMultiple(boolean multiple)
Specified by:
setMultiple in interface HTMLSelectElement

getName

public java.lang.String getName()
Description copied from interface: HTMLSelectElement
Form control or object name when submitted with a form. See the name attribute definition in HTML 4.0.
Specified by:
getName in interface HTMLSelectElement

setName

public void setName(java.lang.String name)
Specified by:
setName in interface HTMLSelectElement

getSize

public int getSize()
Description copied from interface: HTMLSelectElement
Number of visible rows. See the size attribute definition in HTML 4.0.
Specified by:
getSize in interface HTMLSelectElement

setSize

public void setSize(int size)
Specified by:
setSize in interface HTMLSelectElement

getTabIndex

public int getTabIndex()
Description copied from interface: HTMLSelectElement
Index that represents the element's position in the tabbing order. See the tabindex attribute definition in HTML 4.0.
Specified by:
getTabIndex in interface HTMLSelectElement

setTabIndex

public void setTabIndex(int tabIndex)
Specified by:
setTabIndex in interface HTMLSelectElement

add

public void add(HTMLElement element,
                HTMLElement before)
Description copied from interface: HTMLSelectElement
Add a new element to the collection of OPTION elements for this SELECT . This method is the equivalent of the appendChild method of the Node interface if the before parameter is null . It is equivalent to the insertBefore method on the parent of before in all other cases.
Specified by:
add in interface HTMLSelectElement
Following copied from interface: org.w3c.dom.html.HTMLSelectElement
Parameters:
element - The element to add.
before - The element to insert before, or null for the tail of the list.
Throws:
DOMException - NOT_FOUND_ERR: Raised if before is not a descendant of the SELECT element.

remove

public void remove(int index)
Description copied from interface: HTMLSelectElement
Remove an element from the collection of OPTION elements for this SELECT . Does nothing if no element has the given index.
Specified by:
remove in interface HTMLSelectElement
Following copied from interface: org.w3c.dom.html.HTMLSelectElement
Parameters:
index - The index of the item to remove, starting from 0.

blur

public void blur()
Description copied from interface: HTMLSelectElement
Removes keyboard focus from this element.
Specified by:
blur in interface HTMLSelectElement

focus

public void focus()
Description copied from interface: HTMLSelectElement
Gives keyboard focus to this element.
Specified by:
focus in interface HTMLSelectElement

getChildNodes

public NodeList getChildNodes()
Description copied from interface: Node
A NodeList that contains all children of this node. If there are no children, this is a NodeList containing no nodes.
Specified by:
getChildNodes in interface Node
Overrides:
getChildNodes in class ParentNode


Copyright © 1999-2001 Apache XML Project. All Rights Reserved.