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
- 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
FieldsFields 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.voidaddOption(SelectFieldItem option, boolean selected) Add an option to the element.voidaddOption(IBlockElement optionElement) Deprecated.starting from 8.0.1.getItems()Get a list ofSelectFieldItem.Get an optionSelectFieldItemby its string value.Deprecated.starting from 8.0.1.booleanChecks if the field has options with export and display values.booleanChecks if the element has any options.intGets the total amount of options available.Methods inherited from class com.itextpdf.forms.form.element.FormField
getDefaultProperty, getId, setHeight, setInteractive, setSize, setValue, setWidthMethods inherited from class com.itextpdf.layout.element.AbstractElement
addStyle, createRendererSubTree, getChildren, getProperty, getRenderer, hasProperty, isEmpty, makeNewRenderer, setAction, setNextRenderer, setPageNumberMethods 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, setWordSpacingMethods 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
-
Field Details
-
options
-
-
Constructor Details
-
AbstractSelectField
-
-
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-trueis the option if selected,falseotherwise.
-
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 optionSelectFieldItemby 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:
-
trueif the field has options with export and display values,falseotherwise.
-