public class

ListBoxWidget

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

Class Overview

An object representing a List 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
ListBoxWidget(Obj d)
Creates a List Box Widget annotation and initialize it using given Cos/SDF object.
ListBoxWidget()
Create an empty List Box Widget annotation.
ListBoxWidget(Annot annot)
Creates a List Box Widget annotation and initialize it using given annotation object.
Public Methods
void addOption(String value)
Adds option to List Box Widget.
void addOptions(String[] opts)
Adds multiple options to List Box Widget.
static ListBoxWidget create(Doc doc, Rect pos, String field_name)
Creates a new List Box Widget annotation, in the specified document.
static ListBoxWidget create(Doc doc, Rect pos, Field field)
Creates a new List Box Widget annotation, in the specified document.
static ListBoxWidget create(Doc doc, Rect pos)
Creates a new List Box Widget annotation, in the specified document.
String[] getOptions()
Gets all options of the List Box widget.
String[] getSelectedOptions()
Gets all selected options in the List Box widget.
void removeOption(String value)
Remove the option from List Box widget.
void replaceOptions(String[] new_opts)
Replaces the current List Box widget options with a new set.
void setSelectedOptions(String[] selected_opts)
Sets the options for the ListBox 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 ListBoxWidget (Obj d)

Creates a List 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 List Box widget

public ListBoxWidget ()

Create an empty List Box Widget annotation.

public ListBoxWidget (Annot annot)

Creates a List 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 option to List Box Widget.

Parameters
value The option to add

public void addOptions (String[] opts)

Adds multiple options to List Box Widget.

Parameters
opts The options to add.

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

Creates a new List 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 List Box Widget
Returns
  • A newly created blank List Box Widget annotation.

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

Creates a new List 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 the field for which to create a List Box Widget
Returns
  • A newly created blank List Box Widget annotation.

public static ListBoxWidget create (Doc doc, Rect pos)

Creates a new List 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 List Box Widget annotation.

public String[] getOptions ()

Gets all options of the List Box widget.

Returns
  • The options of the List Box widget.

public String[] getSelectedOptions ()

Gets all selected options in the List Box widget.

Returns
  • The selected options of the List Box widget

public void removeOption (String value)

Remove the option from List Box widget.

Parameters
value The option to remove.

public void replaceOptions (String[] new_opts)

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

Parameters
new_opts The new set of options to use.

public void setSelectedOptions (String[] selected_opts)

Sets the options for the ListBox widget.

Parameters
selected_opts The options to select.