@@ -66,7 +66,7 @@ public Set<SettingsEntry> getEntries() {
6666 }
6767
6868 public void registerSetting (SettingsEntry entry ) {
69- entries .put (entry .param , entry );
69+ entries .put (entry .key , entry );
7070
7171 JComponent item ;
7272 switch (entry .getType ()) {
@@ -94,7 +94,7 @@ public void registerSetting(SettingsEntry entry) {
9494 }
9595
9696 dialogPane .add (item , "align right" );
97- dialogPane .add (new JLabel (entry .key ), "wrap" );
97+ dialogPane .add (new JLabel (entry .name ), "wrap" );
9898 }
9999
100100 public void loadFrom (JsonObject rootSettings ) {
@@ -104,20 +104,20 @@ public void loadFrom(JsonObject rootSettings) {
104104 JsonObject thisDecompiler = decompilerSection .get (decompiler .getName ()).asObject ();
105105
106106 for (Map .Entry <SettingsEntry , JCheckBox > entry : booleanSettings .entrySet ()) {
107- if (thisDecompiler .get (entry .getKey ().param ) != null ) {
108- entry .getValue ().setSelected (thisDecompiler .get (entry .getKey ().param ).asBoolean ());
107+ if (thisDecompiler .get (entry .getKey ().key ) != null ) {
108+ entry .getValue ().setSelected (thisDecompiler .get (entry .getKey ().key ).asBoolean ());
109109 }
110110 }
111111
112112 for (Map .Entry <SettingsEntry , JTextArea > entry : stringSettings .entrySet ()) {
113- if (thisDecompiler .get (entry .getKey ().param ) != null ) {
114- entry .getValue ().setText (thisDecompiler .get (entry .getKey ().param ).asString ());
113+ if (thisDecompiler .get (entry .getKey ().key ) != null ) {
114+ entry .getValue ().setText (thisDecompiler .get (entry .getKey ().key ).asString ());
115115 }
116116 }
117117
118118 for (Map .Entry <SettingsEntry , JSpinner > entry : intSettings .entrySet ()) {
119- if (thisDecompiler .get (entry .getKey ().param ) != null ) {
120- entry .getValue ().setValue (thisDecompiler .get (entry .getKey ().param ).asInt ());
119+ if (thisDecompiler .get (entry .getKey ().key ) != null ) {
120+ entry .getValue ().setValue (thisDecompiler .get (entry .getKey ().key ).asInt ());
121121 }
122122 }
123123 }
@@ -134,27 +134,27 @@ public void saveTo(JsonObject rootSettings) {
134134 }
135135 JsonObject thisDecompiler = decompilerSection .get (decompiler .getName ()).asObject ();
136136 for (Map .Entry <SettingsEntry , JCheckBox > entry : booleanSettings .entrySet ()) {
137- thisDecompiler .add (entry .getKey ().param , entry .getValue ().isSelected ());
137+ thisDecompiler .add (entry .getKey ().key , entry .getValue ().isSelected ());
138138 }
139139 for (Map .Entry <SettingsEntry , JTextArea > entry : stringSettings .entrySet ()) {
140- thisDecompiler .add (entry .getKey ().param , entry .getValue ().getText ());
140+ thisDecompiler .add (entry .getKey ().key , entry .getValue ().getText ());
141141 }
142142 for (Map .Entry <SettingsEntry , JSpinner > entry : intSettings .entrySet ()) {
143- thisDecompiler .add (entry .getKey ().param , (Integer )entry .getValue ().getValue ());
143+ thisDecompiler .add (entry .getKey ().key , (Integer )entry .getValue ().getValue ());
144144 }
145145 }
146146
147147 // TODO: Refactor to have a default entry class for each type of entry, etc.
148148 public static class SettingsEntry extends Setting {
149- public final String param ;
149+ public final String key ;
150150
151- public SettingsEntry (String param , String key , Object value , SettingType type ) {
152- super (null , key , value , type );
153- this .param = param ;
151+ public SettingsEntry (String key , String name , Object value , SettingType type ) {
152+ super (null , name , value , type );
153+ this .key = key ;
154154 }
155155
156- public SettingsEntry (String param , String key , Object value ) {
157- this (param , key , value , SettingType .BOOLEAN );
156+ public SettingsEntry (String key , String name , Object value ) {
157+ this (key , name , value , SettingType .BOOLEAN );
158158 }
159159 }
160160}
0 commit comments