com.crionics.jpdf.forms
Class AbstractChoiceField

java.lang.Object
  extended by PdfObjectContainer
      extended by com.crionics.jpdf.forms.AbstractField
          extended by com.crionics.jpdf.forms.AbstractChoiceField
Direct Known Subclasses:
ComboBoxField, ListBoxField

public abstract class AbstractChoiceField
extends AbstractField

Methods common to all choice fields. Choice fields can get/set multiple selections.


Method Summary
 ChoiceEntry[] getDefaultValue()
          Returns the default value of this Field. listbox can have several entries
 ChoiceEntry[] getPossibleValues()
          Recover the possible values which can be used by this choice. the list is ordered as it shows on the screen.
 ChoiceEntry[] getValue()
          Returns the Form Field value.
 boolean isSorted()
          Returns the current status of the sorting flag.
 void setDefaultValue(ChoiceEntry entry)
           
 void setDefaultValue(ChoiceEntry[] entries)
          Sets the default value of this Field.
 void setPossibleValues(ChoiceEntry[] entries)
          Update the list of Values available for the ListBox.
 void setSorted(boolean flag)
          Set/Clear the Sorting Flag of this Field.
 void setValue(ChoiceEntry entry)
           
 void setValue(ChoiceEntry[] entries)
          Set the current value of this Field.
 
Methods inherited from class com.crionics.jpdf.forms.AbstractField
getAssociatedPageIndex, getBorderColor, getBorderStyle, getBorderWidth, getFillColor, getName, getOrientation, getPosition, getTextColor, getTextFont, getTextSize, getToolTip, isHidden, isPrintable, isReadOnly, setBorderColor, setBorderStyle, setBorderWidth, setFillColor, setHidden, setOrientation, setPosition, setPrintable, setReadOnly, setTextColor, setTextFont, setTextFont, setTextSize, setToolTip
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDefaultValue

public ChoiceEntry[] getDefaultValue()
                              throws PdfException,
                                     java.io.IOException
Returns the default value of this Field. listbox can have several entries

Returns:
The default Value of this field or null is no value was defined
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.

getPossibleValues

public ChoiceEntry[] getPossibleValues()
                                throws PdfException,
                                       java.io.IOException
Recover the possible values which can be used by this choice. the list is ordered as it shows on the screen.

Returns:
The entries used to represent the values in a PDF Viewer application, or null if there are no predefined values
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.

getValue

public ChoiceEntry[] getValue()
                       throws PdfException,
                              java.io.IOException
Returns the Form Field value.

Returns:
The Form Field value or null.
Throws:
PdfException - Raised if a problem occured while parsing the file.
java.io.IOException - Raised if a problem occured while reading the file.

isSorted

public boolean isSorted()
Returns the current status of the sorting flag.
Note:
If the Sorting Flag is set, the Values List of the ListBox will only be sorted when changed, not when read.

Returns:
true it the Flag is set, false otherwise.

setDefaultValue

public void setDefaultValue(ChoiceEntry entry)
                     throws PdfException,
                            java.io.IOException
Throws:
PdfException
java.io.IOException

setDefaultValue

public void setDefaultValue(ChoiceEntry[] entries)
                     throws PdfException,
                            java.io.IOException
Sets the default value of this Field.

Parameters:
entries - The Default String Value of this Field.
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.

setPossibleValues

public void setPossibleValues(ChoiceEntry[] entries)
                       throws PdfException,
                              java.io.IOException
Update the list of Values available for the ListBox.
Note:
If the Sort Flag is set, the values (and displays) will be sorted prior to be written in the Field.
The field Value and DefaultValue are automatically cleaned when this method is called.

Parameters:
entries - The entries to set in the choice list
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.

setSorted

public void setSorted(boolean flag)
               throws PdfException,
                      java.io.IOException
Set/Clear the Sorting Flag of this Field.
If this flag is set, all the current entries of this Field will be sorted and saved.

Parameters:
flag - true to activate it, false otherwise.
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.

setValue

public void setValue(ChoiceEntry entry)
              throws PdfException,
                     java.io.IOException
Throws:
PdfException
java.io.IOException

setValue

public void setValue(ChoiceEntry[] entries)
              throws PdfException,
                     java.io.IOException
Set the current value of this Field.
Note: If the value does not exist in the Value List, depending on whenever this field authorize the addition of new values, the Value will be added to the values List or an exception will be thrown.

Parameters:
entries - The Value to set.
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.


Copyright © 1999-2007 Crionics. All Rights Reserved.