Package com.itextpdf.forms.form.element
Class ComboBoxField
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.ComboBoxField
- All Implemented Interfaces:
-
IFormField
,IAbstractElement
,IBlockElement
,IElement
,IPropertyContainer
,IAccessibleElement
A field that represents a control for selecting one 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addOption
(SelectFieldItem option) Add an option to the element.Gets theaccessibility properties
.Gets the export value of the selected option.Gets the selected option.protected IRenderer
Creates new renderer instance.setSelected
(int index) Selects an option by its index.setSelected
(SelectFieldItem item) Selects an option by its value.setSelected
(String value) Selects an option by its export value.Methods inherited from class com.itextpdf.forms.form.element.AbstractSelectField
addOption, getOption, getOptions, hasExportAndDisplayValues, hasOptions, optionsCount
Methods inherited from class com.itextpdf.forms.form.element.FormField
getDefaultProperty, 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, 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, setLineThrough, setOpacity, setProperty, setRelativePosition, setSplitCharacters, setStrokeColor, setStrokeWidth, setTextAlignment, setTextRenderingMode, setUnderline, setUnderline, setUnderline, setUnderline, setWordSpacing, simulateBold, simulateItalic
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
-
ComboBoxField
Creates a new select field box.- Parameters:
-
id
- the id
-
-
Method Details
-
getSelectedExportValue
Gets the export value of the selected option.- Returns:
- the export value of the selected option. This may be null if no value has been selected.
-
setSelected
Selects an option by its index. The index is zero-based.- Parameters:
-
index
- the index of the option to select. - Returns:
-
this
ComboBoxField
instance. - Throws:
-
IndexOutOfBoundsException
- if the index is out of bounds.
-
setSelected
Selects an option by its export value.- Parameters:
-
value
- the export value of the option to select. - Returns:
-
this
ComboBoxField
instance.
-
setSelected
Selects an option by its value. This will use the export value of the option to match it to existing options.- Parameters:
-
item
- the option to select. - Returns:
-
this
ComboBoxField
instance.
-
addOption
Add an option to the element.- Overrides:
-
addOption
in classAbstractSelectField
- Parameters:
-
option
- aSelectFieldItem
.
-
getSelectedOption
Gets the selected option.- Returns:
- the selected option. This may be null if no option has been selected.
-
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
-