org.apache.ecs.html
Class Select

java.lang.Object
  extended byorg.apache.ecs.GenericElement
      extended byorg.apache.ecs.ElementAttributes
          extended byorg.apache.ecs.ConcreteElement
              extended byorg.apache.ecs.MultiPartElement
                  extended byorg.apache.ecs.html.Select
All Implemented Interfaces:
Attributes, java.lang.Cloneable, Element, ElementRegistry, FocusEvents, FormEvents, KeyEvents, MouseEvents, PageEvents, Printable, java.io.Serializable

public class Select
extends MultiPartElement
implements Printable, PageEvents, FormEvents, MouseEvents, KeyEvents, FocusEvents

This class creates a <SELECT> tag.

Please note that the Option element now defaults to add a closing tag (as is now required by the specification).

Version:
$Id: Select.java,v 1.7 2003/04/27 09:03:51 rdonkin Exp $
Author:
Stephan Nagy, Jon S. Stevens
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.ecs.ConcreteElement
 
Fields inherited from class org.apache.ecs.ElementAttributes
 
Fields inherited from class org.apache.ecs.GenericElement
tabLevel
 
Fields inherited from interface org.apache.ecs.Attributes
NO_ATTRIBUTE_VALUE
 
Fields inherited from interface org.apache.ecs.Element
CENTER, LEFT, LOWERCASE, MIXEDCASE, RIGHT, UPPERCASE
 
Constructor Summary
Select()
          Basic constructor.
Select(java.lang.String name)
          Constructor sets the name attribute.
Select(java.lang.String name, int size)
          Constructor sets the name and size attribute.
Select(java.lang.String name, Option[] element)
          Constructor sets the name attribute and adds all the option elements in the array.
Select(java.lang.String name, java.lang.String size)
          Constructor sets the name and size attribute.
Select(java.lang.String name, java.lang.String[] element)
          Constructor sets the name attribute and adds all the elements in the array.
 
Method Summary
 Select addElement(Element element)
          Adds an Element to the Element.
 Select addElement(Option[] element)
          Adds a group of elements to the select element.
 Select addElement(java.lang.String element)
          Adds an Element to the Element.
 Select addElement(java.lang.String[] element)
          Creates a group of option elements and adds them to this select.
 Select addElement(java.lang.String hashcode, Element element)
          Adds an Element to the element.
 Select addElement(java.lang.String hashcode, java.lang.String element)
          Adds an Element to the element.
 Select appendOption(java.lang.String value)
           Creates and appends an option element.
 Select appendOption(java.lang.String label, double value)
           Creates and appends an option element.
 Select appendOption(java.lang.String label, double value, java.lang.String text)
           Creates and appends an option element.
 Select appendOption(java.lang.String label, int value)
           Creates and appends an option element.
 Select appendOption(java.lang.String label, int value, java.lang.String text)
           Creates and appends an option element.
 Select appendOption(java.lang.String label, java.lang.String value)
           Creates and appends an option element.
 Select appendOption(java.lang.String label, java.lang.String value, java.lang.String text)
           Creates and appends an option element.
 Select removeElement(java.lang.String hashcode)
          Removes an Element from the element.
 Select selectOption(int option)
           
 Select setDisabled(boolean disabled)
          Sets the disabled value
 Select setMultiple(boolean multiple)
          Sets the multiple value
 Select setName(java.lang.String name)
          Sets the NAME="" attribute
 void setOnBlur(java.lang.String script)
          The onblur event occurs when an element loses focus either by the pointing device or by tabbing navigation.
 void setOnChange(java.lang.String script)
          The onchange event occurs when a control loses the input focus and its value has been modified since gaining focus.
 void setOnClick(java.lang.String script)
          The onclick event occurs when the pointing device button is clicked over an element.
 void setOnDblClick(java.lang.String script)
          The ondblclick event occurs when the pointing device button is double clicked over an element.
 void setOnFocus(java.lang.String script)
          The onfocus event occurs when an element receives focus either by the pointing device or by tabbing navigation.
 void setOnKeyDown(java.lang.String script)
          The onkeydown event occurs when a key is pressed down over an element.
 void setOnKeyPress(java.lang.String script)
          The onkeypress event occurs when a key is pressed and released over an element.
 void setOnKeyUp(java.lang.String script)
          The onkeyup event occurs when a key is released over an element.
 void setOnLoad(java.lang.String script)
          The onload event occurs when the user agent finishes loading a window or all frames within a FRAMESET.
 void setOnMouseDown(java.lang.String script)
          The onmousedown event occurs when the pointing device button is pressed over an element.
 void setOnMouseMove(java.lang.String script)
          The onmousemove event occurs when the pointing device is moved while it is over an element.
 void setOnMouseOut(java.lang.String script)
          The onmouseout event occurs when the pointing device is moved away from an element.
 void setOnMouseOver(java.lang.String script)
          The onmouseover event occurs when the pointing device is moved onto an element.
 void setOnMouseUp(java.lang.String script)
          The onmouseup event occurs when the pointing device button is released over an element.
 void setOnReset(java.lang.String script)
          The onreset event occurs when a form is reset.
 void setOnSelect(java.lang.String script)
          The onselect event occurs when a user selects some text in a text field.
 void setOnSubmit(java.lang.String script)
          The onsubmit event occurs when a form is submitted.
 void setOnUnload(java.lang.String script)
          The onunload event occurs when the user agent removes a document from a window or frame.
 Select setSize(int size)
          Sets the SIZE="" attribute
 Select setSize(java.lang.String size)
          Sets the SIZE="" attribute
 Select setTabindex(int index)
          Sets the TABINDEX="" attribute
 Select setTabindex(java.lang.String index)
          Sets the TABINDEX="" attribute
 
