PAJES 3.0.21

org.pajes.html
Class OptionGroup

java.lang.Object
  extended by org.pajes.html.Tag
      extended by org.pajes.html.TraversableElement
          extended by org.pajes.html.Container
              extended by org.pajes.html.OptionGroup
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, HTML, OptionItem, Traversable

public class OptionGroup
extends Container
implements OptionItem

Generate the <OPTGROUP> 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
OptionGroup(java.lang.String label)
          Creates an option group.
 
Method Summary
 Traversable add(HTML option)
          Over-rides Container.add(HTML) to prevent anything except Options being added to the Option Group.
 OptionGroup clearDefaultValues()
          Clears the default selected values for the list.
 java.lang.Object clone()
          Allows a tag to be cloned.
 boolean contains(java.lang.String value)
          Determines if the specified value exists in this option group.
 java.lang.String getLabel()
          Returns the group label.
 java.lang.String[] getSelectedOptions()
          Returns an array of the currently selected options.
 void setContent(java.lang.String content)
          Adds the specified String as a new Option within this group.
 OptionGroup setLabel(java.lang.String label)
          Sets the group label.
 
Methods inherited from class org.pajes.html.Container
add, add, add, addContent, clear, delete, delete, destroy, get, getContent, getContents, getPosition, insert, replace, set, setContent, size, writeContent
 
Methods inherited from class org.pajes.html.TraversableElement
dump, dump, getAll, getFieldByName, getFirstFieldByName, getFirstTagByAttribute, getFirstTagByClass, getFirstTagByID, getFirstTagByName, getTagByAttribute, getTagByClass, getTagByID, getTagByName, setWritable
 
Methods inherited from class org.pajes.html.Tag
addAttribute, addAttributes, addAttributes, clearAttribute, clearAttributes, getAttribute, getAttributes, getAttributeSet, getContainer, getDocument, getId, getOnClickHandler, getOnDBLClickHandler, getOnKeyDownHandler, getOnKeyPressHandler, getOnKeyUpHandler, getOnMouseDownHandler, getOnMouseOutHandler, getOnMouseOverHandler, getOnMouseUpHandler, getParent, getStyle, getStyleSheetClass, getTagName, getTitle, getWritePermission, hasAttribute, init, initAttributes, isChildOf, isChildOf, isWritable, isWritable, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setAttributes, setContainer, 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
 
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
 
Methods inherited from interface org.pajes.html.Traversable
isWritable
 

Constructor Detail

OptionGroup

public OptionGroup(java.lang.String label)
Creates an option group.

Parameters:
label - the group label.
Method Detail

add

public Traversable add(HTML option)
Over-rides Container.add(HTML) to prevent anything except Options being added to the Option Group.

Specified by:
add in interface Traversable
Overrides:
add in class Container
Parameters:
option - The option to be added.
Returns:
The modified Container instance.
Throws:
TagException - if anything except an Option is added to the group.

clearDefaultValues

public OptionGroup clearDefaultValues()
Clears the default selected values for the list.

Returns:
the modified OptionGroup object.

clone

public java.lang.Object clone()
Allows a tag to be cloned. Over-rides the clone() method in Tag to do a deep clone: all the objects contained in this object will be cloned individually.

Specified by:
clone in interface HTML
Overrides:
clone in class Container
Returns:
The new OptionGroup instance.

contains

public boolean contains(java.lang.String value)
Determines if the specified value exists in this option group.

Parameters:
value - the option value.
Returns:
true if an option exists in this group with the specified value.

getLabel

public java.lang.String getLabel()
Returns the group label.

Returns:
the group label.

getSelectedOptions

public java.lang.String[] getSelectedOptions()
Returns an array of the currently selected options.

Returns:
an array of the currently selected options.

setContent

public void setContent(java.lang.String content)
Adds the specified String as a new Option within this group.

Specified by:
setContent in interface HTML
Overrides:
setContent in class Container
Parameters:
content - the text of the Option.
See Also:
Container.clear(), Container.add(java.lang.String), Container.getContent()

setLabel

public OptionGroup setLabel(java.lang.String label)
Sets the group label.

Parameters:
label - the group label.
Returns:
the modified OptionGroup instance.

PAJES 3.0.21

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