Class ComboBoxField

All Implemented Interfaces:
IFormField, IAbstractElement, IBlockElement, IElement, IPropertyContainer, IAccessibleElement

public class ComboBoxField extends AbstractSelectField
A field that represents a control for selecting one of the provided options.
  • Constructor Details

    • ComboBoxField

      public ComboBoxField (String id)
      Creates a new select field box.
      Parameters:
      id - the id
  • Method Details

    • getSelectedExportValue

      public String 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

      public ComboBoxField setSelected (int index)
      Selects an option by its index. The index is zero-based.
      Parameters:
      index - the index of the option to select.
      Returns:
      this ComboBoxField instance.
      Throws:
      IndexOutOfBoundsException - if the index is out of bounds.
    • setSelected

      public ComboBoxField setSelected (String value)
      Selects an option by its export value.
      Parameters:
      value - the export value of the option to select.
      Returns:
      this ComboBoxField instance.
    • setSelected

      public ComboBoxField setSelected (SelectFieldItem item)
      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 ComboBoxField instance.
    • addOption

      public void addOption (SelectFieldItem option)
      Add an option to the element.
      Overrides:
      addOption in class AbstractSelectField
      Parameters:
      option - a SelectFieldItem.
    • getSelectedOption

      public SelectFieldItem getSelectedOption()
      Gets the selected option.
      Returns:
      the selected option. This may be null if no option has been selected.
    • getAccessibilityProperties

      public AccessibilityProperties getAccessibilityProperties()
      Returns:
      an interface that allows to specify properties of a tagged element in Tagged PDF.
    • makeNewRenderer

      protected IRenderer makeNewRenderer()
      Description copied from class: AbstractElement
      Creates new renderer instance.
      Specified by:
      makeNewRenderer in class AbstractElement<AbstractSelectField>
      Returns:
      new IRenderer