com.qoppa.pdf.form
Interface FormField

All Known Subinterfaces:
CheckBoxField, ChoiceField, ComboField, ListField, PushButtonField, RadioButtonGroupField, SignatureField, TextField

public interface FormField

FormField is the abstract class that is being extended by all fields such as CheckBoxField, ChoiceField, ComboField, PushButtonField, RadioButtonGroupField, SignatureField and TextField.

Author:
Qoppa Software

Method Summary
 void addFieldListener(FieldListener list)
          Adds a field listener to this field.
 void addKeyListener(KeyListener list)
          Adds a key listener to this field.
 void addMouseListener(MouseListener list)
          Adds a mouse listener to this field.
 void flattenField()
          Flattens the field into the document's content layer.
 String getAltFieldName()
          Returns the alternate field name for this field.
 String getFieldName()
          Returns the name of this field.
 String getFieldTypeDesc()
          Returns a description of the field type.
 String getFullFieldName()
          Returns the full name of the fields.
 String getMapFieldName()
          Returns this field's mapping name.
 String getUserName()
          Gets this field's user name.
 Vector getWidgets()
          Gets a list of any widgets associated with this field.
 boolean isNoExport()
          Returns the value of the 'No Export' flag.
 boolean isReadOnly()
          Returns the value of the 'Read Only' flag.
 boolean isRequired()
          Returns the value of the 'Required' flag.
 void removeFieldListener(FieldListener list)
          Removes a field listener from this field.
 void reset()
          Resets the field to its default value.
 void setAltFieldName(String altFieldName)
          Sets the alternate field name.
 void setComponentVisible(boolean visible)
          Sets the visibility of the component(s) associated with this field on the screen.
 void setFieldFlags(int fieldFlags)
          Sets the field flags.
 void setFieldName(String fieldName)
          Sets the field name.
 void setHidden(boolean hidden)
          Sets the HIDDEN flag.
 void setMapFieldName(String mapName)
          Sets this field's mapping name.
 void setNoExport(boolean noExport)
          Sets the 'No Export' flag.
 void setPrintable(boolean printable)
          Sets the PRINTABLE flag for this field.
 void setReadOnly(boolean readOnly)
          Sets the value of the 'Read Only' flag.
 void setRequired(boolean required)
          Sets the value of the 'Required' flag.
 void setUserName(String userName)
          Sets this field's user name.
 

Method Detail

getAltFieldName

public String getAltFieldName()
Returns the alternate field name for this field.

Returns:
The alternate field name.

getFieldName

public String getFieldName()
Returns the name of this field.

Returns:
The field's name.

getFieldTypeDesc

public String getFieldTypeDesc()
Returns a description of the field type. "CheckBox" for CheckBoxField "ComboBox" for ComboBoxField "List" for ListField "PushButton" for PushButtonField "RadioButtonGroup" for RadioButtonGroupField "Signature" for SignatureField "TextField" for TextField

Returns:
A string describing the field type.

getFullFieldName

public String getFullFieldName()
Returns the full name of the fields. If the field is hierarchical, the name will include the full path to the top parent. For instance "address.line1"

Returns:
The fully qualified field name.

getMapFieldName

public String getMapFieldName()
Returns this field's mapping name.

Returns:
The field's mapping name.

getUserName

public String getUserName()
Gets this field's user name.

Returns:
The field's user name.

isNoExport

public boolean isNoExport()
Returns the value of the 'No Export' flag.

Returns:
Value of the 'No Export' flag.

isReadOnly

public boolean isReadOnly()
Returns the value of the 'Read Only' flag.

Returns:
The value of the 'Read Only' flag.

isRequired

public boolean isRequired()
Returns the value of the 'Required' flag.

Returns:
The value of the 'Required' flag.

reset

public void reset()
           throws PDFException
Resets the field to its default value. If there is no default value then the value will be set to null.

Throws:
PDFException

setAltFieldName

public void setAltFieldName(String altFieldName)
Sets the alternate field name.

Parameters:
altFieldName - The new alternate field name.

setFieldFlags

public void setFieldFlags(int fieldFlags)
Sets the field flags. The field flags are an or'ed combination of the following values:
FF_READONLY
FF_REQUIRED
FF_NOEXPORT

Parameters:
fieldFlags - The new value for the flags.

setFieldName

public void setFieldName(String fieldName)
Sets the field name.

Parameters:
fieldName - The new field name.

setMapFieldName

public void setMapFieldName(String mapName)
Sets this field's mapping name.

Parameters:
mapName - The new mapping name.

setNoExport

public void setNoExport(boolean noExport)
Sets the 'No Export' flag. If this flag is set, the field value will not be exported to an external file.

Parameters:
noExport - The new value of the 'No Export' flag.

setReadOnly

public void setReadOnly(boolean readOnly)
Sets the value of the 'Read Only' flag. If this value is set, the fields value may not be changed.

Parameters:
readOnly - The new value of the 'Read Only' flag.

setRequired

public void setRequired(boolean required)
Sets the value of the 'Required' flag. If this flag is set, the value in this field is a required value.

Parameters:
required - The new value of the 'Required' flag.

setUserName

public void setUserName(String userName)
Sets this field's user name.

Parameters:
userName - The new user name.

setPrintable

public void setPrintable(boolean printable)
Sets the PRINTABLE flag for this field. A hidden field will not be displayed on the screen and will not print.

Parameters:
printable - the new invisible setting.

setHidden

public void setHidden(boolean hidden)
Sets the HIDDEN flag. A hidden field will not be displayed on the screen and will not print.

Parameters:
hidden - the new hidden setting. True to hide, false to show the field.

setComponentVisible

public void setComponentVisible(boolean visible)
Sets the visibility of the component(s) associated with this field on the screen. This method should be used when component visibility needs to be changed temporarily on the screen. To hide the field definitively, use the setHidden method that will set the hidden flag in the document.

Parameters:
visible - The new value of the components visibility.

getWidgets

public Vector getWidgets()
Gets a list of any widgets associated with this field. A field can have several widgets (components) that display or interact with its values, so the return value for this method is a Vector. The objects in the Vector are all derived from com.qoppa.pdf.annotations.Widget Note that these widgets are not accessible from jPDFViewerBean.

Returns:
List of widgets for this field.

addFieldListener

public void addFieldListener(FieldListener list)
Adds a field listener to this field.

Parameters:
list - An object that implements FieldListener.

addMouseListener

public void addMouseListener(MouseListener list)
Adds a mouse listener to this field. This will add a mouse listener to all the field's widgets but not to the widget's editing component. This means that events will not be generated when the field is in edit mode.

Parameters:
list - An object that implements MouseListener.

addKeyListener

public void addKeyListener(KeyListener list)
Adds a key listener to this field. This will add a key listener to all the field's widgets but not to the widget's editing component. This means that events will not be generated when the field is in edit mode.

Parameters:
list - An object that implements KeyListener

removeFieldListener

public void removeFieldListener(FieldListener list)
Removes a field listener from this field.

Parameters:
list - The listener to remove.

flattenField

public void flattenField()
                  throws PDFException
Flattens the field into the document's content layer. This method only works when the document is a mutable document, such as within the jPDFNotes or jPDFProcess libraries.

Throws:
PDFException