Package com.itextpdf.forms.form.element
Class AbstractSelectField
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
- All Implemented Interfaces:
-
IFormField
,IAbstractElement
,IBlockElement
,IElement
,IPropertyContainer
,IAccessibleElement
- Direct Known Subclasses:
-
ComboBoxField
,ListBoxField
An abstract class for fields that represents a control for selecting one or several of the provided options.
-
Field Summary
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.void
addOption
(SelectFieldItem option, boolean selected) Add an option to the element.void
addOption
(IBlockElement optionElement) Deprecated.starting from 8.0.1.getItems()
Get a list ofSelectFieldItem
.Get an optionSelectFieldItem
by its string value.Deprecated.starting from 8.0.1.boolean
Checks if the field has options with export and display values.boolean
Checks if the element has any options.int
Gets the total amount of options available.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, makeNewRenderer, 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.tagging.IAccessibleElement
getAccessibilityProperties
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
-
Field Details
-
options
-
-
Constructor Details
-
AbstractSelectField
Instantiates a newAbstractSelectField
instance.- Parameters:
-
id
- the id of the field
-
-
Method Details
-
addOption
Deprecated.starting from 8.0.1.Add a container with options. This might be a container for options group.- Parameters:
-
optionElement
- a container with options
-
addOption
Add an option to the element.- Parameters:
-
option
- aSelectFieldItem
-
addOption
Add an option to the element.- Parameters:
-
option
- aSelectFieldItem
-
selected
-true
is the option if selected,false
otherwise
-
getItems
Get a list ofSelectFieldItem
.- Returns:
- a list of options.
-
optionsCount
public int optionsCount()Gets the total amount of options available.- Returns:
- the number of options in the element.
-
hasOptions
public boolean hasOptions()Checks if the element has any options.- Returns:
- true if the element has options, false otherwise.
-
getOption
Get an optionSelectFieldItem
by its string value.- Parameters:
-
value
- string value to find an option by - Returns:
-
a
SelectFieldItem
.
-
getOptions
Deprecated.starting from 8.0.1.Gets a list of containers with option(s). Every container might be a container for options group.- Returns:
- a list of containers with options.
-
hasExportAndDisplayValues
public boolean hasExportAndDisplayValues()Checks if the field has options with export and display values.- Returns:
-
true
if the field has options with export and display values,false
otherwise.
-