Package com.itextpdf.forms.form.element
Class ListBoxField
java.lang.Object
com.itextpdf.commons.actions.sequence.AbstractIdentifiableElement
com.itextpdf.layout.ElementPropertyContainer
com.itextpdf.layout.element.AbstractElement
com.itextpdf.forms.form.element.FormField<AbstractSelectField>
com.itextpdf.forms.form.element.AbstractSelectField
com.itextpdf.forms.form.element.ListBoxField
- All Implemented Interfaces:
-
IFormField
,IAbstractElement
,IBlockElement
,IElement
,IPropertyContainer
,IAccessibleElement
A field that represents a control for selecting one or several of the provided options.
-
Field Summary
Fields inherited from class com.itextpdf.forms.form.element.AbstractSelectField
options
Fields inherited from class com.itextpdf.forms.form.element.FormField
tagProperties
Fields inherited from class com.itextpdf.layout.element.AbstractElement
childElements, nextRenderer, styles
Fields inherited from class com.itextpdf.layout.ElementPropertyContainer
properties
-
Constructor Summary
ConstructorDescriptionListBoxField
(String id, int size, boolean allowMultipleSelection) Create a new list box field. -
Method Summary
Modifier and TypeMethodDescriptionAdd an option forListBoxField
.Add an option forListBoxField
.Gets theaccessibility properties
.T1 getDefaultProperty
(int property) Gets the default property from this entity.Get a list of selected options.protected IRenderer
Creates new renderer instance.Methods inherited from class com.itextpdf.forms.form.element.AbstractSelectField
addOption, addOption, addOption, getItems, getOption, getOptions, hasExportAndDisplayValues, hasOptions, optionsCount
Methods inherited from class com.itextpdf.forms.form.element.FormField
getId, setHeight, setInteractive, setSize, setValue, setWidth
Methods inherited from class com.itextpdf.layout.element.AbstractElement
addStyle, createRendererSubTree, getChildren, getProperty, getRenderer, hasProperty, isEmpty, 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.element.IElement
createRendererSubTree, getRenderer, setNextRenderer
Methods inherited from interface com.itextpdf.layout.IPropertyContainer
deleteOwnProperty, getOwnProperty, getProperty, hasOwnProperty, hasProperty, setProperty
-
Constructor Details
-
ListBoxField
Create a new list box field.- Parameters:
-
size
- the size of the list box, which will define the height of visible properties, shall be greater than zero -
allowMultipleSelection
- a boolean flag that defines whether multiple options are allowed to be selected at once -
id
- the id
-
-
Method Details
-
getDefaultProperty
publicT1 getDefaultProperty (int property) Description copied from class:FormField
Gets the default property from this entity.- Specified by:
-
getDefaultProperty
in interfaceIPropertyContainer
- Overrides:
-
getDefaultProperty
in classFormField<AbstractSelectField>
- 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
-
addOption
Add an option forListBoxField
. The option is not selected.- Parameters:
-
option
- string representation of the option. - Returns:
-
this
ListBoxField
.
-
addOption
Add an option forListBoxField
.- Parameters:
-
option
- string representation of the option. -
selected
-true
is the option if selected,false
otherwise. - Returns:
-
this
ListBoxField
.
-
getSelectedStrings
Get a list of selected options.- Returns:
- a list of display values of selected options.
-
getAccessibilityProperties
Gets theaccessibility properties
. See alsoIAccessibleElement
.- Returns:
- an interface that allows to specify properties of a tagged element in Tagged PDF.
-
makeNewRenderer
Description copied from class:AbstractElement
Creates new renderer instance.- Specified by:
-
makeNewRenderer
in classAbstractElement<AbstractSelectField>
- Returns:
-
new
IRenderer
-