|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.ecs.GenericElement | +--org.apache.ecs.ElementAttributes | +--org.apache.ecs.ConcreteElement | +--org.apache.ecs.MultiPartElement | +--org.apache.ecs.html.Option
This class creates a <Option> tag.
The Option tag now defaults to having a closing </Option> (as is now required). This can be overridden by setNeedClosingTag(false).
This change means that you should construct select options element in the following manner:
rather than
new org.apache.ecs.html.Select
.addElement(new option("value1").addElement("text1"))
.addElement(new option("value2").addElement("text2"))
(this change should not break existing code too badly since browsers generally display
the output from the above correctly).
new org.apache.ecs.html.Select
.addElement(new option("value1").addElement("text1")
.addElement(new option("value2").addElement("text2")))
Alternatively, you could use the new option constructor and do something like
or even
new org.apache.ecs.html.Select
.addElement(new option("text1","value1","text1"))
.addElement(new option("text2","value2","text2"))
new org.apache.ecs.html.Select
.appendOption("text1","value1","text1")
.appendOption("text2","value2","text2")
Fields inherited from class org.apache.ecs.ConcreteElement |
lineSeparator, registry, registryList |
Fields inherited from class org.apache.ecs.ElementAttributes |
attribute_equality_sign, attribute_filter, attribute_quote, attribute_quote_char, filter_attribute_state |
Fields inherited from class org.apache.ecs.GenericElement |
__text, _defaultFilter, begin_end_modifier, begin_end_modifier_defined, begin_start_modifier, begin_start_modifier_defined, case_type, codeset, element, element_type, end_element, end_end_modifier, end_end_modifier_defined, end_modifier_defined, end_start_modifier, end_start_modifier_defined, end_tag, filter, filter_state, position, pretty_print, start_modifier_defined, start_tag, tabLevel, VERSION |
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 | |
Option()
Basic constructor. |
|
Option(java.lang.String value)
Constructor sets the value attribute. |
|
Option(java.lang.String label,
double value)
Constructor sets the value and label attributes. |
|
Option(java.lang.String label,
double value,
java.lang.String text)
Same as Option(label,value).addElement(text). |
|
Option(java.lang.String label,
int value)
Constructor sets the value and label attributes. |
|
Option(java.lang.String label,
int value,
java.lang.String text)
Same as Option(label,value).addElement(text). |
|
Option(java.lang.String label,
java.lang.String value)
Constructor sets the value and label attributes. |
|
Option(java.lang.String label,
java.lang.String value,
java.lang.String text)
Same as Option(label,value).addElement(text). |
Method Summary | |
(package private) void |
Private initialization routine. |
Option |
addElement(Element element)
Adds an Element to the element. |
Option |
addElement(java.lang.String element)
Adds an Element to the element. |
Option[] |
addElement(java.lang.String[] element)
Creates a group of options. |
Option |
addElement(java.lang.String hashcode,
Element element)
Adds an Element to the element. |
Option |
addElement(java.lang.String hashcode,
java.lang.String element)
Adds an Element to the element. |
boolean |
getDisabled()
Gets the value of the disabled attribute. |
java.lang.String |
getLabel()
Gets the LABEL attribute. |
boolean |
getSelected()
Gets the SELECTED attribute. |
java.lang.String |
getValue()
Gets the VALUE attribute. |
Option |
removeElement(java.lang.String hashcode)
Removes an Element from the element. |
Option |
setDisabled(boolean disabled)
Sets the disabled value |
Option |
setLabel(java.lang.String label)
Sets the LABEL="" 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 |
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. |
Option |
setSelected(boolean selected)
Sets the selected value |
Option |
setValue(double value)
Sets the VALUE="" attribute |
Option |
setValue(int value)
Sets the VALUE="" attribute |
Option |
setValue(java.lang.String value)
Sets the VALUE="" 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 java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
Constructor Detail |
public Option()
public Option(java.lang.String value)
value
- sets the attribute VALUE=""public Option(java.lang.String label, java.lang.String value)
label
- sets the attribute LABEL=""value
- sets the attribute VALUE=""public Option(java.lang.String label, int value)
label
- sets the attribute LABEL=""value
- sets the attribute VALUE=""public Option(java.lang.String label, double value)
label
- sets the attribute LABEL=""value
- sets the attribute VALUE=""public Option(java.lang.String label, java.lang.String value, java.lang.String text)
label
- sets the attribute LABEL=""value
- sets the attribute VALUE=""text
- is added as an elementpublic Option(java.lang.String label, int value, java.lang.String text)
label
- sets the attribute LABEL=""value
- sets the attribute VALUE=""text
- is added as an elementpublic Option(java.lang.String label, double value, java.lang.String text)
label
- sets the attribute LABEL=""value
- sets the attribute VALUE=""text
- is added as an elementMethod Detail |
void()
in class MultiPartElement
public Option setLabel(java.lang.String label)
label
- the LABEL="" attributepublic java.lang.String getLabel()
public Option setValue(java.lang.String value)
value
- the VALUE="" attributepublic Option setValue(int value)
value
- the VALUE="" attributepublic Option setValue(double value)
value
- the VALUE="" attributepublic java.lang.String getValue()
public Option setSelected(boolean selected)
selected
- true or falsepublic boolean getSelected()
public Option setDisabled(boolean disabled)
disabled
- true or falsepublic boolean getDisabled()
public Option addElement(java.lang.String hashcode, Element element)
hashcode
- name of element for hash tableelement
- Adds an Element to the element.public Option addElement(java.lang.String hashcode, java.lang.String element)
hashcode
- name of element for hash tableelement
- Adds an Element to the element.public Option addElement(Element element)
element
- Adds an Element to the element.public Option addElement(java.lang.String element)
element
- Adds an Element to the element.public Option[] addElement(java.lang.String[] element)
Creates
- a group of options.public Option removeElement(java.lang.String hashcode)
hashcode
- the name of the element to be removed.public void setOnFocus(java.lang.String script)
setOnFocus
in interface FocusEvents
The
- scriptpublic void setOnBlur(java.lang.String script)
setOnBlur
in interface FocusEvents
The
- scriptpublic void setOnSubmit(java.lang.String script)
setOnSubmit
in interface FormEvents
The
- scriptpublic void setOnReset(java.lang.String script)
setOnReset
in interface FormEvents
The
- scriptpublic void setOnSelect(java.lang.String script)
setOnSelect
in interface FormEvents
The
- scriptpublic void setOnChange(java.lang.String script)
setOnChange
in interface FormEvents
The
- scriptpublic void setOnClick(java.lang.String script)
setOnClick
in interface MouseEvents
The
- scriptpublic void setOnDblClick(java.lang.String script)
setOnDblClick
in interface MouseEvents
The
- scriptpublic void setOnMouseDown(java.lang.String script)
setOnMouseDown
in interface MouseEvents
The
- scriptpublic void setOnMouseUp(java.lang.String script)
setOnMouseUp
in interface MouseEvents
The
- scriptpublic void setOnMouseOver(java.lang.String script)
setOnMouseOver
in interface MouseEvents
The
- scriptpublic void setOnMouseMove(java.lang.String script)
setOnMouseMove
in interface MouseEvents
The
- scriptpublic void setOnMouseOut(java.lang.String script)
setOnMouseOut
in interface MouseEvents
The
- scriptpublic void setOnKeyPress(java.lang.String script)
setOnKeyPress
in interface KeyEvents
The
- scriptpublic void setOnKeyDown(java.lang.String script)
setOnKeyDown
in interface KeyEvents
The
- scriptpublic void setOnKeyUp(java.lang.String script)
setOnKeyUp
in interface KeyEvents
The
- script
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |