jet.html.impl
Class JetCheckbox

java.lang.Object
  extended by jet.html.core.JetComponent
      extended by jet.html.core.JetChildComponent
          extended by jet.html.core.JetInputComponent
              extended by jet.html.impl.JetCheckbox
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Decodeable, JetCheckbox, JetChildComponent, JetComponent, JetInputComponent, Identifiable, Resetable, ValidationComponent
Direct Known Subclasses:
JetRadiobutton

public class JetCheckbox
extends JetInputComponent
implements JetCheckbox

This class renders and decodes an checkbox component

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

Nested Class Summary
 
Nested classes/interfaces inherited from interface jet.html.JetChildComponent
JetChildComponent.HasNoParent
 
Field Summary
private  boolean checked
          checked or not?
private  boolean defaultChecked
           
private  java.util.List<HTMLElementEvent> events
          events
private  java.lang.String sevents
          Holds the events already in rendered state
private  java.util.List<ValidationRule> validations
          validation rules
 
Fields inherited from class jet.html.core.JetComponent
eventSupport
 
Constructor Summary
JetCheckbox(java.lang.String identifier)
          Creates new Component - name and styleclass would be the same as identifier
JetCheckbox(java.lang.String identifier, java.lang.String styleclass)
          Creates new Component - name and styleclass would be the same as identifier
JetCheckbox(java.lang.String identifier, java.lang.String name, java.lang.String styleclass)
          Creates new Component
 
Method Summary
 void addEvent(HTMLElementEvent event)
          Method to add event
 void addValidationRule(ValidationRule rule)
          Method to add validation rules
 java.lang.Object clone()
          This method retruns a clone from the component
 void decodeForm(java.lang.StringBuilder builder, JetContext jetContext)
          This method decodes the form to the given buffer
 java.lang.String decodeGetString(JetContext jetContext)
          decodes the component to URL-STRING
 void encode(java.util.Map requestParameters)
          Encodes the needed parameteters
 java.util.List getEvents()
          Method to get events
 java.util.List getValidationRules()
          Returns only a cloned list of validations
 boolean hasEvent(HTMLElementEvent event)
          Method to indicate if aspecial event exist
 boolean hasEvents()
          Method to indicate if events exists
 boolean hasValidationRules()
          Method to indicate if validation exists
 boolean isChecked()
          Returns if the component is checked or not
 void reset()
          jet.html.core.JetInputComponent#reset()
 void setChecked(boolean checked)
          Set the checked boolean
 void setDefaultChecked(boolean defaultChecked)
          Set the default checked boolean
 void setDefaultChecked(java.lang.String defaultChecked)
          Set the devault checked boolean
 
Methods inherited from class jet.html.core.JetInputComponent
getDisplayValue, getFormDisplayValue, getValue, hasValue, setHidden, setValue
 
Methods inherited from class jet.html.core.JetChildComponent
getForm, getParent, isHidden, setParent, toggleHidden
 
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.JetInputComponent
getDisplayValue, getFormDisplayValue, getValue, hasValue, setHidden, setValue
 
Methods inherited from interface jet.html.JetChildComponent
getForm, getParent, isHidden, setParent, toggleHidden
 
Methods inherited from interface jet.html.JetComponent
addListener, addListener, componentChanged, findComponent, findComponents, getIdentifier, getName, getStyleclass, incrementIdentifier, removeListener, removeListener, setComponentChanged, setContinueIdentifier, setIdentifier, setName, setStyleclass
 
Methods inherited from interface jet.pool.Identifiable
getIdentifier
 

Field Detail

validations

private java.util.List<ValidationRule> validations
validation rules


events

private java.util.List<HTMLElementEvent> events
events


sevents

private java.lang.String sevents
Holds the events already in rendered state


checked

private boolean checked
checked or not?


defaultChecked

private boolean defaultChecked
Constructor Detail

JetCheckbox

public JetCheckbox(java.lang.String identifier)
Creates new Component - name and styleclass would be the same as identifier

Parameters:
identifier - the identifier

JetCheckbox

public JetCheckbox(java.lang.String identifier,
                   java.lang.String styleclass)
Creates new Component - name and styleclass would be the same as identifier

Parameters:
identifier - the identifier
styleclass - the css style class

JetCheckbox

public JetCheckbox(java.lang.String identifier,
                   java.lang.String name,
                   java.lang.String styleclass)
