public class ComboBox extends ChoiceField
| Modifier and Type | Method and Description |
|---|---|
static ComboBox |
create(Document targetDocument)
Create a combo box form field
|
static ComboBox |
createDynamicObject(long handle) |
boolean |
getCanEdit()
Has an editable item (Getter)
|
ChoiceItem |
getChosenItem()
The selected combo box item (Getter)
|
java.lang.String |
getEditableItemName()
The name of the editable item (Getter)
|
void |
setCanEdit(boolean value)
Has an editable item (Setter)
|
void |
setChosenItem(ChoiceItem value)
The selected combo box item (Setter)
|
void |
setEditableItemName(java.lang.String value)
The name of the editable item (Setter)
|
addNewItem, getItemsaddNewWidget, getDoNotExport, getReadOnly, getRequired, getWidgets, setDoNotExport, setReadOnly, setRequiredcopy, getDisplayName, getExportName, setDisplayName, setExportNameequals, hashCodepublic static ComboBox createDynamicObject(long handle)
public static ComboBox create(Document targetDocument)
targetDocument - the output document with which the returned object is associatedjava.lang.IllegalArgumentException - if the targetDocument argument is nulljava.lang.IllegalArgumentException - if the targetDocument argument has already been closedjava.lang.IllegalArgumentException - if the targetDocument argument is read-onlyjava.lang.IllegalArgumentException - the target document contains form fields that have been implicitly copied by a call to
pdftoolbox.pdf.Page.copy with an argument options in which
pdftoolbox.pdf.PageCopyOptions.setFormFields was set to FormFieldCopyStrategy.COPYjava.lang.IllegalArgumentException - the target document contains unsigned signatures that have been implicitly copied by a call to
pdftoolbox.pdf.Page.copy with an argument options in which
pdftoolbox.pdf.PageCopyOptions.setUnsignedSignatures was set to pdftoolbox.pdf.CopyStrategy.COPY.public boolean getCanEdit()
java.lang.IllegalStateException - if the object has already been closedpublic void setCanEdit(boolean value)
java.lang.IllegalStateException - if the object has already been closedjava.lang.UnsupportedOperationException - if the document is read-onlypublic ChoiceItem getChosenItem()
null then the getEditableItemName() is the selected value.
Setting this property automatically sets getEditableItemName() to null.java.lang.IllegalStateException - if the object has already been closedpublic void setChosenItem(ChoiceItem value)
null then the getEditableItemName() is the selected value.
Setting this property automatically sets getEditableItemName() to null.java.lang.IllegalStateException - if the object has already been closedjava.lang.UnsupportedOperationException - if the document is read-onlyjava.lang.IllegalArgumentException - if the provided choice item object does not belong to the combo box fieldjava.lang.IllegalStateException - if the form field is marked as read-onlyjava.lang.IllegalStateException - if the form field has widgetspublic java.lang.String getEditableItemName()
null if any of the combo box items is selected, i.e., if getChosenItem() is not null.
Setting this property automatically sets getChosenItem() to null.java.lang.IllegalStateException - if the object has already been closedpublic void setEditableItemName(java.lang.String value)
null if any of the combo box items is selected, i.e., if getChosenItem() is not null.
Setting this property automatically sets getChosenItem() to null.java.lang.IllegalStateException - if the object has already been closedjava.lang.UnsupportedOperationException - if the document is read-onlyjava.lang.IllegalStateException - if the form field has no editable item (getCanEdit() property is false)java.lang.IllegalStateException - if the form field is marked as read-onlyjava.lang.IllegalStateException - if the form field has widgets