Class PDRadioCollection
java.lang.Object
org.apache.pdfbox.pdmodel.interactive.form.PDField
org.apache.pdfbox.pdmodel.interactive.form.PDChoiceButton
org.apache.pdfbox.pdmodel.interactive.form.PDRadioCollection
- All Implemented Interfaces:
COSObjectable
A class for handling the PDF field as a Radio Collection.
This class automatically keeps track of the child radio buttons
in the collection.
- Version:
- $Revision: 1.13 $
- Author:
- sug
- See Also:
-
Field Summary
FieldsFields inherited from class org.apache.pdfbox.pdmodel.interactive.form.PDField
FLAG_NO_EXPORT, FLAG_READ_ONLY, FLAG_REQUIRED
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetKids()
This will return a list of PDField objects that are part of this radio collection.getValue()
getValue gets the fields value to as a string.boolean
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
This setValue method iterates the collection of radiobuttons and checks or unchecks each radiobutton according to the given value.Methods inherited from class org.apache.pdfbox.pdmodel.interactive.form.PDChoiceButton
getOptions, setOptions
Methods inherited from class org.apache.pdfbox.pdmodel.interactive.form.PDField
findFieldType, findKid, getAcroForm, getActions, getAlternateFieldName, getCOSObject, getDictionary, getFieldFlags, getFieldType, getFullyQualifiedName, getParent, getPartialName, getWidget, getWidgets, importFDF, isNoExport, isReadonly, isRequired, setAcroForm, setActions, setAlternateFieldName, setFieldFlags, setFieldType, setKids, setNoExport, setParent, setPartialName, setReadonly, setRequired, toString
-
Field Details
-
FLAG_RADIOS_IN_UNISON
public static final int FLAG_RADIOS_IN_UNISONA Ff flag.- See Also:
-
-
Constructor Details
-
PDRadioCollection
- Parameters:
theAcroForm
- The acroForm for this field.field
- The field that makes up the radio collection.
-
-
Method Details
-
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).- Parameters:
radiosInUnison
- The new flag for radiosInUnison.
-
isRadiosInUnison
public boolean isRadiosInUnison()- Returns:
- true If the flag is set for radios in unison.
-
setValue
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 sets the fields value to a given string.- Specified by:
setValue
in classPDField
- Parameters:
value
- the string value- Throws:
IOException
- If there is an error creating the appearance stream.
-
getValue
getValue gets the fields value to as a string.- Specified by:
getValue
in classPDField
- Returns:
- The string value of this field.
- Throws:
IOException
- If there is an error getting the value.
-
getKids
This will return a list of PDField objects that are part of this radio collection.- Overrides:
getKids
in classPDField
- Returns:
- A list of PDWidget objects.
- Throws:
IOException
- if there is an error while creating the children objects.- See Also:
-