jet.html.impl
Class JetOption

java.lang.Object
  extended by jet.html.core.JetComponent
      extended by jet.html.impl.JetOption
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Decodeable, JetComponent, JetOption

public class JetOption
extends JetComponent
implements JetOption

This class renders a html option

Author:
Markus.Meisters@web.de
See Also:
Serialized Form

Field Summary
private  boolean defaultselected
          indicates if the option is selected by default
private  boolean hidden
          indicates if the option is hidden
private  java.lang.String labelKey
          Holds the label text
private  JetSelection parent
          The parent object e.g. form/grid
private  boolean selected
          indicates if the option is selected
 
Fields inherited from class jet.html.core.JetComponent
eventSupport
 
Constructor Summary
JetOption(java.lang.String key, java.lang.String value, java.lang.String styleclass)
          Creates new Component
 
Method Summary
 java.lang.Object clone()
          This method generates a clone of the curent one
 void decodeForm(java.lang.StringBuilder builder, JetContext jetContext)
          This method decodes the form to the given buffer
 void encode()
          encodes if the option is selected
 java.lang.String getKey()
          Returns the key of the option
 java.lang.String getLabelKey()
          Returns the labelkey
 JetSelection getParent()
          Returns the parent object
 java.lang.String getValue()
          Returns the value/labelof the option
 boolean isDefaultselected()
          Returns if the option is default selected
 boolean isHidden()
          Returns the hidden status
 boolean isSelected()
          Indicates if the optio is selected
 void reset()
          Resets the object
 void setDefaultselected(boolean val)
          Set the default selected value
 void setDefaultSelected(java.lang.String val)
          Set the default selected value
 void setLabelKey(java.lang.String labelkey)
          Sets the label key
 void setParent(JetSelection parent)
          Set the parent object
 void setSelected(boolean selected)
          Set if the option is selected
 void toggleHidden()
          Switches the boolean value if the component should be hidden or not
 
Methods inherited from class jet.html.core.JetComponent
addListener, addListener, componentChanged, findComponent, findComponents, getGeneratedComponentIdentifier, getIdentifier, getName, getNewIdentifier, getStyleclass, incrementIdentifier, removeListener, removeListener, setComponentChanged, setContinueIdentifier, setIdentifier, setName, setStyleclass
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jet.html.JetComponent
addListener, addListener, componentChanged, findComponent, findComponents, getIdentifier, getName, getStyleclass, incrementIdentifier, removeListener, removeListener, setComponentChanged, setContinueIdentifier, setIdentifier, setName, setStyleclass
 

Field Detail

hidden

private boolean hidden
indicates if the option is hidden


selected

private boolean selected
indicates if the option is selected


defaultselected

private boolean defaultselected
indicates if the option is selected by default


labelKey

private java.lang.String labelKey
Holds the label text


parent

private JetSelection parent
The parent object e.g. form/grid

Constructor Detail

JetOption

public JetOption(java.lang.String key,
                 java.lang.String value,
                 java.lang.String styleclass)
Creates new Component

Parameters:
key - the identifier
value - teh value
Method Detail

decodeForm

public void decodeForm(java.lang.StringBuilder builder,
                       JetContext jetContext)
This method decodes the form to the given buffer

Specified by:
decodeForm in interface Decodeable
Specified by:
decodeForm in interface JetComponent
Specified by:
decodeForm in interface JetOption
Specified by:
decodeForm in class JetComponent
Parameters:
builder - builder to use

encode

public void encode()
encodes if the option is selected

Specified by:
encode in interface JetOption

getValue

public java.lang.String getValue()
Returns the value/labelof the option

Specified by:
getValue in interface JetOption
Returns:
String the value

setDefaultselected

public void setDefaultselected(boolean val)
Set the default selected value

Specified by:
setDefaultselected in interface JetOption

setDefaultSelected

public void setDefaultSelected(java.lang.String val)
Set the default selected value

Specified by:
setDefaultSelected in interface JetOption

isDefaultselected

public boolean isDefaultselected()
Returns if the option is default selected

Specified by:
isDefaultselected in interface JetOption

reset

public void reset()
Resets the object

Specified by:
reset in interface JetOption

clone

public java.lang.Object clone()
This method generates a clone of the curent one

Specified by:
clone in interface JetComponent
Specified by:
clone in interface JetOption
Specified by:
clone in class JetComponent
Returns:
Object the clone

getKey

public java.lang.String getKey()
Returns the key of the option

Specified by:
getKey in interface JetOption
Returns:
the option key

isSelected

public boolean isSelected()
Indicates if the optio is selected

Specified by:
isSelected in interface JetOption

setSelected

public void setSelected(boolean selected)
Set if the option is selected

Specified by:
setSelected in interface JetOption
Parameters:
selected - boolean if selected

getParent

public JetSelection getParent()
Returns the parent object

Specified by:
getParent in interface JetOption

setParent

public void setParent(JetSelection parent)
Set the parent object

Specified by:
setParent in interface JetOption
Parameters:
parent - the parent object

toggleHidden

public void toggleHidden()
Switches the boolean value if the component should be hidden or not

Specified by:
toggleHidden in interface JetComponent
Specified by:
toggleHidden in interface JetOption
Specified by:
toggleHidden in class JetComponent

isHidden

public boolean isHidden()
Returns the hidden status

Specified by:
isHidden in interface JetComponent
Specified by:
isHidden in interface JetOption
Specified by:
isHidden in class JetComponent
Returns:
boolean hidden flag

getLabelKey

public java.lang.String getLabelKey()
Returns the labelkey

Returns:
String label key

setLabelKey

public void setLabelKey(java.lang.String labelkey)
Sets the label key

Parameters:
labelkey -