ice.pilots.html4
Class DSelectElement

java.lang.Object
  extended byice.storm.DynamicObject
      extended byice.pilots.html4.DNode
          extended byice.pilots.html4.DElement
              extended byice.pilots.html4.FormTypeElement
                  extended byice.pilots.html4.DSelectElement
All Implemented Interfaces:
Cloneable, Element, ElementCSSInlineStyle, EventTarget, HTMLCollection, HTMLElement, HTMLSelectElement, Node

public class DSelectElement
extends ice.pilots.html4.FormTypeElement
implements HTMLSelectElement, HTMLCollection


Nested Class Summary
static interface DSelectElement.SelectPainter
           
 
Field Summary
protected  DFormElement hackForm
           
 
Fields inherited from class ice.pilots.html4.DNode
doc, first, last, next, parent, prev
 
Fields inherited from class ice.storm.DynamicObject
NOT_FOUND, SETD_IGNORE, SETD_NOT_FOUND, SETD_OK
 
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
protected DSelectElement(DDocument d, int id)
           
 
Method Summary
 void add(HTMLElement option, HTMLElement before)
          Add a new element to the collection of OPTION elements for this SELECT.
 void blur()
          Removes keyboard focus from this element.
 Object execDynamicMethod(String name, Object[] args, DynEnv env)
          Perform function-like actions for `name' with the given args.
 DOptionElement firstDOption()
           
protected  String fixValue(String value)
           
 void focus()
          Gives keyboard focus to this element.
 DFormElement getDForm()
           
 boolean getDisabled()
          The control is unavailable in this context.
 DOptionElement getDOption(int idx)
           
 Object getDynamicValue(String name, DynEnv env)
          Returns the `key' field or Defs.NOT_FOUND if `name' does not exist.
 HTMLFormElement getForm()
          Returns the FORM element containing this control.
 int getLength()
          The number of options in this SELECT.
 boolean getMultiple()
          If true, multiple OPTION elements may be selected in this SELECT.
 int getOptionIndex(Object possible_option)
           
 HTMLCollection getOptions()
          The collection of OPTION elements contained by this element.
 DOptionElement getSelectedDOption()
           
 int getSelectedIndex()
          The ordinal index of the selected option, starting from 0.
 int getSize()
          Number of visible rows.
 Object getSlot(int index, DynEnv env)
           
 Object getSlot(String name, DynEnv env)
           
 int getTabIndex()
          Index that represents the element's position in the tabbing order.
 String getType()
          #4699.
 String getValue()
          The current form control value.
 Node item(int idx)
          This method retrieves a node specified by ordinal index.
 Node namedItem(String name)
          This method retrieves a Node using a name.
 DOptionElement nextDOption(DOptionElement option)
           
 void remove(int index)
          Remove an element from the collection of OPTION elements for this SELECT.
 void setDisabled(boolean disabled)
           
 int setDynamicValue(String name, Object value, DynEnv env)
          Set field `name' to `value'.
