public class

ComboBoxWidget

extends Widget
java.lang.Object
   ↳ com.pdftron.pdf.Annot
     ↳ com.pdftron.pdf.annots.Widget
       ↳ com.pdftron.pdf.annots.ComboBoxWidget

Class Overview

An object representing a Combo Box used in a PDF Form.

Summary

[Expand]
Inherited Constants
From class com.pdftron.pdf.annots.Widget
From class com.pdftron.pdf.Annot
Public Constructors
ComboBoxWidget(Obj d)
Creates a Combo Box Widget annotation and initialize it using given Cos/SDF object.
ComboBoxWidget()
Create an empty Combo Box Widget annotation.
ComboBoxWidget(Annot annot)
Creates a Combo Box Widget annotation and initialize it using given annotation object.
Public Methods
void addOption(String value)
Adds an option to Combo Box widget.
void addOptions(String[] opts)
Adds multiple options to Combo Box widget.
static ComboBoxWidget create(Doc doc, Rect pos, String field_name)
Creates a new Combo Box Widget annotation, in the specified document.
static ComboBoxWidget create(Doc doc, Rect pos, Field field)
Creates a new Widget annotation, in the specified document.
static ComboBoxWidget create(Doc doc, Rect pos)
Creates a new Combo Box Widget annotation, in the specified document.
String[] getOptions()
Gets all options of the Combo Box widget.
String getSelectedOption()
Retrieves the option selected in the Combo Box widget
void removeOption(String value)
Remove the option from Combo Box widget.
void replaceOptions(String[] new_opts)
Replaces the current Combo Box widget options with a new set.
void setSelectedOption(String value)
Selects the given option in the Combo Box widget.
[Expand]
Inherited Methods
From class com.pdftron.pdf.annots.Widget
From class com.pdftron.pdf.Annot
From class java.lang.Object

Public Constructors

public ComboBoxWidget (Obj d)

Creates a Combo Box Widget annotation and initialize it using given Cos/SDF object.

Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.

Parameters
d the object to use to initialize the Combo Box Widget

public ComboBoxWidget ()

Create an empty Combo Box Widget annotation.

public ComboBoxWidget (Annot annot)

Creates a Combo Box Widget annotation and initialize it using given annotation object.

Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.

Parameters
annot The annotation to use.

Public Methods

public void addOption (String value)

Adds an option to Combo Box widget.

Parameters
value The option to add

public void addOptions (String[] opts)

Adds multiple options to Combo Box widget.

Parameters
opts The options to add

public static ComboBoxWidget create (Doc doc, Rect pos, String field_name)

Creates a new Combo Box Widget annotation, in the specified document.

Parameters
doc The document to which the annotation is added.
pos A rectangle specifying the annotation's bounds, specified in user space coordinates.
field_name The name of the field for which to create a ComboBox widget
Returns
  • A newly created blank Combo Box Widget annotation.

public static ComboBoxWidget create (Doc doc, Rect pos, Field field)

Creates a new Widget annotation, in the specified document.

Parameters
doc The document to which the annotation is added.
pos A rectangle specifying the annotation's bounds, specified in user space coordinates.
field The field for which to create a Text widget
Returns
  • A newly created blank Widget annotation.

public static ComboBoxWidget create (Doc doc, Rect pos)

Creates a new Combo Box Widget annotation, in the specified document.

Parameters
doc The document to which the annotation is added.
pos A rectangle specifying the annotation's bounds, specified in user space coordinates.
Returns
  • A newly created blank Combo Box Widget annotation.

public String[] getOptions ()

Gets all options of the Combo Box widget.

Returns
  • The options of the Combo Box widget.

public String getSelectedOption ()

Retrieves the option selected in the Combo Box widget

Returns
  • The option selected in the Combo Box widget

public void removeOption (String value)

Remove the option from Combo Box widget.

Parameters
value The option to remove.

public void replaceOptions (String[] new_opts)

Replaces the current Combo Box widget options with a new set.

Parameters
new_opts The new set of options to use.

public void setSelectedOption (String value)

Selects the given option in the Combo Box widget.

Parameters
value The option to select