ChoiceField
Inheritance: java.lang.Object, com.aspose.pdf.BaseParagraph, com.aspose.pdf.Annotation, com.aspose.pdf.WidgetAnnotation, com.aspose.pdf.Field
public abstract class ChoiceField extends Field
Represents base class for choice fields.
Constructors
Constructor | Description |
---|---|
ChoiceField(Page page, Rectangle rect) | Constructor for ChoiceField. |
ChoiceField(IDocument doc) | Creates choice field (for Generator) |
ChoiceField(IDocument doc, Rectangle rect) | Constructor for ChoiceField. |
Methods
Method | Description |
---|---|
getCommitImmediately() | Gets commit on selection change flag. |
setCommitImmediately(boolean value) | Sets commit on selection change flag. |
getMultiSelect() | Gets multiselection flag. |
setMultiSelect(boolean value) | Sets multiselection flag. |
getSelected() | Gets index of selected option. |
setSelected(int value) | Sets index of selected option. |
getSelectedItems() | Sets array of selected items. |
setSelectedItems(int[] value) | Sets array of selected items. |
getOptions() | Gets collection of choice options. |
setOptions(List | Replaces the available options with those whose names are given in the options parameter. |
addOption(String optionName) | Adds new option with specified name. |
addOption(String export, String name) | Adds new option with specified export value and name. |
deleteOption(String optionName) | Deletes option by its name. |
getValue() | Gets value of the field. |
setValue(String value) | Sets value of the field. |
ChoiceField(Page page, Rectangle rect)
public ChoiceField(Page page, Rectangle rect)
Constructor for ChoiceField.
Parameters:
Parameter | Type | Description |
---|---|---|
page | Page | Page where field is situated. |
rect | Rectangle | Rectangle of the field. |
ChoiceField(IDocument doc)
public ChoiceField(IDocument doc)
Creates choice field (for Generator)
Parameters:
Parameter | Type | Description |
---|---|---|
doc | IDocument | Document where choice field will be created. |
ChoiceField(IDocument doc, Rectangle rect)
public ChoiceField(IDocument doc, Rectangle rect)
Constructor for ChoiceField.
Parameters:
Parameter | Type | Description |
---|---|---|
doc | IDocument | Document where field will be created. |
rect | Rectangle | Rectangle of the field. |
getCommitImmediately()
public boolean getCommitImmediately()
Gets commit on selection change flag.
Returns: boolean - boolean value
setCommitImmediately(boolean value)
public void setCommitImmediately(boolean value)
Sets commit on selection change flag.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | boolean value |
getMultiSelect()
public boolean getMultiSelect()
Gets multiselection flag.
Returns: boolean - boolean value
setMultiSelect(boolean value)
public void setMultiSelect(boolean value)
Sets multiselection flag.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | boolean value |
getSelected()
public int getSelected()
Gets index of selected option. This property allows to change selection.
Returns: int - int value
setSelected(int value)
public void setSelected(int value)
Sets index of selected option. This property allows to change selection.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int | int value |
getSelectedItems()
public int[] getSelectedItems()
Sets array of selected items. For multiselect list array contains more then one item. For single selection list it contains single item.
Returns: int[] - array of int values
setSelectedItems(int[] value)
public void setSelectedItems(int[] value)
Sets array of selected items. For multiselect list array contains more then one item. For single selection list it contains single item.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int[] | array of int values |
getOptions()
public OptionCollection getOptions()
Gets collection of choice options.
Returns: OptionCollection - OptionCollection object
setOptions(List options)
public final void setOptions(List<String> options)
Replaces the available options with those whose names are given in the options parameter.
Parameters:
Parameter | Type | Description |
---|---|---|
options | java.util.List<java.lang.String> | List of names for new options. |
addOption(String optionName)
public void addOption(String optionName)
Adds new option with specified name.
Parameters:
Parameter | Type | Description |
---|---|---|
optionName | java.lang.String | Name of the new option. |
addOption(String export, String name)
public void addOption(String export, String name)
Adds new option with specified export value and name.
Parameters:
Parameter | Type | Description |
---|---|---|
export | java.lang.String | Export value. |
name | java.lang.String | Name of the new option. |
deleteOption(String optionName)
public void deleteOption(String optionName)
Deletes option by its name.
Parameters:
Parameter | Type | Description |
---|---|---|
optionName | java.lang.String | Name of the option which must be deleted. |
getValue()
public String getValue()
Gets value of the field.
Returns: java.lang.String - String value
setValue(String value)
public void setValue(String value)
Sets value of the field.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String | String value |