Package com.pdftools.toolbox.pdf.forms
Class Field
- 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
-
- Direct Known Subclasses:
CheckBox,ChoiceField,PushButton,RadioButtonGroup,TextField
public abstract class Field extends FieldNode
A form field
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WidgetaddNewWidget(Rectangle boundingBox)Create a new widget and add to the form fieldbooleangetDoNotExport()Tells whether this field is exported (Getter)booleangetReadOnly()Flags this field as read-only (Getter)booleangetRequired()Flags this field as mandatory (Getter)WidgetListgetWidgets()This form field's widget annotations (Getter)voidsetDoNotExport(boolean value)Tells whether this field is exported (Setter)voidsetReadOnly(boolean value)Flags this field as read-only (Setter)voidsetRequired(boolean value)Flags this field as mandatory (Setter)-
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
-
addNewWidget
public Widget addNewWidget(Rectangle boundingBox)
Create a new widget and add to the form field
This method creates a widget for the form field. The widget is automatically added to the field's widgets, but not to any page. This method does not work for radio button form fields; UseRadioButton.addNewWidget(com.pdftools.toolbox.geometry.real.Rectangle).- Parameters:
boundingBox- The widget's target rectangle on the page- Returns:
- the newly created form field widget
- Throws:
java.lang.IllegalStateException- if the document has already been closedjava.lang.UnsupportedOperationException- if the document is read-onlyjava.lang.UnsupportedOperationException- if the form field is of typeRadioButtonGroupjava.lang.IllegalArgumentException- ifboundingBoxisnull
-
getWidgets
public WidgetList getWidgets()
This form field's widget annotations (Getter)
- Throws:
java.lang.IllegalStateException- if the object has already been closed
-
getReadOnly
public boolean getReadOnly()
Flags this field as read-only (Getter)
- Throws:
java.lang.IllegalStateException- if the object has already been closed
-
setReadOnly
public void setReadOnly(boolean value)
Flags this field as read-only (Setter)
- Throws:
java.lang.IllegalStateException- if the object has already been closedjava.lang.UnsupportedOperationException- if the document is read-only
-
getRequired
public boolean getRequired()
Flags this field as mandatory (Getter)
- Throws:
java.lang.IllegalStateException- if the object has already been closed
-
setRequired
public void setRequired(boolean value)
Flags this field as mandatory (Setter)
- Throws:
java.lang.IllegalStateException- if the object has already been closedjava.lang.UnsupportedOperationException- if the document is read-only
-
getDoNotExport
public boolean getDoNotExport()
Tells whether this field is exported (Getter)
- Throws:
java.lang.IllegalStateException- if the object has already been closed
-
setDoNotExport
public void setDoNotExport(boolean value)
Tells whether this field is exported (Setter)
- Throws:
java.lang.IllegalStateException- if the object has already been closedjava.lang.UnsupportedOperationException- if the document is read-only
-
-