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
optionsFields inherited from class com.itextpdf.forms.form.element.FormField
tagPropertiesFields inherited from class com.itextpdf.layout.element.AbstractElement
childElements, nextRenderer, stylesFields inherited from class com.itextpdf.layout.ElementPropertyContainer
properties -
Constructor Summary
ConstructorsConstructorDescriptionListBoxField(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 IRendererCreates a new renderer instance.setTopIndex(int topIndex) Sets the index of the first visible option in a scrollable list.Methods inherited from class com.itextpdf.forms.form.element.AbstractSelectField
addOption, addOption, getOption, getOptions, hasExportAndDisplayValues, hasOptions, optionsCountMethods inherited from class com.itextpdf.forms.form.element.FormField
getId, setAlternativeDescription, setHeight, setInteractive, setSize, setValue, setWidthMethods inherited from class com.itextpdf.layout.element.AbstractElement
addStyle, createRendererSubTree, getChildren, getProperty, getRenderer, hasProperty, isEmpty, setAction, setNextRenderer, setPageNumberMethods inherited from class com.itextpdf.layout.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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.itextpdf.layout.element.IAbstractElement
getChildrenMethods inherited from interface com.itextpdf.layout.element.IElement
createRendererSubTree, getRenderer, setNextRendererMethods 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:FormFieldGets the default property from this entity.- Specified by:
-
getDefaultPropertyin interfaceIPropertyContainer - Overrides:
-
getDefaultPropertyin 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,
nullwill 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-trueis the option if selected,falseotherwise. - Returns:
-
this
ListBoxField.
-
getSelectedStrings
Get a list of selected options.- Returns:
- a list of display values of selected options.
-
setTopIndex
Sets the index of the first visible option in a scrollable list.- Parameters:
-
topIndex- the index of the first option - Returns:
-
this
ListBoxFieldinstance
-
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:AbstractElementCreates a new renderer instance.- Specified by:
-
makeNewRendererin classAbstractElement<AbstractSelectField> - Returns:
-
new
IRenderer
-