Package com.itextpdf.forms.form.element
Class SelectFieldItem
- java.lang.Object
-
- com.itextpdf.forms.form.element.SelectFieldItem
-
public class SelectFieldItem extends java.lang.Object
A field that represents a control for selecting one of the provided options. It is used in theComboBoxField
class.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
displayValue
The display value of the item.private java.lang.String
exportValue
The export value of the item.private IBlockElement
optionElement
The option element of the item.
-
Constructor Summary
Constructors Constructor Description SelectFieldItem(java.lang.String value)
Create a newSelectFieldItem
.SelectFieldItem(java.lang.String value, IBlockElement optionElement)
Create a newSelectFieldItem
.SelectFieldItem(java.lang.String exportValue, java.lang.String displayValue)
Create a newSelectFieldItem
.SelectFieldItem(java.lang.String exportValue, java.lang.String displayValue, IBlockElement optionElement)
Create a newSelectFieldItem
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDisplayValue()
Get the display value of the item.IBlockElement
getElement()
Get the option element of the item.java.lang.String
getExportValue()
Get the export value of the item.boolean
hasExportAndDisplayValues()
Check if the item has a display value.private void
setLabel()
-
-
-
Field Detail
-
exportValue
private final java.lang.String exportValue
The export value of the item. this is the value of the form which will be submitted. If the display value is not set, the export value will be used as display value.
-
displayValue
private final java.lang.String displayValue
The display value of the item. This is the value which will be displayed in the dropdown.
-
optionElement
private final IBlockElement optionElement
The option element of the item. This is the element which will be displayed in the dropdown. It allows for customization
-
-
Constructor Detail
-
SelectFieldItem
public SelectFieldItem(java.lang.String exportValue, java.lang.String displayValue)
Create a newSelectFieldItem
.- Parameters:
exportValue
- the export value of the item.displayValue
- the display value of the item.
-
SelectFieldItem
public SelectFieldItem(java.lang.String value)
Create a newSelectFieldItem
.- Parameters:
value
- the export value of the item.
-
SelectFieldItem
public SelectFieldItem(java.lang.String value, IBlockElement optionElement)
Create a newSelectFieldItem
.- Parameters:
value
- the export value of the item.optionElement
- the option element of the item.
-
SelectFieldItem
public SelectFieldItem(java.lang.String exportValue, java.lang.String displayValue, IBlockElement optionElement)
Create a newSelectFieldItem
.- Parameters:
exportValue
- the export value of the item.displayValue
- the display value of the item.optionElement
- the option element of the item.
-
-
Method Detail
-
getExportValue
public java.lang.String getExportValue()
Get the export value of the item.- Returns:
- export value.
-
getDisplayValue
public java.lang.String getDisplayValue()
Get the display value of the item. If the display value is not set, the export value will be used as display value.- Returns:
- display value.
-
getElement
public IBlockElement getElement()
Get the option element of the item.This is the element which will be displayed in the dropdown. It allows for customization.
- Returns:
- option element.
-
hasExportAndDisplayValues
public boolean hasExportAndDisplayValues()
Check if the item has a display value. and export value.- Returns:
true
if the item has both export and display values,false
otherwise.
-
setLabel
private void setLabel()
-
-