* refactor
This commit is contained in:
parent
3f65c370a5
commit
b2685c0427
|
@ -406,17 +406,17 @@ public class RenamePanel extends JComponent {
|
||||||
List<String> presetNames = new ArrayList<String>(persistentPresets.keySet());
|
List<String> presetNames = new ArrayList<String>(persistentPresets.keySet());
|
||||||
presetNames.add(newPresetOption);
|
presetNames.add(newPresetOption);
|
||||||
|
|
||||||
String selection = (String) JOptionPane.showInputDialog(getWindow(evt.getSource()), "Edit or create a preset:", "Edit Preset", JOptionPane.PLAIN_MESSAGE, null, presetNames.toArray(), newPresetOption);
|
String selection = (String) showInputDialog(getWindow(evt.getSource()), "Edit or create a preset:", "Edit Preset", PLAIN_MESSAGE, null, presetNames.toArray(), newPresetOption);
|
||||||
if (selection == null)
|
if (selection == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Preset preset = null;
|
Preset preset = null;
|
||||||
if (selection == newPresetOption) {
|
if (selection == newPresetOption) {
|
||||||
selection = (String) JOptionPane.showInputDialog(getWindow(evt.getSource()), "Preset Name:", newPresetOption, JOptionPane.PLAIN_MESSAGE, null, null, "My Preset");
|
selection = (String) showInputDialog(getWindow(evt.getSource()), "Preset Name:", newPresetOption, PLAIN_MESSAGE, null, null, "My Preset");
|
||||||
if (selection == null)
|
if (selection == null || selection.trim().isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
preset = new Preset(selection, null, null, null, null, null, null, null, null);
|
preset = new Preset(selection.trim(), null, null, null, null, null, null, null, null);
|
||||||
} else {
|
} else {
|
||||||
preset = (Preset) JsonReader.jsonToJava(persistentPresets.get(selection.toString()));
|
preset = (Preset) JsonReader.jsonToJava(persistentPresets.get(selection.toString()));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue