PAJES 3.0.21

org.pajes.html
Class Option

java.lang.Object
  extended by org.pajes.html.Tag
      extended by org.pajes.html.Option
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, HTML, OptionItem, TextContainer

public class Option
extends Tag
implements OptionItem, TextContainer

Generate the <option> tags to create list boxes and drop-down lists.

See Also:
Select, SelectList, Serialized Form

Field Summary
 
Fields inherited from class org.pajes.html.Tag
ON_CLICK_ATTRIBUTE, TAG_CLOSE, TAG_LEFT, TAG_RIGHT
 
Constructor Summary
Option(java.lang.String option)
          Creates an option item.
Option(java.lang.String option, java.lang.String value)
          Creates an option item.
Option(java.lang.String option, java.lang.String value, boolean selected)
          Creates an option item.
 
Method Summary
 java.lang.Object clone()
          Allows the option item to be cloned.
 java.lang.String getContainedText()
          Returns the text of this option item.
 java.lang.String getValue()
          Returns the value of this option item.
protected  void init()
          Called by the constructor and the Tag.destroy() method to correctly clear and initialise internal variables.
 boolean isSelected()
          Returns the selected status of this option.
 void setContent(java.lang.String content)
          Sets the text of this option item.
 Option setSelected(boolean selected)
          Sets this option item as the default selected item.
 Option setValue(java.lang.String value)
          Sets the value of this option item.
 
Methods inherited from class org.pajes.html.Tag
addAttribute, addAttributes, addAttributes, addContent, clearAttribute, clearAttributes, destroy, getAttribute, getAttributes, getAttributeSet, getContainer, getContent, getDocument, getId, getOnClickHandler, getOnDBLClickHandler, getOnKeyDownHandler, getOnKeyPressHandler, getOnKeyUpHandler, getOnMouseDownHandler, getOnMouseOutHandler, getOnMouseOverHandler, getOnMouseUpHandler, getParent, getStyle, getStyleSheetClass, getTagName, getTitle, getWritePermission, hasAttribute, initAttributes, isChildOf, isChildOf, isWritable, isWritable, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setAttributes, setContainer, setContent, setId, setOnClickHandler, setOnDBLClickHandler, setOnKeyDownHandler, setOnKeyPressHandler, setOnKeyUpHandler, setOnMouseDownHandler, setOnMouseOutHandler, setOnMouseOverHandler, setOnMouseUpHandler, setParent, setStyle, setStyleSheetClass, setTagName, setTitle, setWritable, setWriteAttributes, setWriteEndTag, setWritelnAfter, setWritelnAfterContent, setWritelnBefore, setWritelnBeforeContent, setWritePermission, toString, write, writeContent
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.pajes.html.HTML
addContent, destroy, getContainer, getDocument, getId, getParent, getWritePermission, isChildOf, isChildOf, setContainer, setParent, setWritePermission, write
 

Constructor Detail

Option

public Option(java.lang.String option)
Creates an option item.

Parameters:
option - the text of the option.

Option

public Option(java.lang.String option,
              java.lang.String value)
Creates an option item.

Parameters:
option - the text of the option.
value - the value to be returned when the option is selected.

Option

public Option(java.lang.String option,
              java.lang.String value,
              boolean selected)
Creates an option item.

Parameters:
option - the text of the option.
value - the value to be returned when the option is selected.
selected - set to true to make this the default option.
Method Detail

clone

public java.lang.Object clone()
Allows the option item to be cloned.

Specified by:
clone in interface HTML
Overrides:
clone in class Tag
Returns:
the cloned option item

getContainedText

public java.lang.String getContainedText()
Returns the text of this option item.

Specified by:
getContainedText in interface TextContainer
Returns:
the text of this option item.

getValue

public java.lang.String getValue()
Returns the value of this option item.

Returns:
the value of this option item.

isSelected

public boolean isSelected()
Returns the selected status of this option.

Returns:
true if this option is currently selected, or false if it is not.

setContent

public void setContent(java.lang.String content)
Sets the text of this option item.

Specified by:
setContent in interface HTML
Overrides:
setContent in class Tag
Parameters:
content - the content of this HTML tag.
See Also:
Tag.getContent(), Tag.setContent(org.pajes.html.HTML)

setSelected

public Option setSelected(boolean selected)
Sets this option item as the default selected item.

Parameters:
selected - true if this option is to be the default selected item.
Returns:
the modified Option object.

setValue

public Option setValue(java.lang.String value)
Sets the value of this option item.

Parameters:
value - the value of this option item.
Returns:
the modified Option object.

init

protected void init()
Called by the constructor and the Tag.destroy() method to correctly clear and initialise internal variables.

Overrides:
init in class Tag

PAJES 3.0.21

Copyright © 1998-2007 Viridian Pty Limited. All Rights Reserved.