|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ge.research.html.HTMLTag
com.ge.research.html.SelectTag
Encapsulates all the attributes of an HTML "SELECT" element, its accessors, validations, and default values.
| Field Summary |
| Fields inherited from class com.ge.research.html.HTMLTag |
HORIZONTAL_LINE, LINEBREAK, reconstructTag, tag, WHITESPACE |
| Constructor Summary | |
SelectTag()
Default constructor. |
|
| Method Summary | |
void |
addOption(OptionTag opt)
Adds an option to the list of options within the selection. |
boolean |
getDisabled()
Returns the value of the HTML Tag DISABLED attribute. |
boolean |
getMultiple()
Returns the value of the HTML Tag MULTIPLE attribute. |
java.lang.String |
getName()
Returns the value of the HTML Tag NAME attribute. |
int |
getNumOptions()
Returns the current count of the number of options in this selection. |
java.lang.String |
getOnAfterChange()
Returns the value of the HTML Tag ONAFTERCHANGE behavior. |
java.lang.String |
getOnBeforeChange()
Returns the value of the HTML Tag ONBEFORECHANGE behavior. |
java.lang.String |
getOnChange()
Returns the value of the HTML Tag ONCHANGE behavior. |
OptionTag |
getOption(int index)
Returns the option at the specified index within the list. |
java.util.List |
getOptions()
Returns the List of options for this selection.
|
java.lang.String |
getOptionString(int index)
Returns the string representation of the option at the specified index within the list. |
int |
getSize()
Returns the value of the HTML Tag SIZE attribute. |
boolean |
removeOption(int index)
Removes the option at the specified index within the list. |
void |
removeOptions()
Removes all options from the list of options within the selection. |
protected void |
resetTagSpecificInformation()
Resets the tag attributes and content of the HTML Tag to their default values. |
void |
setDisabled(boolean attribute)
Sets the HTML Tag DISABLED attribute. |
void |
setMultiple(boolean attribute)
Sets the HTML Tag MULTIPLE attribute. |
void |
setName(java.lang.String attribute)
Sets the HTML Tag NAME attribute. |
void |
setOnAfterChange(java.lang.String attribute)
Sets the HTML Tag ONAFTERCHANGE behavior. |
void |
setOnBeforeChange(java.lang.String attribute)
Sets the HTML Tag ONBEFORECHANGE behavior. |
void |
setOnChange(java.lang.String attribute)
Sets the HTML Tag ONCHANGE behavior. |
void |
setOptions(java.util.List list)
Sets the list of options within the selection. |
void |
setSize(int attribute)
Sets the HTML Tag SIZE attribute. |
protected void |
writeTagSpecificAttributes()
Adds the tag specific attribute information to the HTML Tag. |
protected void |
writeTagSpecificData()
Adds the tag content to the HTML Tag. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public SelectTag()
TagPropertyConstants.SELECT_TAG).
TagPropertyConstants.SELECT_TAG| Method Detail |
public void addOption(OptionTag opt)
HTMLTag.reconstructTag to true
opt - the option to add to the selectionHTMLTag.reconstructTagpublic boolean getDisabled()
true if the tag is disabled;
false if the tag is enabledpublic boolean getMultiple()
true if the tag allows multiple selections;
false if the tag allows at most a single selectionpublic java.lang.String getName()
public int getNumOptions()
public java.lang.String getOnChange()
public java.lang.String getOnBeforeChange()
public java.lang.String getOnAfterChange()
public OptionTag getOption(int index)
throws java.lang.IndexOutOfBoundsException
index - the index of the list of options to extract
java.lang.IndexOutOfBoundsException - If index is negative or if index is greater than or equal to the value of getNumOptions()public java.util.List getOptions()
List of options for this selection.
Each element of the List is of type OptionTag
List of options, of type OptionTag, within the selection
public java.lang.String getOptionString(int index)
throws java.lang.IndexOutOfBoundsException
index - the index of the list of options to extract
java.lang.IndexOutOfBoundsException - If index is negative or if index is greater than or equal to the value of getNumOptions()getOption(int)public int getSize()
public boolean removeOption(int index)
throws java.lang.IndexOutOfBoundsException
HTMLTag.reconstructTag to true
index - the index of the list of options to remove
true if the option was successfully removed;
otherwise an exception is thrown
java.lang.IndexOutOfBoundsException - If index is negative or if index is greater than or equal to the value of getNumOptions()HTMLTag.reconstructTagpublic void removeOptions()
HTMLTag.reconstructTag to true
HTMLTag.reconstructTagpublic void setDisabled(boolean attribute)
HTMLTag.reconstructTag to true.
attribute - true if this HTML Tag should be disabled;
false if this HTML Tag should be enabled.HTMLTag.reconstructTagpublic void setMultiple(boolean attribute)
HTMLTag.reconstructTag to true.
attribute - true if this HTML Tag should allow multiple selections;
false if this HTML Tag should allow at most a single selection.HTMLTag.reconstructTagpublic void setName(java.lang.String attribute)
HTMLTag.reconstructTag to true.
attribute - the new value for the HTML Tag NAME attributeHTMLTag.reconstructTagpublic void setOnChange(java.lang.String attribute)
HTMLTag.reconstructTag to true.
attribute - the new value for the HTML Tag ONCHANGE behaviorHTMLTag.reconstructTagpublic void setOnBeforeChange(java.lang.String attribute)
HTMLTag.reconstructTag to true.
attribute - the new value for the HTML Tag ONBEFORECHANGE behaviorHTMLTag.reconstructTagpublic void setOnAfterChange(java.lang.String attribute)
HTMLTag.reconstructTag to true.
attribute - the new value for the HTML Tag ONAFTERCHANGE behaviorHTMLTag.reconstructTag
public void setOptions(java.util.List list)
throws java.lang.ClassCastException
list is not null or empty, checks to make sure
that all elements of list are of type OptionTag.
If so, it first removes all previously existing options, updating the current option count to zero.
Then it adds the contents of the list argument to the list of options, in the same order as they appear in list.
If during this operation an element of list is found to not be of type OptionTag,
then the option list is purged and an exception is thrown.
list - the new list of options for this selection
java.lang.ClassCastException - If any elements of list are not of type OptionTag.
If this is found to be the case prior to attempting to add the list contents to this tag, then the original list of options is left unchanged.
If however this is found during updating the option list, then the entire list is purged.removeOptions(),
addOption(com.ge.research.html.OptionTag)public void setSize(int attribute)
HTMLTag.reconstructTag to true.
attribute - the new value for the HTML Tag SIZE attributeHTMLTag.reconstructTagprotected void resetTagSpecificInformation()
HTMLTagHTMLTag.reset().
This method is not implemented in HTMLTag.
Subclasses that contain tag content information should implement this method to set their information to their default values.
resetTagSpecificInformation in class HTMLTagHTMLTag.reset()protected void writeTagSpecificAttributes()
HTMLTagHTMLTag.toString().
This method is not implemented in HTMLTag.
Subclasses that contain additional attribute information should implement this method to write those attributes in the inline tag.
writeTagSpecificAttributes in class HTMLTagHTMLTag.toString()protected void writeTagSpecificData()
HTMLTagHTMLTag.toString().
This method is not implemented in HTMLTag.
Subclasses that contain tag content information should implement this method to writeout that content in between the opening and closing tags.
writeTagSpecificData in class HTMLTagHTMLTag.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||