Class FormField<T extends IFormField>
java.lang.Object
com.itextpdf.commons.actions.sequence.AbstractIdentifiableElement
com.itextpdf.layout.ElementPropertyContainer<T>
com.itextpdf.layout.element.AbstractElement<T>
com.itextpdf.forms.form.element.FormField<T>
- Type Parameters:
T- the generic type of the form field (e.g. input field, button, text area)
- All Implemented Interfaces:
IFormField, IAbstractElement, IBlockElement, IElement, IPropertyContainer, IAccessibleElement
- Direct Known Subclasses:
AbstractSelectField, Button, CheckBox, InputField, Radio, SignatureFieldAppearance, TextArea
public abstract class FormField<T extends IFormField>
extends AbstractElement<T>
implements IFormField, IAccessibleElement
Implementation of the
AbstractElement class for form fields.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe id.protected DefaultAccessibilityPropertiesThe tag properties.Fields inherited from class AbstractElement
childElements, nextRenderer, stylesFields inherited from class ElementPropertyContainer
properties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T1> T1getDefaultProperty(int property) Gets the default property from this entity.getId()Gets the id.setAlternativeDescription(String alternativeDescription) Sets the form field's alternative description.setHeight(float height) Set the form field's height.setInteractive(boolean interactive) Set the form field to be interactive and added into Acroform instead of drawing it on a page.setSize(float size) Sets the form field's width and height.Sets theFormProperty.FORM_FIELD_VALUEproperty.setWidth(float width) Set the form field's width.Methods inherited from class AbstractElement
addStyle, createRendererSubTree, getChildren, getProperty, getRenderer, hasProperty, isEmpty, makeNewRenderer, setAction, setNextRenderer, setPageNumberMethods inherited from class ElementPropertyContainer
deleteOwnProperty, getOwnProperty, getSplitCharacters, getStrokeColor, getStrokeWidth, getTextRenderingMode, getTransparentStrokeColor, hasOwnProperty, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundImage, setBackgroundImage, setBaseDirection, setBorder, setBorderBottom, setBorderBottomLeftRadius, setBorderBottomRightRadius, setBorderLeft, setBorderRadius, setBorderRight, setBorderTop, setBorderTopLeftRadius, setBorderTopRightRadius, setCharacterSpacing, setDashPattern, setDestination, setFixedPosition, setFixedPosition, setFixedPosition, setFixedPosition, setFont, setFontColor, setFontColor, setFontColor, setFontFamily, setFontFamily, setFontKerning, setFontScript, setFontSize, setHorizontalAlignment, setHyphenation, setLineThrough, setOpacity, setProperty, setRelativePosition, setSplitCharacters, setStrokeColor, setStrokeColor, setStrokeColor, setStrokeWidth, setTextAlignment, setTextRenderingMode, setUnderline, setUnderline, setUnderline, setUnderline, setUnderline, setWordSpacing, simulateBold, simulateItalicMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IAbstractElement
getChildrenMethods inherited from interface IAccessibleElement
getAccessibilityPropertiesMethods inherited from interface IElement
createRendererSubTree, getRenderer, setNextRendererMethods inherited from interface IPropertyContainer
deleteOwnProperty, getOwnProperty, getProperty, hasOwnProperty, hasProperty, setProperty
-
Field Details
-
id
The id. -
tagProperties
The tag properties.
-
-
Constructor Details
-
FormField
-
-
Method Details
-
setSize
-
setWidth
Set the form field's width.- Specified by:
setWidthin interfaceIFormField- Parameters:
width- form field's width- Returns:
- this
FormFieldelement
-
setHeight
Set the form field's height.- Specified by:
setHeightin interfaceIFormField- Parameters:
height- form field's height- Returns:
- this
FormFieldelement
-
setValue
Sets theFormProperty.FORM_FIELD_VALUEproperty.- Specified by:
setValuein interfaceIFormField- Parameters:
value- string value of the property to be set- Returns:
- this same
IFormFieldinstance
-
getId
-
getDefaultProperty
public <T1> T1 getDefaultProperty(int property) Gets the default property from this entity.- Specified by:
getDefaultPropertyin interfaceIPropertyContainer- Overrides:
getDefaultPropertyin classElementPropertyContainer<T extends IFormField>- Type Parameters:
T1- the return type associated with the property- Parameters:
property- the property to be retrieved- Returns:
- the default property value. If the default property is not defined,
nullwill be returned
-
setInteractive
Set the form field to be interactive and added into Acroform instead of drawing it on a page.- Specified by:
setInteractivein interfaceIFormField- Parameters:
interactive-trueif the form field element shall be added into Acroform,falseotherwise. By default, the form field element is not interactive and drawn on a page- Returns:
- this same
IFormFieldinstance
-
setAlternativeDescription
Sets the form field's alternative description.- Parameters:
alternativeDescription- form field's alternative description.- Returns:
- this same
FormFieldelement.
-