use of jadx.gui.utils.LangLocale in project jadx by skylot.
the class JadxSettingsWindow method makeOtherGroup.
private SettingsGroup makeOtherGroup() {
JComboBox<LangLocale> languageCbx = new JComboBox<>(NLS.getLangLocales());
for (LangLocale locale : NLS.getLangLocales()) {
if (locale.equals(settings.getLangLocale())) {
languageCbx.setSelectedItem(locale);
break;
}
}
languageCbx.addActionListener(e -> settings.setLangLocale((LangLocale) languageCbx.getSelectedItem()));
JComboBox<LineNumbersMode> lineNumbersMode = new JComboBox<>(LineNumbersMode.values());
lineNumbersMode.setSelectedItem(settings.getLineNumbersMode());
lineNumbersMode.addActionListener(e -> {
settings.setLineNumbersMode((LineNumbersMode) lineNumbersMode.getSelectedItem());
mainWindow.loadSettings();
});
JCheckBox update = new JCheckBox();
update.setSelected(settings.isCheckForUpdates());
update.addItemListener(e -> settings.setCheckForUpdates(e.getStateChange() == ItemEvent.SELECTED));
JCheckBox cfg = new JCheckBox();
cfg.setSelected(settings.isCfgOutput());
cfg.addItemListener(e -> {
settings.setCfgOutput(e.getStateChange() == ItemEvent.SELECTED);
needReload();
});
JCheckBox rawCfg = new JCheckBox();
rawCfg.setSelected(settings.isRawCfgOutput());
rawCfg.addItemListener(e -> {
settings.setRawCfgOutput(e.getStateChange() == ItemEvent.SELECTED);
needReload();
});
SettingsGroup group = new SettingsGroup(NLS.str("preferences.other"));
group.addRow(NLS.str("preferences.language"), languageCbx);
group.addRow(NLS.str("preferences.lineNumbersMode"), lineNumbersMode);
group.addRow(NLS.str("preferences.check_for_updates"), update);
group.addRow(NLS.str("preferences.cfg"), cfg);
group.addRow(NLS.str("preferences.raw_cfg"), rawCfg);
return group;
}
Aggregations