jet.html.impl
Class JetButton

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.JetButton
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Decodeable, JetButton, JetChildComponent, JetComponent, JetInputComponent, Identifiable, Resetable, ValidationComponent

public class JetButton
extends JetInputComponent
implements JetButton

This class renders and decodes an submit 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  java.lang.String buttonType
          Holds the selected submit type
private  java.util.List<HTMLElementEvent> events
          events
private  java.lang.String messageKey
          Holds the message key to use for labeling the button
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
 
Fields inherited from interface jet.html.JetButton
BUTTON, IMAGE, JSUBMIT, RESET, SUBMIT
 
Constructor Summary
JetButton(java.lang.String identifier)
          Creates new Component - name and styleclass would be the same as identifier
JetButton(java.lang.String identifier, java.lang.String styleclass)
          Creates new Component - name would be the same as identifier
JetButton(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()
          Implementation of the clone method
 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.lang.String getButtonType()
          Returns the input type of the component
 java.util.List getEvents()
          Method to get events
 java.lang.String getMessageKey()
          Returns the message key for localizer file to use
 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
 void reset()
          jet.html.core.JetInputComponent#reset()
 void setButtonType(java.lang.String buttonType)
          Set the input type
 void setLabel(java.lang.String value)
          Set the label
 void setMessageKey(java.lang.String messageKey)
          Set the message key to use for labeling the button
 
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


buttonType

private java.lang.String buttonType
Holds the selected submit type


messageKey

private java.lang.String messageKey
Holds the message key to use for labeling the button

Constructor Detail

JetButton

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

Parameters:
identifier - the identifier

JetButton

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

Parameters:
identifier - the identifier
styleclass -

JetButton

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

Parameters:
identifier - the identifier
name -
styleclass -
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 JetButton
Specified by:
decodeForm in interface JetComponent
Specified by:
decodeForm in class JetComponent
Parameters:
builder - builder to use

decodeGetString

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

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

encode

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

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

getButtonType

public java.lang.String getButtonType()
Returns the input type of the component

Specified by:
getButtonType in interface JetButton
Returns:
the input type

setButtonType

public void setButtonType(java.lang.String buttonType)
Set the input type

Specified by:
setButtonType in interface JetButton
Parameters:
buttonType - the input type to use

clone

public java.lang.Object clone()
Implementation of the clone method

Specified by:
clone in interface JetButton
Specified by:
clone in interface JetComponent
Specified by:
clone in class JetComponent
Returns:
Obejct the clone of it

setLabel

public void setLabel(java.lang.String value)
Set the label

Specified by:
setLabel in interface JetButton
Parameters:
value - the label

addValidationRule

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

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

hasValidationRules

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

Specified by:
hasValidationRules in interface JetButton
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 JetButton
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 JetButton
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 JetButton
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 JetButton
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 JetButton
Specified by:
getEvents in interface JetInputComponent
Returns:
List HTMLElementEvent
See Also:
JetInputComponent.getEvents()

getMessageKey

public java.lang.String getMessageKey()
Returns the message key for localizer file to use

Specified by:
getMessageKey in interface JetButton
Returns:
String message key

setMessageKey

public void setMessageKey(java.lang.String messageKey)
Set the message key to use for labeling the button

Specified by:
setMessageKey in interface JetButton

reset

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

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