Package net.mcreator.preferences.entries
Class StringEntry
-
Field Summary
Fields inherited from class net.mcreator.preferences.PreferencesEntry
value -
Constructor Summary
ConstructorsConstructorDescriptionStringEntry(String id, String value, boolean editable, String... choices) StringEntry(String id, String value, String... choices) -
Method Summary
Modifier and TypeMethodDescriptiongetComponent(Window parent, Consumer<EventObject> fct) Generate aJComponentfor thePreferencesDialog, so users can change the value.com.google.gson.JsonElementvoidsetValueFromComponent(JComponent component) voidsetValueFromJsonElement(com.google.gson.JsonElement object) Methods inherited from class net.mcreator.preferences.PreferencesEntry
get, getID, getSection, getSectionKey, reset, set, toString
-
Constructor Details
-
StringEntry
-
StringEntry
-
-
Method Details
-
getComponent
Description copied from class:PreferencesEntryGenerate a
JComponentfor thePreferencesDialog, so users can change the value.- Specified by:
getComponentin classPreferencesEntry<String>- Parameters:
parent-The component's parent, which is the opened
PreferencesDialog.fct-This is the
Consumerused to enable the apply button when the value of theJComponentis changed.- Returns:
The
JComponentto use inside thePreferencesDialogfor all preference entries using the same type.
-
setValueFromComponent
- Specified by:
setValueFromComponentin classPreferencesEntry<String>
-
setValueFromJsonElement
public void setValueFromJsonElement(com.google.gson.JsonElement object) - Specified by:
setValueFromJsonElementin classPreferencesEntry<String>
-
getSerializedValue
public com.google.gson.JsonElement getSerializedValue()- Specified by:
getSerializedValuein classPreferencesEntry<String>
-