com.crionics.jpdf.forms
Class AbstractButtonField

java.lang.Object
  extended by PdfObjectContainer
      extended by com.crionics.jpdf.forms.AbstractField
          extended by com.crionics.jpdf.forms.AbstractButtonField
Direct Known Subclasses:
CheckBoxField, RadioButtonField

public abstract class AbstractButtonField
extends AbstractField

Methods used by Linked Form Fields (Radio Buttons or Check Boxes). Some Form Fields can be linked, so that when one of them is set, all the others are reset automatically.


Method Summary
 java.util.ArrayList getAvailableValues()
          Recovers the different possible values associated with this Field.
 java.lang.String getDefaultValue()
          Returns the Form Field default value.
 java.lang.String getValue()
          Returns the Form Field value.
 boolean getValueAsBoolean()
          Returns the state of the field.
 boolean isLinked()
          Determines if this Field is part of a group of Fields or not, see getAvailableValues().
 void setDefaultValue(java.lang.String value)
           
 void setTextFont(java.lang.String name)
           
 void setValue(boolean state)
          Sets the value of the Field.
 void setValue(java.lang.String value)
          Sets the Form Field value.
 
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, setTextSize, setToolTip
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAvailableValues

public java.util.ArrayList getAvailableValues()
                                       throws java.io.IOException,
                                              PdfException
Recovers the different possible values associated with this Field. In case of Field grouping, multiple Fields are linked and selecting one will automatically unselect the others, use this method to recover the possible value to set via setValue(String).

Returns:
A list of String containing the different possible value, or null if none where found.
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.

getDefaultValue

public java.lang.String getDefaultValue()
                                 throws PdfException,
                                        java.io.IOException
Returns the Form Field default value.

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

getValue

public java.lang.String 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.

getValueAsBoolean

public boolean getValueAsBoolean()
                          throws PdfException,
                                 java.io.IOException
Returns the state of the field. This methods can be used only if the field is NOT linked (isLinked()).

Returns:
true if the Field is set, false otherwise.
Throws:
PdfException - If a problem occured while parsing the document, or if the field is linked.
java.io.IOException - If a problem occured while parsing the file.

isLinked

public boolean isLinked()
                 throws java.io.IOException,
                        PdfException
Determines if this Field is part of a group of Fields or not, see getAvailableValues().

Returns:
true/false
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.

setDefaultValue

public final void setDefaultValue(java.lang.String value)

setTextFont

public final void setTextFont(java.lang.String name)
Overrides:
setTextFont in class AbstractField

setValue

public void setValue(boolean state)
              throws PdfException,
                     java.io.IOException
Sets the value of the Field. The methods should only be used if the Field is not linked to others; see isLinked(). Note this method calls setValue(String)with the corresponding string ("TRUE" or "FALSE").

Parameters:
state - The new state to set.
Throws:
PdfException - If a problem occured while parsing the document, or if the field is linked.
java.io.IOException - If a problem occured while parsing the file.

setValue

public void setValue(java.lang.String value)
              throws PdfException,
                     java.io.IOException
Sets the Form Field value.

Parameters:
value - The Form Field value to set.
Throws:
PdfException - Raised if a problem occured while parsing the file.
java.io.IOException - Raised if a problem occured while reading the file.


Copyright © 1999-2007 Crionics. All Rights Reserved.