com.partnersoft.gui.forms
Class AbstractFormField<T>

java.lang.Object
  extended by com.partnersoft.gui.forms.AbstractFormField<T>
Type Parameters:
T - type of value the form edits
All Implemented Interfaces:
FormField<T>
Direct Known Subclasses:
AbstractFormTextField, FormCheckboxField, FormCogFilterField, FormColorField, FormComboField, FormDatabaseField, FormDateField, FormDirectionField, FormFilePathField, FormFilePathListField, FormIconField, FormIconPicklistField, FormNamedBlobField, FormPasswordField, FormPicklistField, FormReadOnlyStringField, FormTextField

public abstract class AbstractFormField<T>
extends java.lang.Object
implements FormField<T>

Starter implementation of FormField. Has a protected gui variable to provide getGui(), and provides do-nothing implementations of valueChanged(T) and doAction().

Copyright 2008 Partner Software, Inc.

Version:
$Id$
Author:
Paul Reavis

Field Summary
protected  javax.swing.JComponent gui
           
 
Constructor Summary
AbstractFormField()
           
 
Method Summary
 void addFieldListener(FormFieldListener nosey)
          Add a listener for value change and action events.
 void doAction()
          This does different things depending on the field; for example in a text field it indicates return was hit.
protected  void fireActionRequested()
           
protected  void fireValueChanged()
           
 javax.swing.JComponent getGui()
          Returns the GUI component for this field.
 boolean isDisabled()
           
 void removeFieldListener(FormFieldListener nosey)
          Remove a listener for value change and action events.
 void setDisabled(boolean disabled)
          If true, disables the form (no input allowed).
 void setToolTipText(java.lang.String newText)
          Sets the tool-tip text for the field.
 void valueChanged(T newValue)
          When the value changes, this is run.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.partnersoft.gui.forms.FormField
getValue, setValue
 

Field Detail

gui

protected javax.swing.JComponent gui
Constructor Detail

AbstractFormField

public AbstractFormField()
Method Detail

getGui

public javax.swing.JComponent getGui()
Description copied from interface: FormField
Returns the GUI component for this field. Implementations should also consider providing a type-specific accessor, e.g. getJTextArea().

Specified by:
getGui in interface FormField<T>

valueChanged

public void valueChanged(T newValue)
Description copied from interface: FormField
When the value changes, this is run. Use as a more convenient form of event handling.

Specified by:
valueChanged in interface FormField<T>

doAction

public void doAction()
Description copied from interface: FormField
This does different things depending on the field; for example in a text field it indicates return was hit.

Specified by:
doAction in interface FormField<T>

setToolTipText

public void setToolTipText(java.lang.String newText)
Description copied from interface: FormField
Sets the tool-tip text for the field. This is the floaty bit of description that you see if you're smart enough or slow enough to leave the mouse hovered over the field.

Specified by:
setToolTipText in interface FormField<T>

addFieldListener

public void addFieldListener(FormFieldListener nosey)
Description copied from interface: FormField
Add a listener for value change and action events.

Specified by:
addFieldListener in interface FormField<T>
Parameters:
nosey - the interested party

removeFieldListener

public void removeFieldListener(FormFieldListener nosey)
Description copied from interface: FormField
Remove a listener for value change and action events.

Specified by:
removeFieldListener in interface FormField<T>
Parameters:
nosey - the interested party

setDisabled

public void setDisabled(boolean disabled)
If true, disables the form (no input allowed). Default is enabled.

Specified by:
setDisabled in interface FormField<T>

isDisabled

public boolean isDisabled()
Specified by:
isDisabled in interface FormField<T>

fireValueChanged

protected void fireValueChanged()

fireActionRequested

protected void fireActionRequested()