public abstract class PDButton extends PDTerminalField
Constructor and Description |
---|
PDButton(PDAcroForm acroForm) |
Modifier and Type | Method and Description |
---|---|
String |
getDefaultValue()
Returns the default value, if any.
|
List<String> |
getExportValues()
This will get the (optional) export values.
|
Set<String> |
getOnValues()
Get the values to set individual buttons within a group to the on state.
|
String |
getValue()
Returns the selected value.
|
String |
getValueAsString()
Returns a string representation of the "V" entry, or an empty string.
|
boolean |
isPushButton()
Determines if push button bit is set.
|
boolean |
isRadioButton()
Determines if radio button bit is set.
|
void |
setDefaultValue(String value)
Sets the default value.
|
void |
setExportValues(List<String> values)
This will set the export values.
|
void |
setPushButton(boolean pushbutton)
Set the push button bit.
|
void |
setRadioButton(boolean radiobutton)
Set the radio button bit.
|
void |
setValue(String value)
Sets the selected option given its name.
|
applyChange, getFieldFlags, getFieldType, getWidget, getWidgets, importFDF, setActions, setWidgets
getAcroForm, getActions, getAlternateFieldName, getCOSObject, getFullyQualifiedName, getInheritableAttribute, getMappingName, getParent, getPartialName, isNoExport, isReadOnly, isRequired, setAlternateFieldName, setFieldFlags, setMappingName, setNoExport, setPartialName, setReadOnly, setRequired, toString
public PDButton(PDAcroForm acroForm)
acroForm
- The acroform.PDField.PDField(PDAcroForm)
public boolean isPushButton()
public void setPushButton(boolean pushbutton)
pushbutton
- if true the button field is treated as a push button field.public boolean isRadioButton()
public void setRadioButton(boolean radiobutton)
radiobutton
- if true the button field is treated as a radio button field.public String getValue()
Off is the default value which will also be returned if the value hasn't been set at all.
public void setValue(String value) throws IOException
setValue
in class PDField
value
- Name of option to selectIOException
- if the value could not be setIllegalArgumentException
- if the value is not a valid option.public String getDefaultValue()
public void setDefaultValue(String value)
value
- Name of option to selectIllegalArgumentException
- if the value is not a valid option.public String getValueAsString()
PDField
getValueAsString
in class PDField
public List<String> getExportValues()
The export values are defined in the field dictionaries /Opt key.
The option values are used to define the export values for the field to
getOnValues()
public void setExportValues(List<String> values)
values
- List containing all possible export values. Supplying null or an empty list will remove the Opt entry.getExportValues()
public Set<String> getOnValues()
The On value could be an arbitrary string as long as it is within the limitations of a PDF name object. The Off value shall always be 'Off'. If not set or not part of the normal appearance keys 'Off' is the default
Copyright © 2002–2018 The Apache Software Foundation. All rights reserved.