use of org.omegat.core.spellchecker.ISpellChecker in project omegat by omegat-org.
the class SpellcheckerConfigurationController method persist.
@Override
public void persist() {
boolean isNeedToSpell = panel.autoSpellcheckCheckBox.isSelected();
Preferences.setPreference(Preferences.ALLOW_AUTO_SPELLCHECKING, isNeedToSpell);
Preferences.setPreference(Preferences.SPELLCHECKER_DICTIONARY_DIRECTORY, panel.directoryTextField.getText());
Preferences.setPreference(Preferences.SPELLCHECKER_DICTIONARY_URL, panel.dictionaryUrlTextField.getText());
if (isNeedToSpell && Core.getProject().isProjectLoaded()) {
ISpellChecker sc = Core.getSpellChecker();
sc.destroy();
sc.initialize();
}
SwingUtilities.invokeLater(() -> Core.getEditor().getSettings().setAutoSpellChecking(isNeedToSpell));
}
Aggregations