org.pdfbox.pdmodel.interactive.form

Class PDCheckbox

Implemented Interfaces:
COSObjectable

public class PDCheckbox
extends PDChoiceButton

A class for handling the PDF field as a checkbox.
Version:
$Revision: 1.11 $
Authors:
Ben Litchfield
sug

Field Summary

Fields inherited from class org.pdfbox.pdmodel.interactive.form.PDField

FLAG_NO_EXPORT, FLAG_READ_ONLY, FLAG_REQUIRED

Constructor Summary

PDCheckbox(PDAcroForm theAcroForm, COSDictionary field)

Method Summary

void
check()
Checks the radiobutton.
String
getOffValue()
This will get the value of the radio button.
String
getOnValue()
This will get the value of the radio button.
String
getValue()
getValue gets the fields value to as a string.
boolean
isChecked()
This will tell if this radio button is currently checked or not.
void
setValue(String newValue)
void
unCheck()
Unchecks the radiobutton.

Methods inherited from class org.pdfbox.pdmodel.interactive.form.PDChoiceButton

getOptions, setOptions

Methods inherited from class org.pdfbox.pdmodel.interactive.form.PDField

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

Constructor Details

PDCheckbox

public PDCheckbox(PDAcroForm theAcroForm,
                  COSDictionary field)
Parameters:
theAcroForm - The acroForm for this field.
field - The checkbox field dictionary

Method Details

check

public void check()
Checks the radiobutton.

getOffValue

public String getOffValue()
This will get the value of the radio button.
Returns:
The value of the radio button.

getOnValue

public String getOnValue()
This will get the value of the radio button.
Returns:
The value of the radio button.

getValue

public String getValue()
            throws IOException
getValue gets the fields value to as a string.
Overrides:
getValue in interface PDField
Returns:
The string value of this field.

isChecked

public boolean isChecked()
This will tell if this radio button is currently checked or not.
Returns:
true If the radio button is checked.

setValue

public void setValue(String newValue)
Overrides:
setValue in interface PDField

unCheck

public void unCheck()
Unchecks the radiobutton.