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
FieldsFields 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.voidaddOption(SelectFieldItem option, boolean selected) Add an option to the element.Get an optionSelectFieldItemby its string value.Get a list ofSelectFieldItem.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, setAlternativeDescription, 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, 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.tagging.IAccessibleElement
getAccessibilityPropertiesMethods 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
Instantiates a newAbstractSelectFieldinstance.- Parameters:
-
id- the id of the field
-
-
Method Details
-
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
-
getOptions
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.
-
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.
-