Package com.itextpdf.forms.form.element
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 theAbstractElement
class for form fields.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
id
The id.protected DefaultAccessibilityProperties
tagProperties
The tag properties.-
Fields inherited from class com.itextpdf.layout.element.AbstractElement
childElements, nextRenderer, styles
-
Fields inherited from class com.itextpdf.layout.ElementPropertyContainer
properties
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T1> T1
getDefaultProperty(int property)
Gets the default property from this entity.java.lang.String
getId()
Gets the id.IFormField
setHeight(float height)
Set the form field's height.IFormField
setInteractive(boolean interactive)
Set the form field to be interactive and added into Acroform instead of drawing it on a page.T
setSize(float size)
Sets the form field's width and height.IFormField
setValue(java.lang.String value)
Sets theFormProperty.FORM_FIELD_VALUE
property.IFormField
setWidth(float width)
Set the form field's width.-
Methods inherited from class com.itextpdf.layout.element.AbstractElement
addStyle, createRendererSubTree, getChildren, getProperty, getRenderer, hasProperty, isEmpty, makeNewRenderer, setAction, setNextRenderer, setPageNumber
-
Methods inherited from class com.itextpdf.layout.ElementPropertyContainer
deleteOwnProperty, getOwnProperty, getSplitCharacters, getStrokeColor, getStrokeWidth, getTextRenderingMode, hasOwnProperty, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundImage, setBackgroundImage, setBaseDirection, setBold, setBorder, setBorderBottom, setBorderBottomLeftRadius, setBorderBottomRightRadius, setBorderLeft, setBorderRadius, setBorderRight, setBorderTop, setBorderTopLeftRadius, setBorderTopRightRadius, setCharacterSpacing, setDestination, setFixedPosition, setFixedPosition, setFixedPosition, setFixedPosition, setFont, setFontColor, setFontColor, setFontColor, setFontFamily, setFontFamily, setFontKerning, setFontScript, setFontSize, setHorizontalAlignment, setHyphenation, setItalic, setLineThrough, setOpacity, setProperty, setRelativePosition, setSplitCharacters, setStrokeColor, setStrokeWidth, setTextAlignment, setTextRenderingMode, setUnderline, setUnderline, setUnderline, setUnderline, setWordSpacing
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.itextpdf.layout.element.IAbstractElement
getChildren
-
Methods inherited from interface com.itextpdf.layout.tagging.IAccessibleElement
getAccessibilityProperties
-
Methods inherited from interface com.itextpdf.layout.element.IElement
createRendererSubTree, getRenderer, setNextRenderer
-
Methods inherited from interface com.itextpdf.layout.IPropertyContainer
deleteOwnProperty, getOwnProperty, getProperty, hasOwnProperty, hasProperty, setProperty
-
-
-
-
Field Detail
-
id
private final java.lang.String id
The id.
-
tagProperties
protected DefaultAccessibilityProperties tagProperties
The tag properties.
-
-
Constructor Detail
-
FormField
FormField(java.lang.String id)
Instantiates a newFormField
instance.- Parameters:
id
- the id
-
-
Method Detail
-
setSize
public T setSize(float size)
Sets the form field's width and height.- Parameters:
size
- form field's width and height.- Returns:
- this same
FormField
element.
-
setWidth
public IFormField setWidth(float width)
Set the form field's width.- Specified by:
setWidth
in interfaceIFormField
- Parameters:
width
- form field's width.- Returns:
- this
FormField
element.
-
setHeight
public IFormField setHeight(float height)
Set the form field's height.- Specified by:
setHeight
in interfaceIFormField
- Parameters:
height
- form field's height.- Returns:
- this
FormField
element.
-
setValue
public IFormField setValue(java.lang.String value)
Sets theFormProperty.FORM_FIELD_VALUE
property.- Specified by:
setValue
in interfaceIFormField
- Parameters:
value
- string value of the property to be set.- Returns:
- this same
IFormField
instance.
-
getId
public java.lang.String getId()
Gets the id.- Specified by:
getId
in interfaceIFormField
- Returns:
- the id.
-
getDefaultProperty
public <T1> T1 getDefaultProperty(int property)
Gets the default property from this entity.- Specified by:
getDefaultProperty
in interfaceIPropertyContainer
- Overrides:
getDefaultProperty
in 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,
null
will be returned
-
setInteractive
public IFormField setInteractive(boolean interactive)
Set the form field to be interactive and added into Acroform instead of drawing it on a page.- Specified by:
setInteractive
in interfaceIFormField
- Parameters:
interactive
-true
if the form field element shall be added into Acroform,false
otherwise. By default, the form field element is not interactive and drawn on a page.- Returns:
- this same
IFormField
instance.
-
-