Builder
class Builder
| kotlin.Any | |
| ↳ | android.graphics.pdf.models.FormWidgetInfo.Builder |
Builder for FormWidgetInfo
Summary
| Public constructors | |
|---|---|
Builder(widgetType: Int, widgetIndex: Int, widgetRect: Rect, textValue: String, accessibilityLabel: String)Creates an instance |
|
| Public methods | |
|---|---|
| FormWidgetInfo |
build()Builds a |
| FormWidgetInfo.Builder |
setEditableText(editableText: Boolean)Sets whether this widget contains editable text. |
| FormWidgetInfo.Builder |
setFontSize(fontSize: Float)Sets the font size for this widget. |
| FormWidgetInfo.Builder |
setListItems(listItems: MutableList<ListItem!>)Sets the choice options for this widget. |
| FormWidgetInfo.Builder |
setMaxLength(maxLength: Int)Sets the maximum character length of input text supported by this widget. |
| FormWidgetInfo.Builder |
setMultiLineText(multiLineText: Boolean)Sets whether this widget supports multi-line text input. |
| FormWidgetInfo.Builder |
setMultiSelect(multiSelect: Boolean)Sets whether this widget supports multiple choice selections. |
| FormWidgetInfo.Builder |
setReadOnly(readOnly: Boolean)Sets whether this widget is read-only |
Public constructors
Builder
Builder(
widgetType: Int,
widgetIndex: Int,
widgetRect: Rect,
textValue: String,
accessibilityLabel: String)
Creates an instance
| Parameters | |
|---|---|
widgetType |
Int: the type of widget Value is android.graphics.pdf.models.FormWidgetInfo#WIDGET_TYPE_UNKNOWN, android.graphics.pdf.models.FormWidgetInfo#WIDGET_TYPE_PUSHBUTTON, android.graphics.pdf.models.FormWidgetInfo#WIDGET_TYPE_CHECKBOX, android.graphics.pdf.models.FormWidgetInfo#WIDGET_TYPE_RADIOBUTTON, android.graphics.pdf.models.FormWidgetInfo#WIDGET_TYPE_COMBOBOX, android.graphics.pdf.models.FormWidgetInfo#WIDGET_TYPE_LISTBOX, android.graphics.pdf.models.FormWidgetInfo#WIDGET_TYPE_TEXTFIELD, or android.graphics.pdf.models.FormWidgetInfo#WIDGET_TYPE_SIGNATURE |
widgetIndex |
Int: the index of the widget in the page's "Annot" array in the PDF Value is 0 or greater |
widgetRect |
Rect: the Rect in page coordinates occupied by the widget This value cannot be null. |
textValue |
String: the widget's text value This value cannot be null. |
accessibilityLabel |
String: the field's accessibility label This value cannot be null. |
| Exceptions | |
|---|---|
java.lang.NullPointerException |
if any of widgetRect, textValue, or accessibilityLabel are null |
Public methods
build
fun build(): FormWidgetInfo
Builds a FormWidgetInfo
| Return | |
|---|---|
FormWidgetInfo |
This value cannot be null. |
setEditableText
fun setEditableText(editableText: Boolean): FormWidgetInfo.Builder
Sets whether this widget contains editable text. Only supported for comboboxes and text fields
| Return | |
|---|---|
FormWidgetInfo.Builder |
This value cannot be null. |
| Exceptions | |
|---|---|
java.lang.IllegalArgumentException |
if this is not a combobox or text field type widget |
setFontSize
fun setFontSize(fontSize: Float): FormWidgetInfo.Builder
Sets the font size for this widget. Only supported for text fields and comboboxes
| Parameters | |
|---|---|
fontSize |
Float: Value is 0.0f or greater |
| Return | |
|---|---|
FormWidgetInfo.Builder |
This value cannot be null. |
| Exceptions | |
|---|---|
java.lang.IllegalArgumentException |
if this is not a combobox or text field, or if a negative font size is supplied |
setListItems
fun setListItems(listItems: MutableList<ListItem!>): FormWidgetInfo.Builder
Sets the choice options for this widget. Only supported for comboboxes and list boxes
| Parameters | |
|---|---|
listItems |
MutableList<ListItem!>: This value cannot be null. |
| Return | |
|---|---|
FormWidgetInfo.Builder |
This value cannot be null. |
| Exceptions | |
|---|---|
java.lang.IllegalArgumentException |
if this is not a combobox or list box |
java.lang.NullPointerException |
if choiceOptions is null |
setMaxLength
fun setMaxLength(maxLength: Int): FormWidgetInfo.Builder
Sets the maximum character length of input text supported by this widget. Only supported for text fields
| Parameters | |
|---|---|
maxLength |
Int: Value is 0 or greater |
| Return | |
|---|---|
FormWidgetInfo.Builder |
This value cannot be null. |
| Exceptions | |
|---|---|
java.lang.IllegalArgumentException |
if this is not a text field, or if a negative max length is supplied |
setMultiLineText
fun setMultiLineText(multiLineText: Boolean): FormWidgetInfo.Builder
Sets whether this widget supports multi-line text input. Only supported for text fields
| Return | |
|---|---|
FormWidgetInfo.Builder |
This value cannot be null. |
| Exceptions | |
|---|---|
java.lang.IllegalArgumentException |
if this is not a text field |
setMultiSelect
fun setMultiSelect(multiSelect: Boolean): FormWidgetInfo.Builder
Sets whether this widget supports multiple choice selections. Only supported for list boxes
| Return | |
|---|---|
FormWidgetInfo.Builder |
This value cannot be null. |
| Exceptions | |
|---|---|
java.lang.IllegalArgumentException |
if this is not a list box |
setReadOnly
fun setReadOnly(readOnly: Boolean): FormWidgetInfo.Builder
Sets whether this widget is read-only
| Return | |
|---|---|
FormWidgetInfo.Builder |
This value cannot be null. |