nl.coderight.jazz.form.field.validatable
Class ValidatableField<V>

java.lang.Object
  extended by nl.coderight.jazz.form.FormField<V>
      extended by nl.coderight.jazz.form.field.validatable.ValidatableField<V>
All Implemented Interfaces:
Editable, Validation
Direct Known Subclasses:
InputField, PasswordField, SearchField

public abstract class ValidatableField<V>
extends FormField<V>
implements Validation, Editable

Base class for validatable fields.


Field Summary
 
Fields inherited from class nl.coderight.jazz.form.FormField
Config
 
Constructor Summary
ValidatableField()
           
 
Method Summary
protected  void checkIsRequired()
           
 ValidationError getError()
           
 Validator<V> getValidator()
           
 boolean isFocusable()
          Returns whether field is focusable.
 boolean isRequired()
           
 boolean isValid()
           
protected  void onFocusGained()
           
protected  void onFocusLost()
           
protected  void onValidate()
           
protected  void setFocusBorderVisible(boolean visible)
           
 void setRequired(boolean required)
           
 void setRequiredMessage(Message message)
          Sets the validation required message.
 void setToolTipText(String text)
          Sets field tooltip text.
 void setValidator(Validator<V> validator)
           
 void setValue(V value)
          Sets field value.
 void validate()
           
 
Methods inherited from class nl.coderight.jazz.form.FormField
dispatchEvent, dispose, focus, focusNextField, focusPreviousField, getBackground, getBindID, getBorder, getComponent, getCursor, getDataBinding, getForeground, getForm, getLabel, getParent, getPreferredSize, getToolTipText, getValue, hasFocus, isBindable, isChanged, isEnabled, isOpaque, isReadonly, isScrollable, isShowing, isValueChanged, isVisible, onChange, onClick, onDoubleClick, onMouseEnter, onMouseLeave, onPopup, registerKeyboardAction, setBackground, setBindID, setBorder, setChanged, setComponent, setCursor, setDataBinding, setEnabled, setFocusable, setForeground, setOnFocusGainedEvent, setOnFocusLostEvent, setOpaque, setPopupMenu, setPreferredSize, setReadonly, setVisible, translate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nl.coderight.jazz.form.editable.Editable
isEditable, setEditable
 

Constructor Detail

ValidatableField

public ValidatableField()
Method Detail

setValue

public void setValue(V value)
Description copied from class: FormField
Sets field value.

Overrides:
setValue in class FormField<V>

isValid

public final boolean isValid()
Specified by:
isValid in interface Validation

isRequired

public boolean isRequired()
Since:
1.4

setRequired

public void setRequired(boolean required)
Since:
1.4

setRequiredMessage

public void setRequiredMessage(Message message)
Sets the validation required message.

Since:
1.4

setToolTipText

public void setToolTipText(String text)
Description copied from class: FormField
Sets field tooltip text.

Overrides:
setToolTipText in class FormField<V>

getError

public final ValidationError getError()
Specified by:
getError in interface Validation

setValidator

public void setValidator(Validator<V> validator)

getValidator

public Validator<V> getValidator()

isFocusable

public boolean isFocusable()
Description copied from class: FormField
Returns whether field is focusable.

Overrides:
isFocusable in class FormField<V>

onFocusGained

protected void onFocusGained()
Overrides:
onFocusGained in class FormField<V>

onFocusLost

protected void onFocusLost()
Overrides:
onFocusLost in class FormField<V>

setFocusBorderVisible

protected void setFocusBorderVisible(boolean visible)

checkIsRequired

protected void checkIsRequired()
                        throws ValidationException
Throws:
ValidationException

validate

public void validate()
              throws ValidationException
Specified by:
validate in interface Validation
Throws:
ValidationException

onValidate

protected void onValidate()


Copyright 2010 CodeRight, All rights reserved.