nl.coderight.jazz.form
Class FormField<V>

java.lang.Object
  extended by nl.coderight.jazz.form.FormField<V>
Direct Known Subclasses:
CalendarField, DateSpinnerField, DisplayField, FormControl, HyperlinkField, LabelField, NumberSpinnerField, ProgressField, PushButton, SliderField, TimeSpinnerField, ValidatableField

public abstract class FormField<V>
extends Object

Base class for form fields.


Field Summary
protected static JazzConfig Config
           
 
Constructor Summary
FormField()
           
 
Method Summary
protected  void dispatchEvent(Event event)
           
protected  void dispose()
          Use this to cleanup any resources.
 void focus()
          Sets focus to field.
 void focusNextField()
          Sets focus to next field.
 void focusPreviousField()
          Sets focus to previous field.
 Color getBackground()
          Return field background color.
 String getBindID()
          Returns bindID.
 Border getBorder()
          Returns field border.
 JComponent getComponent()
           
 Cursor getCursor()
          Returns cursor.
protected  DataBinding<V> getDataBinding()
           
 Color getForeground()
          Returns field foreground color.
protected  FormView getForm()
           
 LabelField getLabel()
          Returns the LabelField for this field.
protected  FormControl getParent()
           
 Dimension getPreferredSize()
          Returns field preferred size.
 String getToolTip()
          Returns field tooltip text.
 V getValue()
          Returns field value.
 boolean hasFocus()
           
 boolean isBindable()
          Returns whether field is bindable.
 boolean isChanged()
          Returns whether field value is changed.
 boolean isEnabled()
          Return whether field is enabled.
 boolean isFocusable()
          Returns whether field is focusable.
 boolean isOpaque()
          Returns whether field is opaque.
 boolean isReadonly()
          Returns whether field is read only, bind value is read but not stored (submit).
 boolean isShowing()
          Returns whether field is visible (on screen).
protected  boolean isValueChanged(V newValue)
           
 boolean isVisible()
          Returns whether field is visible.
protected  void onChange()
           
protected  void onClick()
           
protected  void onDoubleClick()
           
protected  void onFocusGained()
           
protected  void onFocusLost()
           
protected  void onMouseEnter()
           
protected  void onMouseLeave()
           
protected  void onPopup(Point point)
           
 void registerKeyboardAction(Action action)
          Provides keyboard bindings for Actions.
 void setBackground(Color color)
          Sets field background color.
protected  void setBindID(String bindID)
           
 void setBorder(Border border)
          Sets field border.
protected  void setChanged(boolean changed)
           
protected  void setComponent(JComponent component)
           
 void setCursor(Cursor cursor)
          Sets cursor.
protected  void setDataBinding(DataBinding<V> binding)
           
 void setEnabled(boolean enabled)
          Sets whether field is enabled.
 void setFocusable(boolean focusable)
          Sets whether field is focusable.
 void setForeground(Color color)
          Sets field foreground color.
 void setOnFocusGainedEvent(Event onfocusGainedEvent)
          Sets field onfocusGainedEvent.
 void setOnFocusLostEvent(Event onfocusLostEvent)
          Sets field onfocusLostEvent.
 void setOpaque(boolean opaque)
          Sets whether field is opaque.
 void setPopupMenu(PopupMenu popup)
          Sets field popup menu.
 void setPreferredSize(Dimension size)
          Sets field preferred size.
 void setReadonly(boolean readonly)
          Sets whether field is readonly.
 void setToolTip(String text)
          Sets field tooltip text.
 void setValue(V value)
          Sets field value.
 void setVisible(boolean visible)
          Sets whether field is visible.
protected  String translate(String key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Config

protected static JazzConfig Config
Constructor Detail

FormField

public FormField()
Method Detail

setComponent

protected void setComponent(JComponent component)

getComponent

public JComponent getComponent()

getParent

protected final FormControl getParent()

getForm

protected final FormView getForm()

setPopupMenu

public void setPopupMenu(PopupMenu popup)
Sets field popup menu.


getDataBinding

protected DataBinding<V> getDataBinding()

setDataBinding

protected void setDataBinding(DataBinding<V> binding)

isBindable

public boolean isBindable()
Returns whether field is bindable.


getBindID

public String getBindID()
Returns bindID.


setBindID

protected void setBindID(String bindID)

getValue

public V getValue()
Returns field value.


setValue

public void setValue(V value)
Sets field value.


isValueChanged

protected boolean isValueChanged(V newValue)

setChanged

protected void setChanged(boolean changed)

isChanged

public boolean isChanged()
Returns whether field value is changed.

Returns:
boolean (true is changed)

isReadonly

public boolean isReadonly()
Returns whether field is read only, bind value is read but not stored (submit).


setReadonly

public void setReadonly(boolean readonly)
Sets whether field is readonly.


translate

protected String translate(String key)

hasFocus

public boolean hasFocus()

focus

public void focus()
Sets focus to field.


focusNextField

public void focusNextField()
Sets focus to next field.


focusPreviousField

public void focusPreviousField()
Sets focus to previous field.


isFocusable

public boolean isFocusable()
Returns whether field is focusable.


setFocusable

public void setFocusable(boolean focusable)
Sets whether field is focusable.


isEnabled

public boolean isEnabled()
Return whether field is enabled.


setEnabled

public void setEnabled(boolean enabled)
Sets whether field is enabled.


getBorder

public Border getBorder()
Returns field border.


setBorder

public void setBorder(Border border)
Sets field border.


getCursor

public Cursor getCursor()
Returns cursor.


setCursor

public void setCursor(Cursor cursor)
Sets cursor.


isOpaque

public boolean isOpaque()
Returns whether field is opaque.


setOpaque

public void setOpaque(boolean opaque)
Sets whether field is opaque.


getToolTip

public String getToolTip()
Returns field tooltip text.


setToolTip

public void setToolTip(String text)
Sets field tooltip text.


getPreferredSize

public Dimension getPreferredSize()
Returns field preferred size.


setPreferredSize

public void setPreferredSize(Dimension size)
Sets field preferred size.


getBackground

public Color getBackground()
Return field background color.


setBackground

public void setBackground(Color color)
Sets field background color.


getForeground

public Color getForeground()
Returns field foreground color.


setForeground

public void setForeground(Color color)
Sets field foreground color.


isVisible

public boolean isVisible()
Returns whether field is visible.

Returns:
boolean (true is visible)

setVisible

public void setVisible(boolean visible)
Sets whether field is visible.


isShowing

public boolean isShowing()
Returns whether field is visible (on screen).

Returns:
boolean (true is visible)

getLabel

public LabelField getLabel()
Returns the LabelField for this field.


setOnFocusGainedEvent

public void setOnFocusGainedEvent(Event onfocusGainedEvent)
Sets field onfocusGainedEvent.


setOnFocusLostEvent

public void setOnFocusLostEvent(Event onfocusLostEvent)
Sets field onfocusLostEvent.


onPopup

protected void onPopup(Point point)

onFocusGained

protected void onFocusGained()

onFocusLost

protected void onFocusLost()

onChange

protected void onChange()

onClick

protected void onClick()

onDoubleClick

protected void onDoubleClick()

onMouseEnter

protected void onMouseEnter()

onMouseLeave

protected void onMouseLeave()

dispatchEvent

protected void dispatchEvent(Event event)

dispose

protected void dispose()
Use this to cleanup any resources.


registerKeyboardAction

public void registerKeyboardAction(Action action)
Provides keyboard bindings for Actions.

Performs the Action Event when the accelerator key is pressed.



Copyright 2010 CodeRight, All rights reserved.