Methods inherited from class org.apache.ecs.ConcreteElement
addElementToRegistry, addElementToRegistry, addElementToRegistry, addElementToRegistry, addElementToRegistry, addElementToRegistry, addElementToRegistry, addElementToRegistry, clone, elements, getElement, isEmpty, keys, output, output, output, output, registryHasElement, registryHasElement, removeElementFromRegistry, removeElementFromRegistry
 
Methods inherited from class org.apache.ecs.ElementAttributes
addAttribute, addAttribute, addAttribute, addAttribute, attributes, createStartTag, getAttribute, getAttributeEqualitySign, getAttributeFilter, getAttributeFilterState, getAttributeQuote, getAttributeQuoteChar, hasAttribute, removeAttribute, setAttributeEqualitySign, setAttributeFilter, setAttributeFilterState, setAttributeQuote, setAttributeQuoteChar, setClass, setDir, setID, setLang, setStyle, setTitle
 
Methods inherited from class org.apache.ecs.GenericElement
alterCase, createEndTag, getBeginEndModifier, getBeginEndModifierDefined, getBeginStartModifier, getBeginStartModifierDefined, getCase, getCodeSet, getElementHashEntry, getElementType, getEndEndModifier, getEndEndModifierDefined, getEndStartModifier, getEndStartModifierDefined, getEndTagChar, getFilter, getFilterState, getNeedClosingTag, getNeedLineBreak, getPrettyPrint, getStartTagChar, getTabLevel, getTagPosition, getTagText, getVersion, putTabs, putTabs, removeBeginEndModifier, removeBeginStartModifier, removeEndEndModifier, removeEndStartModifier, setBeginEndModifier, setBeginModifier, setBeginModifier, setBeginStartModifier, setCase, setCodeSet, setElementType, setEndEndModifier, setEndModifier, setEndModifier, setEndStartModifier, setEndTagChar, setFilter, setFilterState, setNeedClosingTag, setPrettyPrint, setStartTagChar, setTabLevel, setTagPosition, setTagText, toString, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Select

public Select()
Basic constructor. Use the set* methods to set attributes.


Select

public Select(java.lang.String name)
Constructor sets the name attribute. Use the set* methods to set the other attributes.

Parameters:
name - set the NAME="" attribute

Select

public Select(java.lang.String name,
              java.lang.String size)
Constructor sets the name and size attribute. Use the set* methods to set the other attributes.

Parameters:
name - set the NAME="" attribute

Select

public Select(java.lang.String name,
              int size)
Constructor sets the name and size attribute. Use the set* methods to set the other attributes.

Parameters:
name - set the NAME="" attribute

Select

public Select(java.lang.String name,
              java.lang.String[] element)
