use of com.eclipsesource.json.ParseException in project bytecode-viewer by Konloch.
the class Settings method loadGUI.
public static void loadGUI() {
try {
JsonObject settings = new JsonObject();
try {
settings = JsonObject.readFrom(new FileReader(BytecodeViewer.settingsFile));
} catch (ParseException | UnsupportedOperationException e) {
}
Decompiler.CFR.getSettings().loadFrom(settings);
Decompiler.FERNFLOWER.getSettings().loadFrom(settings);
Decompiler.PROCYON.getSettings().loadFrom(settings);
Decompiler.BYTECODE.getSettings().loadFrom(settings);
if (settings.get("settings") != null) {
JsonObject rootSettings = settings.get("settings").asObject();
for (Map.Entry<String, Settings> setting : Settings.ALL_SETTINGS.entrySet()) {
if (rootSettings.get(setting.getKey()) != null) {
setting.getValue().set(rootSettings.get(setting.getKey()).asString());
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations