Package com.pdftools.toolbox.pdf.forms
Class RadioButtonGroup
- java.lang.Object
-
- com.pdftools.toolbox.internal.NativeBase
-
- com.pdftools.toolbox.internal.NativeObject
-
- com.pdftools.toolbox.pdf.forms.FieldNode
-
- com.pdftools.toolbox.pdf.forms.Field
-
- com.pdftools.toolbox.pdf.forms.RadioButtonGroup
-
public class RadioButtonGroup extends Field
A radio button field
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RadioButtonaddNewButton(java.lang.String exportName)Create a radio buttonstatic RadioButtonGroupcreate(Document targetDocument)Create a radio button form fieldRadioButtonListgetButtons()This field's buttons (Getter)RadioButtongetChosenButton()This field's selected button (Getter)voidsetChosenButton(RadioButton value)This field's selected button (Setter)-
Methods inherited from class com.pdftools.toolbox.pdf.forms.Field
addNewWidget, getDoNotExport, getReadOnly, getRequired, getWidgets, setDoNotExport, setReadOnly, setRequired
-
Methods inherited from class com.pdftools.toolbox.pdf.forms.FieldNode
copy, getDisplayName, getExportName, setDisplayName, setExportName
-
Methods inherited from class com.pdftools.toolbox.internal.NativeObject
equals, hashCode
-
-
-
-
Method Detail
-
create
public static RadioButtonGroup create(Document targetDocument)
Create a radio button form field
The returned form field object is not yet used, but it is associated with the given target document.- Parameters:
targetDocument- the output document with which the returned object is associated- Returns:
- the newly created radio button field
- Throws:
java.lang.IllegalArgumentException- if thetargetDocumentargument has already been closedjava.lang.IllegalArgumentException- if thetargetDocumentargument is read-onlyjava.lang.IllegalArgumentException- the target document contains form fields that have been implicitly copied by a call totoolbox.pdf.Page.copywith an argumentoptionsin whichtoolbox.pdf.PageCopyOptions.setFormFieldswas set toFormFieldCopyStrategy.COPYjava.lang.IllegalArgumentException- the target document contains unsigned signatures that have been implicitly copied by a call totoolbox.pdf.Page.copywith an argumentoptionsin whichtoolbox.pdf.PageCopyOptions.setUnsignedSignatureswas set totoolbox.pdf.CopyStrategy.COPY.java.lang.IllegalArgumentException- iftargetDocumentisnull
-
addNewButton
public RadioButton addNewButton(java.lang.String exportName)
Create a radio button
The created radio button is automatically added to this radio button field'sgetButtons().- Parameters:
exportName- the radio button's export name- Returns:
- the newly created radio button
- Throws:
java.lang.IllegalStateException- if the document has already been closedjava.lang.UnsupportedOperationException- if the document is read-only
-
getButtons
public RadioButtonList getButtons()
This field's buttons (Getter)
- Throws:
java.lang.IllegalStateException- if the object has already been closed
-
getChosenButton
public RadioButton getChosenButton()
This field's selected button (Getter)
ifnullis set, then no button is chosen.- Throws:
java.lang.IllegalStateException- if the object has already been closed
-
setChosenButton
public void setChosenButton(RadioButton value)
This field's selected button (Setter)
ifnullis set, then no button is chosen.- Throws:
java.lang.IllegalStateException- if the object has already been closedjava.lang.UnsupportedOperationException- if the document is read-onlyjava.lang.IllegalArgumentException- if the provided radio button object does not belong to the radio button fieldjava.lang.IllegalStateException- if the givenRadioButtonobject isnulland the radio button group does not support toggling to offjava.lang.IllegalStateException- if the form field is marked as read-only
-
-