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
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOption(SelectFieldItem option) Add an option to the element.Gets theaccessibility properties.Gets the export value of the selected option.Gets the selected option.protected IRendererCreates a 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, optionsCountMethods inherited from class com.itextpdf.forms.form.element.FormField
getDefaultProperty, 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
-
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
ComboBoxFieldinstance. - 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
ComboBoxFieldinstance.
-
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
ComboBoxFieldinstance.
-
addOption
Add an option to the element.- Overrides:
-
addOptionin 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:AbstractElementCreates a new renderer instance.- Specified by:
-
makeNewRendererin classAbstractElement<AbstractSelectField> - Returns:
-
new
IRenderer
-