Class 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
FieldsFields inherited from class AbstractSelectField
optionsFields inherited from class FormField
tagPropertiesFields inherited from class AbstractElement
childElements, nextRenderer, stylesFields inherited from class ElementPropertyContainer
properties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOption(SelectFieldItem option) Add an option to the element.private voidGets 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 AbstractSelectField
addOption, getOption, getOptions, hasExportAndDisplayValues, hasOptions, optionsCountMethods inherited from class FormField
getDefaultProperty, getId, setAlternativeDescription, setHeight, setInteractive, setSize, setValue, setWidthMethods inherited from class AbstractElement
addStyle, createRendererSubTree, getChildren, getProperty, getRenderer, hasProperty, isEmpty, setAction, setNextRenderer, setPageNumberMethods inherited from class 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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IAbstractElement
getChildrenMethods inherited from interface IElement
createRendererSubTree, getRenderer, setNextRendererMethods inherited from interface IPropertyContainer
deleteOwnProperty, getOwnProperty, getProperty, hasOwnProperty, hasProperty, setProperty
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
selectedExportValue
-
-
Constructor Details
-
ComboBoxField
-
-
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
-
clearSelected
private void clearSelected()
-