protected  void setItem(int index, DOptionElement option)
           
 void setLength(int n)
           
 void setMultiple(boolean multiple)
           
 void setSelectedIndex(int selectedIndex)
           
 void setSelectedIndexByUser(int selectedIndex)
           
 void setSize(int size)
           
 void setSlot(int index, Object value, DynEnv env)
          Set index slot to `value'.
 void setTabIndex(int tabIndex)
           
 void setValue(String value)
           
 
Methods inherited from class ice.pilots.html4.DElement
afterClone, attrNameToId, getAttribute, getAttribute, getAttributeAsInt, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getBgColor, getChildViewport, getClassName, getClientLeft, getClientTop, getClientWidth, getColor, getDir, getElementsByTagName, getElementsByTagNameNS, getEmbeddedDocument, getEmbeddedViewHolder, getId, getInnerHTML, getLang, getLocalName, getName, getNamespaceURI, getNodeName, getNodeType, getOuterHTML, getPrefix, getStyle, getSynthetic, getTagName, getTitle, hasAttribute, hasAttributeNS, insertAdjacentHTML, onDAttrValueChange, removeAttribute, removeAttributeNode, removeAttributeNS, removeNode, setAttribute, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setBgColor, setClassName, setColor, setCols, setDir, setId, setInnerHTML, setLang, setName, setOuterHTML, setRows, setTitle, swapDNode, swapNode, toString
 
Methods inherited from class ice.pilots.html4.DNode
addEventListener, appendChild, appendDChild, clone, clone, cloneNode, contains, deleteSlot, dispatchEvent, getAll, getChildNodes, getDAttr, getDAttrCount, getDAttrFromIndex, getDAttrListHead, getDAttrValueOrNull, getDParent, getDynamicScopeParent, getFirstChild, getFirstDChild, getInnerText, getLastChild, getLastDChild, getNameId, getNextDSibling, getNextSibling, getNodeValue, getOuterText, getOwnerDDocument, getOwnerDocument, getParentDNode, getParentNode, getPilot, getPreviousDSibling, getPreviousSibling, getRootDNode, getRootNode, hasAttributes, hasChildNodes, hasSlot, insertBefore, insertDChildBefore, isSupported, normalize, removeAllDAttrs, removeChild, removeDAttr, removeDAttr, removeDChild, removeEventListener, replaceChild, replaceDChild, setDAttr, setDAttr, setInnerText, setNodeValue, setOuterText, setParent, setPrefix, setSlot, unlinkAllSlots
 
Methods inherited from class ice.storm.DynamicObject
deleteSlot, getEnumeratableIds, getMethodPropertySource, getScriptDataLock, getScriptWrapper, hasSlot, javaReflectionTarget, readOnlySlots, script_toSource, script_toString, setScriptWrapperIfAbsent
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.html.HTMLSelectElement
getForm, getName, setName
 
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, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 

Field Detail

hackForm

protected DFormElement hackForm
Constructor Detail

DSelectElement

protected DSelectElement(DDocument d,
                         int id)
Method Detail

getType

public String getType()
#4699. The getType property used to return "select" for both single and multiple select boxes, this has been enhanced to return "select-one" or "select-multiple" as part of the DOM API specification.

Specified by:
getType in interface HTMLSelectElement
Returns:
"select-one" for single select, or "select-multiple" for multiple selection boxes

getSelectedDOption

public DOptionElement getSelectedDOption()

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 final void setSelectedIndex(int selectedIndex)
Specified by:
setSelectedIndex in interface HTMLSelectElement

setSelectedIndexByUser

public final void setSelectedIndexByUser(int selectedIndex)

getValue

public String getValue()
Description copied from interface: HTMLSelectElement
The current form control value.

Specified by:
getValue in interface HTMLSelectElement

setValue

public void setValue(String value)
Specified by:
setValue 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

setLength

public void setLength(int n)

item

public final Node item(int idx)
Description copied from interface: HTMLCollection
This method retrieves a node specified by ordinal index. Nodes are numbered in tree order (depth-first traversal order).

Specified by:
item in interface HTMLCollection
Returns:
The Node at the corresponding position upon success. A value of null is returned if the index is out of range.

getDOption

public DOptionElement getDOption(int idx)

firstDOption

public DOptionElement firstDOption()

nextDOption

public DOptionElement nextDOption(DOptionElement option)

getOptionIndex

public int getOptionIndex(Object possible_option)

namedItem

public Node namedItem(String name)
Description copied from interface: HTMLCollection
This method retrieves a Node using a name. It first searches for a Node with a matching id attribute. If it doesn't find one, it then searches for a Node with a matching name attribute, but only on those elements that are allowed a name attribute.

Specified by:
namedItem in interface HTMLCollection
Returns:
The Node with a name or id attribute whose value corresponds to the specified string. Upon failure (e.g., no node with this name exists), returns null.

setItem

protected void setItem(int index,
                       DOptionElement option)

getSlot

public Object getSlot(String name,
                      DynEnv env)
Overrides:
getSlot in class DNode

getSlot

public Object getSlot(int index,
                      DynEnv env)
Overrides:
getSlot in class DynamicObject

setSlot

public void setSlot(int index,
                    Object value,
                    DynEnv env)
Description copied from class: DynamicObject
Set index slot to `value'. If `value' should be converted to some type, use `env' for conversions

Overrides:
setSlot in class DynamicObject

getOptions

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

Specified by:
getOptions in interface HTMLSelectElement

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

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 option,
                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

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

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

getDynamicValue

public Object getDynamicValue(String name,
                              DynEnv env)
Description copied from class: DynamicObject
Returns the `key' field or Defs.NOT_FOUND if `name' does not exist. Returns `FUNCTION_MARK' if `name' represent a function that can be invoke via execDynamicMethod. Note that returned `null' indicates that value is present but set to null.

Overrides:
getDynamicValue in class DElement

setDynamicValue

public int setDynamicValue(String name,
                           Object value,
                           DynEnv env)
Description copied from class: DynamicObject
Set field `name' to `value'. Use `env' to unwrap `value' to a particular type or store it as is

Overrides:
setDynamicValue in class DElement

execDynamicMethod

public Object execDynamicMethod(String name,
                                Object[] args,
                                DynEnv env)
Description copied from class: DynamicObject
Perform function-like actions for `name' with the given args. Returns the result or Defs.NOT_FOUND if name is not associated with function action. Should return result of env.wrapVoid() to indicate method without return value. Use `env' to unwrap `args' elements to a particular type.

Overrides:
execDynamicMethod in class DElement

getForm

public final HTMLFormElement getForm()

getDForm

public DFormElement getDForm()

fixValue

protected String fixValue(String value)