public abstract class PDButton extends PDTerminalField
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 |
setValue(int index)
Set the selected option given its index, and try to update the visual appearance.
|
void |
setValue(String value)
Set the selected option given its name, and try to update the visual appearance.
|
applyChange, getFieldFlags, getFieldType, 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 boolean isPushButton()
public boolean isRadioButton()
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 void setValue(int index) throws IOException
index
- index of option to be selectedIOException
- if the value could not be setIllegalArgumentException
- if the index provided is not a valid index.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–2025 The Apache Software Foundation. All rights reserved.