public class DropdownSearchField extends SearchField
Modifier and Type | Class and Description |
---|---|
static class |
DropdownSearchField.Option
Represents a dropdown option.
|
SearchField.Meaning, SearchField.OrderComparator
Modifier and Type | Field and Description |
---|---|
protected java.util.List<DropdownSearchField.Option> |
dropdownValues |
advanced, data, displayName, id, meaning, visible
Constructor and Description |
---|
DropdownSearchField() |
DropdownSearchField(java.lang.String id,
java.lang.String displayName,
boolean advanced,
java.util.List<DropdownSearchField.Option> dropdownValues)
A new dropdown SearchField
|
Modifier and Type | Method and Description |
---|---|
void |
addDropdownValue(int index,
java.lang.String key,
java.lang.String value) |
void |
addDropdownValue(java.lang.String key,
java.lang.String value) |
java.util.List<DropdownSearchField.Option> |
getDropdownValues()
Get the list of selectable values.
|
void |
setDropdownValues(java.util.List<DropdownSearchField.Option> dropdownValues)
Set a list of values for the dropdown list.
|
org.json.JSONObject |
toJSON()
Serialize a SearchField to a JSONObject.
|
fromJSON, getData, getDisplayName, getId, getMeaning, isAdvanced, isVisible, setAdvanced, setData, setDisplayName, setId, setMeaning, setVisible, toString
protected java.util.List<DropdownSearchField.Option> dropdownValues
public DropdownSearchField()
public DropdownSearchField(java.lang.String id, java.lang.String displayName, boolean advanced, java.util.List<DropdownSearchField.Option> dropdownValues)
id
- ID of the search field, later given to your search() functiondisplayName
- The name to display for the search fieldadvanced
- Set if this field should only be shown when showing the
advanced search formdropdownValues
- The values to show in the dropdown and their keys. If you
include one with an empty key, this is going to be the default
value and will not be given to the search() functionpublic java.util.List<DropdownSearchField.Option> getDropdownValues()
public void setDropdownValues(java.util.List<DropdownSearchField.Option> dropdownValues)
public void addDropdownValue(java.lang.String key, java.lang.String value)
public void addDropdownValue(int index, java.lang.String key, java.lang.String value)
public org.json.JSONObject toJSON() throws org.json.JSONException
SearchField
toJSON
in class SearchField
org.json.JSONException