public class DropdownFormElement extends FormElement implements ModifiableFormElement
CustomForm.GSON, translator| Constructor and Description |
|---|
DropdownFormElement(java.lang.String text,
int defaultOption,
java.lang.String... options) |
DropdownFormElement(java.lang.String text,
java.lang.String... options) |
| Modifier and Type | Method and Description |
|---|---|
void |
deserialize(com.google.gson.JsonElement element)
Deserialize the element from a json element.
|
int |
getDefaultOption() |
java.lang.String[] |
getOptions() |
java.lang.String[] |
getOptions(boolean translate)
Get the options of the dropdown.
|
int |
getSelected() |
com.google.gson.JsonElement |
serialize()
Serialize the element to a json element.
|
void |
setSelected(int selected)
Set the selected option of the dropdown.
|
getText, getText, getTranslator, getType, setTranslatorpublic DropdownFormElement(java.lang.String text,
java.lang.String... options)
public DropdownFormElement(java.lang.String text,
int defaultOption,
java.lang.String... options)
public int getDefaultOption()
public java.lang.String[] getOptions()
public java.lang.String[] getOptions(boolean translate)
translate - If the options should be translatedpublic int getSelected()
public void setSelected(int selected)
selected - The new selected option@Nullable public com.google.gson.JsonElement serialize()
ModifiableFormElementserialize in interface ModifiableFormElementpublic void deserialize(com.google.gson.JsonElement element)
throws com.google.gson.JsonParseException
ModifiableFormElementdeserialize in interface ModifiableFormElementelement - The serialized elementcom.google.gson.JsonParseException - If the element is not valid