Package net.mcreator.preferences.entries
Class StringEntry
-
Field Summary
Fields inherited from class net.mcreator.preferences.PreferencesEntry
value
-
Constructor Summary
ConstructorDescriptionStringEntry
(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 aJComponent
for thePreferencesDialog
, so users can change the value.com.google.gson.JsonElement
void
setValueFromComponent
(JComponent component) void
setValueFromJsonElement
(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:PreferencesEntry
Generate a
JComponent
for thePreferencesDialog
, so users can change the value.- Specified by:
getComponent
in classPreferencesEntry<String>
- Parameters:
parent
-The component's parent, which is the opened
PreferencesDialog
.fct
-This is the
Consumer
used to enable the apply button when the value of theJComponent
is changed.- Returns:
The
JComponent
to use inside thePreferencesDialog
for all preference entries using the same type.
-
setValueFromComponent
- Specified by:
setValueFromComponent
in classPreferencesEntry<String>
-
setValueFromJsonElement
public void setValueFromJsonElement(com.google.gson.JsonElement object) - Specified by:
setValueFromJsonElement
in classPreferencesEntry<String>
-
getSerializedValue
public com.google.gson.JsonElement getSerializedValue()- Specified by:
getSerializedValue
in classPreferencesEntry<String>
-