|
Gnostice PDFOne
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gnostice.pdfone.PdfAnnot
com.gnostice.pdfone.PdfProAnnot
com.gnostice.pdfone.PdfFormField
com.gnostice.pdfone.PdfFormChoiceField
com.gnostice.pdfone.PdfFormComboBox
This class represents a combo box. A combo box provides a drop-down list containing several text options. If the list is made editable, then users can be allowed to enter a text option that is not already in the list.
Here are the steps to use a combo box form field.
flags
// Create a PDF page PdfPage page = new PdfPage(); // Create a list box PdfFormComboBox cmb = new PdfFormComboBox( new PdfRect(300, 100, 150, 20), "Country", PdfFormField.FLAG_REQUIRED, Color.BLACK, Color.YELLOW); // Add options to the list box cmb.addItem("India"); cmb.addItem("United States", true); cmb.addItem("United Kingdom"); cmb.addItem("Russia", "Russian Federation"); // Add the list box form field to the page page.addFormField(cmb); page.writeText("Your location", 220, 100);
Field Summary | |
static int |
FLAG_EDITABLE
Flag for specifying that viewer applications can allow the user to enter a new option not already listed for a specific combo box. |
Constructor Summary | |
PdfFormComboBox(PdfRect rect)
Constructs a combo box form field with specified bounding box. |
|
PdfFormComboBox(PdfRect r,
String name)
Constructs a combo box form field with specified bounding box and name. |
|
PdfFormComboBox(PdfRect r,
String name,
Color borderColor,
Color backgroundColor)
Constructs a combo box form field with specified bounding box, name, border color, and background color. |
|
PdfFormComboBox(PdfRect r,
String name,
int fieldFlags)
Constructs a combo box form field with specified bounding box, name, and flags. |
|
PdfFormComboBox(PdfRect r,
String name,
int fieldFlags,
Color borderColor,
Color backgroundColor)
Constructs a combo box form field with specified bounding box, name, flags, border color, and background color. |
|
PdfFormComboBox(PdfRect r,
String name,
String alternateName,
String mappingName)
Constructs a combo box form field with specified bounding box, name, alternate name, and mapping name. |
|
PdfFormComboBox(PdfRect r,
String name,
String alternateName,
String mappingName,
Color borderColor,
Color backgroundColor)
Constructs a combo box form field with specified bounding box, name, alternate name, mapping name, border color, and background color. |
|
PdfFormComboBox(PdfRect r,
String name,
String alternateName,
String mappingName,
int fieldFlags)
Constructs a combo box form field with specified bounding box, name, alternate name, mapping name, and flags. |
|
PdfFormComboBox(PdfRect r,
String name,
String alternateName,
String mappingName,
int fieldFlags,
Color borderColor,
Color backgroundColor)
Constructs a combo box form field with specified bounding box, name, alternate name, mapping name, flags, border color, and background color. |
|
PdfFormComboBox(String name)
Constructs a combo box form field with specified name. |
|
PdfFormComboBox(String name,
Color borderColor,
Color backgroundColor)
Constructs a combo box form field with specified name, border color, and background color. |
|
PdfFormComboBox(String name,
int fieldFlags)
Constructs a combo box form field with specified name and flags. |
|
PdfFormComboBox(String name,
int fieldFlags,
Color borderColor,
Color backgroundColor)
Constructs a combo box form field with specified name, flags, border color, and background color. |
|
PdfFormComboBox(String name,
String alternateName,
String mappingName)
Constructs a combo box form field with specified name, alternate name, and mapping name. |
|
PdfFormComboBox(String name,
String alternateName,
String mappingName,
Color borderColor,
Color backgroundColor)
Constructs a combo box form field with specified name, alternate name, mapping name, border color, and background color. |
|
PdfFormComboBox(String name,
String alternateName,
String mappingName,
int fieldFlags)
Constructs a combo box form field with specified name, alternate name, mapping name, and flags. |
|
PdfFormComboBox(String name,
String alternateName,
String mappingName,
int fieldFlags,
Color borderColor,
Color backgroundColor)
Constructs a combo box form field with specified name, alternate name, mapping name, flags, border color, and background color. |
Method Summary | |
void |
addItem(String item)
Adds a new option with specified value to this list box/combo box form field. |
void |
addItem(String item,
boolean keepSelected)
Adds a new option with specified value and selection state to this list box/combo box form field. |
void |
addItem(String item,
String exportValue)
Adds a new option with specified value and export value to this list box/combo box form field. |
void |
addItem(String item,
String exportValue,
boolean keepSelected)
Adds a new option with specified value, export value and selection state to this list box/combo box form field. |
Object |
clone()
|
int |
getAlignment()
Returns how values of the options in the combo box/list box are aligned. |
List |
getDisplayValues()
Returns display values of all options in the combo box/list box form field. |
List |
getExportValues()
Returns export values of all options in the combo box/list box form field. |
String |
getValue()
Returns value of selected option in the combo box/list box form field. |
boolean |
isAutoAdjustTextHeight()
Returns whether the viewer application will adjust the font size to accommodate the entire value of the options in the combo box/list box form field. |
boolean |
isCommitOnSelectionChange()
Returns whether actions associated with the combo box/list box are set to be executed immediately when an option is selected. |
boolean |
isEditable()
Returns whether the FLAG_EDITABLE flag has been set
for the combo box. |
boolean |
isMultiselect()
Returns whether multiple options can be selected in the combo box/list box form field. |
void |
removeItem(int index)
Deletes option with specified ordinal from the combo box/list box. |
void |
removeItem(String item)
Deletes option with specified value from the combo box/list box. |
void |
setAlignment(int alignment)
Specifies how values of the options in the combo box/list box need to be aligned. |
void |
setAutoAdjustTextHeight(boolean autoAdjustFieldTextHeight)
Specifies whether the size of text inside the field needs to be adjusted by the viewer application so that the text is fully accommodated inside the field without any cropping. |
void |
setCommitOnSelectionChange(boolean commitOnSelectionChange)
Specifies whether actions associated with the combo box/list box need to be executed immediately when an option is selected. |
void |
setEditable(boolean editable)
Specifies whether the FLAG_EDITABLE flag needs to be
set for the combo box. |
void |
setValue(String value)
Sets specified value as the selected option. |
Methods inherited from class com.gnostice.pdfone.PdfAnnot |
delete, getAnnotName, getBorderStyle, getBorderWidth, getBottom, getColor, getContents, getDashPattern, getFlags, getLeft, getRect, getRight, getSubject, getTitle, getTop, hashCode, isDeleted, isShowRect, setAnnotName, setBorderStyle, setBorderWidth, setColor, setContents, setDashPattern, setFlags, setRect, setRect, setRect, setRect, setRect, setShowRect, setSubject, setTitle |
Methods inherited from class java.lang.Object |
equals, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int FLAG_EDITABLE
Constructor Detail |
public PdfFormComboBox(String name, int fieldFlags)
name
- name of the list box in the documentfieldFlags
- form field flags
PdfFormField
public PdfFormComboBox(String name, String alternateName, String mappingName, int fieldFlags)
name
- name of the combo box in the documentalternateName
- alternate name of the combo box in the documentmappingName
- mapping name of the combo box in the documentfieldFlags
- form field flags
PdfFormField
public PdfFormComboBox(String name, String alternateName, String mappingName)
name
- name of the combo box in the documentalternateName
- alternate name of the combo box in the documentmappingName
- mapping name of the combo box in the documentPdfFormField
public PdfFormComboBox(String name)
name
- name of the combo box in the documentpublic PdfFormComboBox(PdfRect rect)
name
is specified for it.
rect
- bounding box of the combo boxPdfFormField
public PdfFormComboBox(PdfRect r, String name, int fieldFlags)
r
- bounding box of the combo boxname
- name of the combo box in the documentfieldFlags
- form field flags
PdfFormField
public PdfFormComboBox(PdfRect r, String name)
r
- bounding box of the combo boxname
- name of the combo box in the documentPdfFormField
public PdfFormComboBox(PdfRect r, String name, String alternateName, String mappingName, int fieldFlags)
r
- bounding box of the combo boxname
- name of the combo box in the documentalternateName
- alternate name of the combo box in the documentmappingName
- mapping name of the combo box in the documentfieldFlags
- form field flags
PdfFormField
public PdfFormComboBox(PdfRect r, String name, String alternateName, String mappingName)
r
- bounding box of the combo boxname
- name of the combo box in the documentalternateName
- alternate name of the combo box in the documentmappingName
- mapping name of the combo box in the documentPdfFormField
public PdfFormComboBox(String name, int fieldFlags, Color borderColor, Color backgroundColor)
name
- name of the combo box in the documentfieldFlags
- form field flags
borderColor
- border color of the combo boxbackgroundColor
- background color of the combo boxPdfFormField
public PdfFormComboBox(String name, String alternateName, String mappingName, int fieldFlags, Color borderColor, Color backgroundColor)
name
- name of the combo box in the documentalternateName
- alternate name of the combo box in the documentmappingName
- mapping name of the combo box in the documentfieldFlags
- form field flags
borderColor
- border color of the combo boxbackgroundColor
- background color of the combo boxPdfFormField
public PdfFormComboBox(String name, String alternateName, String mappingName, Color borderColor, Color backgroundColor)
name
- name of the combo box in the documentalternateName
- alternate name of the combo box in the documentmappingName
- mapping name of the combo box in the documentborderColor
- border color of the combo boxbackgroundColor
- background color of the combo boxPdfFormField
public PdfFormComboBox(String name, Color borderColor, Color backgroundColor)
name
- name of the combo box in the documentborderColor
- border color of the combo boxbackgroundColor
- background color of the combo boxPdfFormField
public PdfFormComboBox(PdfRect r, String name, int fieldFlags, Color borderColor, Color backgroundColor)
r
- bounding box of the combo boxname
- name of the combo box in the documentfieldFlags
- form field flags
borderColor
- border color of the combo boxbackgroundColor
- background color of the combo boxPdfFormField
public PdfFormComboBox(PdfRect r, String name, Color borderColor, Color backgroundColor)
r
- bounding box of the combo boxname
- name of the combo box in the documentborderColor
- border color of the combo boxbackgroundColor
- background color of the combo boxPdfFormField
public PdfFormComboBox(PdfRect r, String name, String alternateName, String mappingName, int fieldFlags, Color borderColor, Color backgroundColor)
r
- bounding box of the combo boxname
- name of the combo box in the documentalternateName
- alternate name of the combo box in the documentmappingName
- mapping name of the combo box in the documentfieldFlags
- form field flags
borderColor
- border color of the combo boxbackgroundColor
- background color of the combo boxPdfFormField
public PdfFormComboBox(PdfRect r, String name, String alternateName, String mappingName, Color borderColor, Color backgroundColor)
r
- bounding box of the combo boxname
- name of the combo box in the documentalternateName
- alternate name of the combo box in the documentmappingName
- alternate name of the combo box in the documentborderColor
- border color of the combo boxbackgroundColor
- background color of the combo boxPdfFormField
Method Detail |
public Object clone()
public boolean isEditable()
FLAG_EDITABLE
flag has been set
for the combo box.
FLAG_EDITABLE
flag has been setsetEditable(boolean)
public void setEditable(boolean editable)
FLAG_EDITABLE
flag needs to be
set for the combo box.
editable
- whether the FLAG_EDITABLE
flag needs to be
setisEditable()
public boolean isAutoAdjustTextHeight()
PdfFormChoiceField.setAutoAdjustTextHeight(boolean)
public void setAutoAdjustTextHeight(boolean autoAdjustFieldTextHeight)
autoAdjustFieldTextHeight
- whether the size of text inside text box, list box
and combo box form fields needs to be adjustedpublic int getAlignment()
constant
specifying the alignmentPdfFormChoiceField.setAlignment(int)
public void setAlignment(int alignment)
alignment
- constant
specifying the alignmentPdfFormChoiceField.getAlignment()
public void removeItem(String item)
item
- value of the option that needs to be deletedpublic void removeItem(int index)
index
- ordinal of the option that needs to be deletedpublic void addItem(String item)
item
- displayed value of the new option that needs to be addedpublic void addItem(String item, String exportValue)
item
- display value of the new option that needs to be
addedexportValue
- export value of the new option that needs to be
addedpublic void addItem(String item, boolean keepSelected)
item
- display value of the new option that needs to be
addedkeepSelected
- whether the option needs to be selectedpublic void addItem(String item, String exportValue, boolean keepSelected)
item
- display value of the new option that needs to be
addedexportValue
- export value of the new option that needs to be
addedkeepSelected
- whether the option needs to be selectedpublic boolean isMultiselect()
#setMultiselect(boolean)
public boolean isCommitOnSelectionChange()
PdfFormChoiceField.setCommitOnSelectionChange(boolean)
public void setCommitOnSelectionChange(boolean commitOnSelectionChange)
commitOnSelectionChange
- whether actions associated with the combo box/list
box need to be executed immediately when an option
is selectedPdfFormChoiceField.isCommitOnSelectionChange()
public void setValue(String value)
setValue
in class PdfFormField
value
- value that needs to be set as the selected optionPdfFormChoiceField.getValue()
public String getValue()
getValue
in class PdfFormField
PdfFormChoiceField.setValue(String)
public List getDisplayValues()
PdfFormChoiceField.getExportValues()
public List getExportValues()
PdfFormChoiceField.getDisplayValues()
|
Pro. Ed. v5.0.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |