com.qoppa.pdf.form
Interface ChoiceField

All Superinterfaces:
FormField
All Known Subinterfaces:
ComboField, ListField

public interface ChoiceField
extends FormField

ChoiceField is the abstract class to hold a choice field. A choice field contains several text items. ComboField and ListField extend this class.

Author:
Qoppa Software

Method Summary
 String getDefaultValue()
          Returns the default value for this field.
 Vector getDisplayOptions()
          Returns the list of display options (or items) for this field.
 String getDisplayValue(String exportValue)
          Returns the display value (or item) corresponding to a given export value.
 Vector getExportOptions()
          Returns the list of export options for this field.
 String getExportValue(String displayValue)
          Returns the export value corresponding to a given display value (or item).
 String getValue()
          Returns the current selected value.
 Vector getValues()
          Returns the current list of selected export values.
 boolean isCombo()
          Returns true if the choice field is a combo box field, false if it's a list field.
 boolean isEditable()
          Returns true if user is allowed to enter custom text, false if not.
 boolean isMultiSelect()
          Returns true if selection of multiple items is allowed, false if not.
 boolean isSpellCheck()
          Returns true if spelling should be checked on the custom values entered by user (@see isEditable()), false if not.
 void setDefaultValue(String defaultValue)
          Sets the default selected export value for this choice field.
 void setOptions(Vector exportOptions, Vector displayOptions)
          Set the list of options for this choice field.
 void setValue(String value)
          Sets the selected export value for this choice field.
 void setValues(Vector values)
          Sets the list of currently selected values for this choice field.
 
Methods inherited from interface com.qoppa.pdf.form.FormField
addFieldListener, addKeyListener, addMouseListener, flattenField, getAltFieldName, getFieldName, getFieldTypeDesc, getFullFieldName, getMapFieldName, getUserName, getWidgets, isNoExport, isReadOnly, isRequired, removeFieldListener, reset, setAltFieldName, setComponentVisible, setFieldFlags, setFieldName, setHidden, setMapFieldName, setNoExport, setPrintable, setReadOnly, setRequired, setUserName
 

Method Detail

getDefaultValue

public String getDefaultValue()
Returns the default value for this field.

Returns:
The default value

getDisplayOptions

public Vector getDisplayOptions()
Returns the list of display options (or items) for this field.

Returns:
The list of display options as a vector

getDisplayValue

public String getDisplayValue(String exportValue)
Returns the display value (or item) corresponding to a given export value.

Returns:
The display value

getExportOptions

public Vector getExportOptions()
Returns the list of export options for this field.

Returns:
The list of export options as a vector

getExportValue

public String getExportValue(String displayValue)
Returns the export value corresponding to a given display value (or item).

Returns:
The export value

getValues

public Vector getValues()
Returns the current list of selected export values.

Returns:
The list of selected export values as a vector

getValue

public String getValue()
Returns the current selected value. If this field allows multiple selection and there are more than one value selected, this method will return the first value selected.

Returns:
The selected export value

isCombo

public boolean isCombo()
Returns true if the choice field is a combo box field, false if it's a list field.

Returns:
true or false

isEditable

public boolean isEditable()
Returns true if user is allowed to enter custom text, false if not. This flag only applies to combo box fields, it doesn't apply to list fields.

Returns:
true or false

isMultiSelect

public boolean isMultiSelect()
Returns true if selection of multiple items is allowed, false if not.

Returns:
true or false

isSpellCheck

public boolean isSpellCheck()
Returns true if spelling should be checked on the custom values entered by user (@see isEditable()), false if not.

Returns:
true or false

setDefaultValue

public void setDefaultValue(String defaultValue)
Sets the default selected export value for this choice field.

Parameters:
defaultValue -

setOptions

public void setOptions(Vector exportOptions,
                       Vector displayOptions)
Set the list of options for this choice field. If the list of export optionsis left null, it will be defaulted to the list of display options. Similarly, if the list of display options if left null, it will be defaulted to the list of export options.

Parameters:
exportOptions - the list of export options
displayOptions - the list of items or display options.

setValue

public void setValue(String value)
              throws PDFException
Sets the selected export value for this choice field.

Parameters:
value -
Throws:
PDFException

setValues

public void setValues(Vector values)
               throws PDFException
Sets the list of currently selected values for this choice field.

Parameters:
values - List of selected export values as a vector
Throws:
PDFException