com.arsdigita.bebop.form
Class Option

java.lang.Object
  extended bycom.arsdigita.bebop.Completable
      extended bycom.arsdigita.bebop.SimpleComponent
          extended bycom.arsdigita.bebop.TextStylable
              extended bycom.arsdigita.bebop.BlockStylable
                  extended bycom.arsdigita.bebop.form.Option
All Implemented Interfaces:
Cloneable, Component, Lockable

public class Option
extends BlockStylable

A class representing an option of a widget.

Author:
Rory Solomon, Michael Pih $Id: //core-platform/dev/src/com/arsdigita/bebop/form/Option.java#9 $

Field Summary
static String versionId
           
 
Fields inherited from class com.arsdigita.bebop.BlockStylable
ABSBOTTOM, ABSMIDDLE, BASELINE, BOTTOM, CENTER, FULL_WIDTH, INSERT, LEFT, MIDDLE, RIGHT, TEXTTOP, TOP
 
Fields inherited from class com.arsdigita.bebop.SimpleComponent
m_attr
 
Fields inherited from interface com.arsdigita.bebop.Component
BEBOP_XML_NS, CLASS, ID, ON_CLICK, STYLE
 
Constructor Summary
Option(String label)
           
Option(String value, Component component)
           
Option(String value, String label)
          This creates an Option whose component is a lable consisting of the string that is passed in.
 
Method Summary
 void generateXML(PageState s, Element e)
          Generate XML depending on what OptionGroup we belong to.
 Component getComponent()
           
 OptionGroup getGroup()
           
 String getLabel()
          If the component is a Label (which most of the time it is) then this returns the value of the label.
 String getName()
           
 String getValue()
           
 boolean isSelected(ParameterData data)
           
 void setComponent(Component component)
           
 void setGroup(OptionGroup group)
           
 void setLabel(Label label)
          Deprecated. Use setComponent(Component component) instead
 void setLabel(String label)
          This sets the component to the label consisting of the passed in string
 void setOnBlur(String javascriptCode)
          Sets the ONBLUR attribute for the HTML tags that compose this element.
 void setOnChange(String javascriptCode)
          Sets the ONCHANGE attribute for the HTML tags that compose this element.
 void setOnClick(String javascriptCode)
          Sets the ONCLICK attribute for the HTML tags that compose this element.
 void setOnFocus(String javascriptCode)
          Sets the ONFOCUS attribute for the HTML tags that compose this element.
 void setOnKeyUp(String javascriptCode)
          Sets the ON_KEY_UP attribute for the HTML tags that compose this element.
 void setOnSelect(String javascriptCode)
          Sets the ONSELECT attribute for the HTML tags that compose this element.
 void setValue(String value)
           
 
Methods inherited from class com.arsdigita.bebop.BlockStylable
setBorder, setBorder, setBorderColor, setHorizontalAlignment, setMargin, setMargin, setPadding, setPadding, setVerticalAlignment
 
Methods inherited from class com.arsdigita.bebop.TextStylable
setBackgroundColor, setColor
 
Methods inherited from class com.arsdigita.bebop.SimpleComponent
children, clone, exportAttributes, getAttribute, getClassAttr, getIdAttr, getKey, getMetaDataAttribute, getStyleAttr, hasAttributes, isLocked, isVisible, lock, register, register, respond, setAttribute, setClassAttr, setIdAttr, setKey, setMetaDataAttribute, setStyleAttr, setVisible
 
Methods inherited from class com.arsdigita.bebop.Completable
addCompletionListener, fireCompletionEvent
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values
Constructor Detail

Option

public Option(String label)

Option

public Option(String value,
              String label)
This creates an Option whose component is a lable consisting of the string that is passed in.


Option

public Option(String value,
              Component component)
Method Detail

getName

public String getName()

getLabel

public final String getLabel()
If the component is a Label (which most of the time it is) then this returns the value of the label. This assumes that the Component is a lable

Throws:
ClassCastException - is thrown if the component is not a label

setLabel

public final void setLabel(String label)
This sets the component to the label consisting of the passed in string


setLabel

public final void setLabel(Label label)
Deprecated. Use setComponent(Component component) instead


setComponent

public final void setComponent(Component component)

getComponent

public final Component getComponent()

setGroup

public final void setGroup(OptionGroup group)

getGroup

public final OptionGroup getGroup()

getValue

public final String getValue()

setValue

public final void setValue(String value)

setOnFocus

public void setOnFocus(String javascriptCode)
Sets the ONFOCUS attribute for the HTML tags that compose this element.


setOnBlur

public void setOnBlur(String javascriptCode)
Sets the ONBLUR attribute for the HTML tags that compose this element.


setOnSelect

public void setOnSelect(String javascriptCode)
Sets the ONSELECT attribute for the HTML tags that compose this element.


setOnChange

public void setOnChange(String javascriptCode)
Sets the ONCHANGE attribute for the HTML tags that compose this element.


setOnKeyUp

public void setOnKeyUp(String javascriptCode)
Sets the ON_KEY_UP attribute for the HTML tags that compose this element.


setOnClick

public void setOnClick(String javascriptCode)
Sets the ONCLICK attribute for the HTML tags that compose this element.


isSelected

public boolean isSelected(ParameterData data)

generateXML

public void generateXML(PageState s,
                        Element e)
Generate XML depending on what OptionGroup we belong to.

Specified by:
generateXML in interface Component
Overrides:
generateXML in class SimpleComponent


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC