public final class PluginDataFieldList extends PluginDataField<java.lang.Integer>
PluginDataField of a list of values.
This is used to show a selection of an item in a list.
The getSelectedIndex() and PluginDataField.getValue() methods returns the index of the selected item in the list, while getItems() returns the items.PluginDataFieldPluginDataField.FieldTypeJSON_FIELD_VALUE| Constructor and Description |
|---|
PluginDataFieldList(int id,
java.lang.String title,
java.lang.String description,
java.lang.String[] items,
java.lang.Integer selectedIndex)
Instantiates a new plugin data field of type list.
|
PluginDataFieldList(org.json.JSONObject fieldJson)
Do not use - for internal use only
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Integer |
getFieldValue(org.json.JSONObject fieldJson,
java.lang.String jsonFieldValue)
Gets the field value.
|
java.lang.String[] |
getItems()
Gets the items.
|
java.lang.Integer |
getSelectedIndex()
Gets the selected index.
|
org.json.JSONObject |
serialize()
Do not use - for internal use only
|
createNewField, getDescription, getId, getTitle, getType, getValue, setValue, setValueGenericpublic PluginDataFieldList(int id,
java.lang.String title,
java.lang.String description,
java.lang.String[] items,
java.lang.Integer selectedIndex)
id - The field id. To be used with PluginDataFieldCollection.getFieldById(int) to retrieve the field from a data fields collectiontitle - The field title to show within AutomateIt when editing the related PluginAction or PluginTriggerdescription - The field description to show within AutomateIt when editing the related PluginAction or PluginTriggeritems - The list of items that the user can select fromselectedIndex - An initial selection index. must be within bounds of the items parameterpublic PluginDataFieldList(org.json.JSONObject fieldJson)
protected java.lang.Integer getFieldValue(org.json.JSONObject fieldJson,
java.lang.String jsonFieldValue)
PluginDataFieldgetFieldValue in class PluginDataField<java.lang.Integer>fieldJson - the field jsonjsonFieldValue - the json field valuepublic org.json.JSONObject serialize()
PluginDataFieldserialize in class PluginDataField<java.lang.Integer>public java.lang.Integer getSelectedIndex()
public java.lang.String[] getItems()