use of org.omegat.gui.preferences.PreferencesWindowController in project omegat by omegat-org.
the class MatchesTextArea method populatePaneMenu.
@Override
public void populatePaneMenu(JPopupMenu menu) {
populateContextMenu(menu, activeMatch);
menu.addSeparator();
final JMenuItem notify = new JCheckBoxMenuItem(OStrings.getString("GUI_MATCHWINDOW_SETTINGS_NOTIFICATIONS"));
notify.setSelected(Preferences.isPreference(Preferences.NOTIFY_FUZZY_MATCHES));
notify.addActionListener(e -> Preferences.setPreference(Preferences.NOTIFY_FUZZY_MATCHES, notify.isSelected()));
menu.add(notify);
menu.addSeparator();
final JMenuItem prefs = new JMenuItem(OStrings.getString("MATCHES_OPEN_PREFERENCES"));
prefs.addActionListener(e -> new PreferencesWindowController().show(Core.getMainWindow().getApplicationFrame(), TMMatchesPreferencesController.class));
menu.add(prefs);
}
use of org.omegat.gui.preferences.PreferencesWindowController in project omegat by omegat-org.
the class MachineTranslateTextArea method populatePaneMenu.
@Override
public void populatePaneMenu(JPopupMenu menu) {
final JMenuItem prefs = new JMenuItem(OStrings.getString("GUI_MACHINETRANSLATESWINDOW_OPEN_PREFS"));
prefs.addActionListener(e -> new PreferencesWindowController().show(Core.getMainWindow().getApplicationFrame(), MachineTranslationPreferencesController.class));
menu.add(prefs);
}
use of org.omegat.gui.preferences.PreferencesWindowController in project omegat by omegat-org.
the class TaaSPlugin method loadPlugins.
/**
* Register plugin into OmegaT.
*/
public static void loadPlugins() {
TaaSGlossary glossary;
TaaSClient client = getClient();
try {
client.init();
if (client.isAllowed()) {
glossary = new TaaSGlossary();
try (InputStream in = TaaSGlossary.class.getResourceAsStream("filter.xslt")) {
if (in == null) {
throw new Exception("filter.xslt is unaccessible");
}
TransformerFactory factory = TransformerFactory.newInstance();
Source xslt = new StreamSource(in);
filterTransformer = factory.newTransformer(xslt);
}
} else {
glossary = null;
}
} catch (Exception ex) {
Log.log(ex);
return;
}
CoreEvents.registerApplicationEventListener(new IApplicationEventListener() {
public void onApplicationStartup() {
JMenuItem lookup = new JCheckBoxMenuItem();
lookup.setSelected(Preferences.isPreferenceDefault(Preferences.TAAS_LOOKUP, false));
Mnemonics.setLocalizedText(lookup, OStrings.getString("TAAS_MENU_LOOKUP"));
lookup.addActionListener(e -> {
if (client.isAllowed()) {
Preferences.setPreference(Preferences.TAAS_LOOKUP, lookup.isSelected());
Preferences.save();
} else {
lookup.setSelected(false);
new PreferencesWindowController().show(Core.getMainWindow().getApplicationFrame(), TaaSPreferencesController.class);
}
});
Core.getMainWindow().getMainMenu().getGlossaryMenu().add(lookup);
PreferencesControllers.addSupplier(TaaSPreferencesController::new);
Preferences.addPropertyChangeListener(Preferences.TAAS_LOOKUP, e -> lookup.setSelected((Boolean) e.getNewValue()));
if (client.isAllowed()) {
Core.getGlossaryManager().addGlossaryProvider(glossary);
}
}
public void onApplicationShutdown() {
}
});
}
use of org.omegat.gui.preferences.PreferencesWindowController in project omegat by omegat-org.
the class MainWindowMenuHandler method optionsPreferencesMenuItemActionPerformed.
public void optionsPreferencesMenuItemActionPerformed() {
PreferencesWindowController pwc = new PreferencesWindowController();
pwc.show(Core.getMainWindow().getApplicationFrame());
}
Aggregations