Package com.itextpdf.forms.fields
Class ChoiceFormFieldBuilder
- java.lang.Object
-
- com.itextpdf.forms.fields.FormFieldBuilder<T>
-
- com.itextpdf.forms.fields.TerminalFormFieldBuilder<ChoiceFormFieldBuilder>
-
- com.itextpdf.forms.fields.ChoiceFormFieldBuilder
-
public class ChoiceFormFieldBuilder extends TerminalFormFieldBuilder<ChoiceFormFieldBuilder>
Builder for choice form field.
-
-
Constructor Summary
Constructors Constructor Description ChoiceFormFieldBuilder(PdfDocument document, java.lang.String formFieldName)Creates builder forPdfChoiceFormFieldcreation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private PdfChoiceFormFieldcreateChoice(int flags)PdfChoiceFormFieldcreateComboBox()Creates combobox form field base on provided parameters.PdfChoiceFormFieldcreateList()Creates list form field based on provided parameters.PdfArraygetOptions()Gets options for choice form field.protected ChoiceFormFieldBuildergetThis()Returns this builder object.private static PdfArrayprocessOptions(java.lang.String[] options)ConvertStringarray of combo box or list options toPdfArray.private static PdfArrayprocessOptions(java.lang.String[][] options)ConvertStringmultidimensional array of combo box or list options toPdfArray.ChoiceFormFieldBuildersetOptions(PdfArray options)Sets options for choice form field.ChoiceFormFieldBuildersetOptions(java.lang.String[] options)Sets options for choice form field.ChoiceFormFieldBuildersetOptions(java.lang.String[][] options)Sets options for choice form field.private static voidverifyOptions(PdfArray options)-
Methods inherited from class com.itextpdf.forms.fields.TerminalFormFieldBuilder
getFont, getPage, getWidgetRectangle, setFont, setPage, setPage, setPageToField, setPageToField, setWidgetRectangle
-
Methods inherited from class com.itextpdf.forms.fields.FormFieldBuilder
getConformance, getDocument, getFormFieldName, setConformance
-
-
-
-
Field Detail
-
options
private PdfArray options
-
-
Constructor Detail
-
ChoiceFormFieldBuilder
public ChoiceFormFieldBuilder(PdfDocument document, java.lang.String formFieldName)
Creates builder forPdfChoiceFormFieldcreation.- Parameters:
document- document to be used for form field creationformFieldName- name of the form field
-
-
Method Detail
-
getOptions
public PdfArray getOptions()
Gets options for choice form field.- Returns:
PdfArrayof choice form field options
-
setOptions
public ChoiceFormFieldBuilder setOptions(PdfArray options)
Sets options for choice form field.- Parameters:
options-PdfArrayof choice form field options- Returns:
- this builder
-
setOptions
public ChoiceFormFieldBuilder setOptions(java.lang.String[] options)
Sets options for choice form field.- Parameters:
options- array ofStringoptions- Returns:
- this builder
-
setOptions
public ChoiceFormFieldBuilder setOptions(java.lang.String[][] options)
Sets options for choice form field.- Parameters:
options- two-dimensional array ofStringoptions. Every inner array shall have two elements.- Returns:
- this builder
-
createList
public PdfChoiceFormField createList()
Creates list form field based on provided parameters.- Returns:
- new
PdfChoiceFormFieldinstance
-
createComboBox
public PdfChoiceFormField createComboBox()
Creates combobox form field base on provided parameters.- Returns:
- new
PdfChoiceFormFieldinstance
-
getThis
protected ChoiceFormFieldBuilder getThis()
Returns this builder object. Required for superclass methods.- Specified by:
getThisin classFormFieldBuilder<ChoiceFormFieldBuilder>- Returns:
- this builder
-
createChoice
private PdfChoiceFormField createChoice(int flags)
-
processOptions
private static PdfArray processOptions(java.lang.String[][] options)
ConvertStringmultidimensional array of combo box or list options toPdfArray.- Parameters:
options- Two-dimensional array of options.- Returns:
- a
PdfArraythat contains all the options.
-
verifyOptions
private static void verifyOptions(PdfArray options)
-
-