Constructor sets the name attribute and adds all the elements in the array. Use the set* methods to set the other attributes.

Parameters:
name - set the NAME="" attribute
element - provide a group of strings to be converted to options elements.

Select

public Select(java.lang.String name,
              Option[] element)
Constructor sets the name attribute and adds all the option elements in the array. Use the set* methods to set the other attributes.

Parameters:
name - set the NAME="" attribute
element - provide a group of strings to be converted to options elements.
Method Detail

addElement

public Select addElement(java.lang.String hashcode,
                         Element element)
Adds an Element to the element.

Parameters:
hashcode - name of element for hash table
element - Adds an Element to the element.

addElement

public Select addElement(java.lang.String hashcode,
                         java.lang.String element)
Adds an Element to the element.

Parameters:
hashcode - name of element for hash table
element - Adds an Element to the element.

addElement

public Select addElement(Element element)
Adds an Element to the Element.

Parameters:
element - adds and Element to the Element.

addElement

public Select addElement(Option[] element)
Adds a group of elements to the select element.

Parameters:
element - adds a group of elements to the select element.

addElement

public Select addElement(java.lang.String element)
Adds an Element to the Element.

Parameters:
element - adds and Element to the Element.

addElement

public Select addElement(java.lang.String[] element)
Creates a group of option elements and adds them to this select.

Parameters:
element - adds a group of option elements to this select.

selectOption

public Select selectOption(int option)

appendOption

public Select appendOption(java.lang.String value)

Creates and appends an option element.

Same as addElement(new org.apache.ecs.html.Option(value)).

Parameters:
value - creates an option with value attribute set.

appendOption

public Select appendOption(java.lang.String label,
                           java.lang.String value)

Creates and appends an option element.

Same as addElement(new org.apache.ecs.html.Option(label,value)).

Parameters:
label - creates an option with label attribute set.
value - creates an option with value attribute set.

appendOption

public Select appendOption(java.lang.String label,
                           int value)

Creates and appends an option element.

Same as addElement(new org.apache.ecs.html.Option(label,value)).

Parameters:
label - creates an option with label attribute set.
value - creates an option with value attribute set.

appendOption

public Select appendOption(java.lang.String label,
                           double value)

Creates and appends an option element.

Same as addElement(new org.apache.ecs.html.Option(label,value)).

Parameters:
label - creates an option with label attribute set.
value - creates an option with value attribute set.

appendOption

public Select appendOption(java.lang.String label,
                           java.lang.String value,
                           java.lang.String text)

Creates and appends an option element.

Same as addElement(new org.apache.ecs.html.Option(label,value,text)).

Parameters:
label - creates an option with label attribute set.
value - creates an option with value attribute set.
text - added to the option as a text element.

appendOption

public Select appendOption(java.lang.String label,
                           int value,
                           java.lang.String text)

Creates and appends an option element.

Same as addElement(new org.apache.ecs.html.Option(label,value,text)).

Parameters:
label - creates an option with label attribute set.
value - creates an option with value attribute set.
text - added to the option as a text element.

appendOption

public Select appendOption(java.lang.String label,
                           double value,
                           java.lang.String text)

Creates and appends an option element.

Same as addElement(new org.apache.ecs.html.Option(label,value,text)).

Parameters:
label - creates an option with label attribute set.
value - creates an option with value attribute set.
text - added to the option as a text element.

setName

public Select setName(java.lang.String name)
Sets the NAME="" attribute

Parameters:
name - the NAME="" attribute

setSize

public Select setSize(java.lang.String size)
Sets the SIZE="" attribute

Parameters:
size - the SIZE="" attribute

setSize

public Select setSize(int size)
Sets the SIZE="" attribute

Parameters:
size - the SIZE="" attribute

setMultiple

public Select setMultiple(boolean multiple)
Sets the multiple value

Parameters:
multiple - true or false

setTabindex

public Select setTabindex(java.lang.String index)
Sets the TABINDEX="" attribute


setTabindex

public Select setTabindex(int index)
Sets the TABINDEX="" attribute


setDisabled

public Select setDisabled(boolean disabled)
Sets the disabled value

Parameters:
disabled - true or false

removeElement

public Select removeElement(java.lang.String hashcode)
Removes an Element from the element.

Parameters:
hashcode - the name of the element to be removed.

setOnLoad

public void setOnLoad(java.lang.String script)
The onload event occurs when the user agent finishes loading a window or all frames within a FRAMESET. This attribute may be used with BODY and FRAMESET elements.

Specified by:
setOnLoad in interface PageEvents

setOnUnload

public void setOnUnload(java.lang.String script)
The onunload event occurs when the user agent removes a document from a window or frame. This attribute may be used with BODY and FRAMESET elements.

Specified by:
setOnUnload in interface PageEvents

setOnSubmit

public void setOnSubmit(java.lang.String script)
The onsubmit event occurs when a form is submitted. It only applies to the FORM element.

Specified by:
setOnSubmit in interface FormEvents

setOnReset

public void setOnReset(java.lang.String script)
The onreset event occurs when a form is reset. It only applies to the FORM element.

Specified by:
setOnReset in interface FormEvents

setOnSelect

public void setOnSelect(java.lang.String script)
The onselect event occurs when a user selects some text in a text field. This attribute may be used with the INPUT and TEXTAREA elements.

Specified by:
setOnSelect in interface FormEvents

setOnChange

public void setOnChange(java.lang.String script)
The onchange event occurs when a control loses the input focus and its value has been modified since gaining focus. This attribute applies to the following elements: INPUT, SELECT, and TEXTAREA.

Specified by:
setOnChange in interface FormEvents

setOnClick

public void setOnClick(java.lang.String script)
The onclick event occurs when the pointing device button is clicked over an element. This attribute may be used with most elements.

Specified by:
setOnClick in interface MouseEvents

setOnDblClick

public void setOnDblClick(java.lang.String script)
The ondblclick event occurs when the pointing device button is double clicked over an element. This attribute may be used with most elements.

Specified by:
setOnDblClick in interface MouseEvents

setOnMouseDown

public void setOnMouseDown(java.lang.String script)
The onmousedown event occurs when the pointing device button is pressed over an element. This attribute may be used with most elements.

Specified by:
setOnMouseDown in interface MouseEvents

setOnMouseUp

public void setOnMouseUp(java.lang.String script)
The onmouseup event occurs when the pointing device button is released over an element. This attribute may be used with most elements.

Specified by:
setOnMouseUp in interface MouseEvents

setOnMouseOver

public void setOnMouseOver(java.lang.String script)
The onmouseover event occurs when the pointing device is moved onto an element. This attribute may be used with most elements.

Specified by:
setOnMouseOver in interface MouseEvents

setOnMouseMove

public void setOnMouseMove(java.lang.String script)
The onmousemove event occurs when the pointing device is moved while it is over an element. This attribute may be used with most elements.

Specified by:
setOnMouseMove in interface MouseEvents

setOnMouseOut

public void setOnMouseOut(java.lang.String script)
The onmouseout event occurs when the pointing device is moved away from an element. This attribute may be used with most elements.

Specified by:
setOnMouseOut in interface MouseEvents

setOnKeyPress

public void setOnKeyPress(java.lang.String script)
The onkeypress event occurs when a key is pressed and released over an element. This attribute may be used with most elements.

Specified by:
setOnKeyPress in interface KeyEvents

setOnKeyDown

public void setOnKeyDown(java.lang.String script)
The onkeydown event occurs when a key is pressed down over an element. This attribute may be used with most elements.

Specified by:
setOnKeyDown in interface KeyEvents

setOnKeyUp

public void setOnKeyUp(java.lang.String script)
The onkeyup event occurs when a key is released over an element. This attribute may be used with most elements.

Specified by:
setOnKeyUp in interface KeyEvents

setOnFocus

public void setOnFocus(java.lang.String script)
The onfocus event occurs when an element receives focus either by the pointing device or by tabbing navigation. This attribute may be used with the following elements: LABEL, INPUT, SELECT, TEXTAREA, and BUTTON.

Specified by:
setOnFocus in interface FocusEvents

setOnBlur

public void setOnBlur(java.lang.String script)
The onblur event occurs when an element loses focus either by the pointing device or by tabbing navigation. It may be used with the same elements as onfocus.

Specified by:
setOnBlur in interface FocusEvents


Copyright © 1999-2003 Apache Software Foundation. All Rights Reserved.