Creates new Component

Parameters:
identifier - the identifier
name - the name of the component if different to identifier
styleclass - the css style class
Method Detail

encode

public void encode(java.util.Map requestParameters)
Encodes the needed parameteters

Specified by:
encode in interface JetCheckbox
Specified by:
encode in interface JetInputComponent
Overrides:
encode in class JetInputComponent
Parameters:
requestParameters - request parameters

decodeGetString

public java.lang.String decodeGetString(JetContext jetContext)
                                 throws java.io.UnsupportedEncodingException
decodes the component to URL-STRING

Specified by:
decodeGetString in interface JetCheckbox
Specified by:
decodeGetString in interface JetInputComponent
Overrides:
decodeGetString in class JetInputComponent
Returns:
the rednered GET string
Throws:
java.io.UnsupportedEncodingException

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 JetCheckbox
Specified by:
decodeForm in interface JetComponent
Specified by:
decodeForm in class JetComponent
Parameters:
builder - builder to use

clone

public java.lang.Object clone()
This method retruns a clone from the component

Specified by:
clone in interface JetCheckbox
Specified by:
clone in interface JetComponent
Specified by:
clone in class JetComponent
Returns:
the cloned object

isChecked

public boolean isChecked()
Returns if the component is checked or not

Specified by:
isChecked in interface JetCheckbox
Returns:
boolean if checked

setChecked

public void setChecked(boolean checked)
Set the checked boolean

Specified by:
setChecked in interface JetCheckbox
Parameters:
checked - checked

setDefaultChecked

public void setDefaultChecked(boolean defaultChecked)
Set the default checked boolean

Specified by:
setDefaultChecked in interface JetCheckbox
Parameters:
defaultChecked - checked

setDefaultChecked

public void setDefaultChecked(java.lang.String defaultChecked)
Set the devault checked boolean

Specified by:
setDefaultChecked in interface JetCheckbox
Parameters:
defaultChecked - checked

addValidationRule

public void addValidationRule(ValidationRule rule)
Description copied from interface: ValidationComponent
Method to add validation rules

Specified by:
addValidationRule in interface JetCheckbox
Specified by:
addValidationRule in interface ValidationComponent
Parameters:
rule - ValidationRule
See Also:
ValidationComponent.addValidationRule( ValidationRule )

hasValidationRules

public boolean hasValidationRules()
Description copied from interface: ValidationComponent
Method to indicate if validation exists

Specified by:
hasValidationRules in interface JetCheckbox
Specified by:
hasValidationRules in interface ValidationComponent
See Also:
ValidationComponent.hasValidationRules( )

getValidationRules

public java.util.List getValidationRules()
Returns only a cloned list of validations

Specified by:
getValidationRules in interface JetCheckbox
Specified by:
getValidationRules in interface ValidationComponent
Returns:
List ValidationRules
See Also:
ValidationComponent.getValidationRules( )

addEvent

public void addEvent(HTMLElementEvent event)
Description copied from interface: JetInputComponent
Method to add event

Specified by:
addEvent in interface JetCheckbox
Specified by:
addEvent in interface JetInputComponent
Parameters:
event - event
See Also:
JetInputComponent.addEvent( jet.html.core.HTMLElementEvent )

hasEvents

public boolean hasEvents()
Description copied from interface: JetInputComponent
Method to indicate if events exists

Specified by:
hasEvents in interface JetCheckbox
Specified by:
hasEvents in interface JetInputComponent
See Also:
JetInputComponent.hasEvents()

hasEvent

public boolean hasEvent(HTMLElementEvent event)
Description copied from interface: JetInputComponent
Method to indicate if aspecial event exist

Specified by:
hasEvent in interface JetCheckbox
Specified by:
hasEvent in interface JetInputComponent
See Also:
JetInputComponent.hasEvent( jet.html.core.HTMLElementEvent )

getEvents

public java.util.List getEvents()
Description copied from interface: JetInputComponent
Method to get events

Specified by:
getEvents in interface JetCheckbox
Specified by:
getEvents in interface JetInputComponent
Returns:
List HTMLElementEvent
See Also:
JetInputComponent.getEvents()

reset

public void reset()
jet.html.core.JetInputComponent#reset()

Specified by:
reset in interface JetCheckbox
Specified by:
reset in interface JetInputComponent
Specified by:
reset in interface Resetable