@@ -64,6 +64,7 @@ public class SwingWindow
64
64
private static JCheckBoxMenuItem enableDarkLaf ;
65
65
private static final Map <Class <?>, String > TRANSFORMER_TO_NAME = new HashMap <>();
66
66
private static final Map <String , Class <?>> NAME_TO_TRANSFORMER = new HashMap <>();
67
+ private static DefaultListModel <TransformerWithConfig > transformerSelected ;
67
68
68
69
public static void main (String [] args )
69
70
{
@@ -138,8 +139,7 @@ public void actionPerformed(ActionEvent e)
138
139
return ;
139
140
}
140
141
GuiConfig .setDarkLaf (false );
141
- GuiConfig .setDarklafSettings (ThemeSettings .getInstance ().exportConfiguration ());
142
- GuiConfig .save ();
142
+ writeAndSaveGuiConfig (fields );
143
143
System .exit (0 );
144
144
}
145
145
}
@@ -371,7 +371,7 @@ public void actionPerformed(ActionEvent e)
371
371
}
372
372
//Second list (selected)
373
373
JScrollPane transformerSelectedScroll = new JScrollPane ();
374
- DefaultListModel < TransformerWithConfig > transformerSelected = new DefaultListModel <>();
374
+ transformerSelected = new DefaultListModel <>();
375
375
JList <TransformerWithConfig > selectedJList = new JList <>(transformerSelected );
376
376
selectedJList .setSelectionMode (ListSelectionModel .MULTIPLE_INTERVAL_SELECTION );
377
377
selectedJList .setModel (transformerSelected );
@@ -1104,17 +1104,22 @@ public void windowClosing(WindowEvent e)
1104
1104
@ Override
1105
1105
public void windowClosing (WindowEvent e )
1106
1106
{
1107
- GuiConfig .setLimitConsoleLines (shouldLimitLines .getState ());
1108
- GuiConfig .setStoreConfigOnClose (storeConfigOnClose .getState ());
1109
- GuiConfig .setConfig (createConfig (fields , transformerSelected ));
1110
- GuiConfig .setDarklafSettings (ThemeSettings .getInstance ().exportConfiguration ());
1111
- GuiConfig .save ();
1107
+ writeAndSaveGuiConfig (fields );
1112
1108
}
1113
1109
});
1114
1110
1115
1111
frame .setVisible (true );
1116
1112
}
1117
1113
1114
+ private static void writeAndSaveGuiConfig (List <ConfigItem > fields )
1115
+ {
1116
+ GuiConfig .setLimitConsoleLines (shouldLimitLines .getState ());
1117
+ GuiConfig .setStoreConfigOnClose (storeConfigOnClose .getState ());
1118
+ GuiConfig .setConfig (createConfig (fields , transformerSelected ));
1119
+ GuiConfig .setDarklafSettings (ThemeSettings .getInstance ().exportConfiguration ());
1120
+ GuiConfig .save ();
1121
+ }
1122
+
1118
1123
private static void readAndApplyConfig (List <ConfigItem > fields , DefaultListModel <TransformerWithConfig > transformerSelected , String args1 )
1119
1124
{
1120
1125
List <String > split = splitQuoteAware (args1 , ' ' );
0 commit comments