org.pdfbox.pdmodel.interactive.form
Class PDRadioCollection
- COSObjectable
public class PDRadioCollection
A class for handling the PDF field as a Radio Collection.
This class automatically keeps track of the child radio buttons
in the collection.
List | getKids() - This will return a list of PDField objects that are part of this radio collection.
|
String | getValue() - getValue gets the fields value to as a string.
|
boolean | isRadiosInUnison()
|
void | setRadiosInUnison(boolean radiosInUnison) - From the PDF Spec
If set, a group of radio buttons within a radio button field that
use the same value for the on state will turn on and off in unison; that is if
one is checked, they are all checked.
|
void | setValue(String value) - This setValue method iterates the collection of radiobuttons
and checks or unchecks each radiobutton according to the
given value.
|
findFieldType , findKid , getAcroForm , getActions , getCOSObject , getDictionary , getFieldFlags , getFieldType , getFullyQualifiedName , getKids , getParent , getPartialName , getValue , getWidget , importFDF , isNoExport , isReadonly , isRequired , setAcroForm , setActions , setFieldFlags , setKids , setNoExport , setParent , setPartialName , setReadonly , setRequired , setValue , toString |
FLAG_RADIOS_IN_UNISON
public static final int FLAG_RADIOS_IN_UNISON
A Ff flag.
PDRadioCollection
public PDRadioCollection(PDAcroForm theAcroForm,
COSDictionary field)
theAcroForm
- The acroForm for this field.field
- The field that makes up the radio collection.
getKids
public List getKids()
throws IOException
This will return a list of PDField objects that are part of this radio collection.
- getKids in interface PDField
- A list of PDWidget objects.
getValue
public String getValue()
throws IOException
getValue gets the fields value to as a string.
- getValue in interface PDField
- The string value of this field.
isRadiosInUnison
public boolean isRadiosInUnison()
- true If the flag is set for radios in unison.
setRadiosInUnison
public void setRadiosInUnison(boolean radiosInUnison)
From the PDF Spec
If set, a group of radio buttons within a radio button field that
use the same value for the on state will turn on and off in unison; that is if
one is checked, they are all checked. If clear, the buttons are mutually exclusive
(the same behavior as HTML radio buttons).
radiosInUnison
- The new flag for radiosInUnison.
setValue
public void setValue(String value)
throws IOException
This setValue method iterates the collection of radiobuttons
and checks or unchecks each radiobutton according to the
given value.
If the value is not represented by any of the radiobuttons,
then none will be checked.
- setValue in interface PDField