diff --git a/src/org/omegat/gui/editor/IEditorSettings.java b/src/org/omegat/gui/editor/IEditorSettings.java index b7785b877c..b9b313bd97 100644 --- a/src/org/omegat/gui/editor/IEditorSettings.java +++ b/src/org/omegat/gui/editor/IEditorSettings.java @@ -75,6 +75,10 @@ public interface IEditorSettings { void setMarkBidi(boolean markBidi); + boolean isMarkAltTranslations(); + + void setMarkAltTranslations(boolean markAltTranslations); + boolean isAutoSpellChecking(); void setAutoSpellChecking(boolean isNeedToSpell); diff --git a/src/org/omegat/gui/editor/MarkerController.java b/src/org/omegat/gui/editor/MarkerController.java index 9753c59e93..8efe157241 100644 --- a/src/org/omegat/gui/editor/MarkerController.java +++ b/src/org/omegat/gui/editor/MarkerController.java @@ -87,6 +87,7 @@ public static void init() throws Exception { Core.registerMarker(new ComesFromMTMarker()); Core.registerMarker(new FontFallbackMarker()); Core.registerMarker(new SpellCheckerMarker()); + Core.registerMarker(new AltTranslationsMarker()); } diff --git a/src/org/omegat/gui/editor/mark/AltTranslationsMarker.java b/src/org/omegat/gui/editor/mark/AltTranslationsMarker.java index 92422e20a6..f35ed18b74 100644 --- a/src/org/omegat/gui/editor/mark/AltTranslationsMarker.java +++ b/src/org/omegat/gui/editor/mark/AltTranslationsMarker.java @@ -27,7 +27,6 @@ import org.omegat.core.Core; import org.omegat.core.data.SourceTextEntry; -import org.omegat.gui.editor.EditorSettings; import org.omegat.util.gui.Styles; import javax.swing.text.Highlighter; @@ -39,19 +38,13 @@ public class AltTranslationsMarker extends AbstractMarker { private final Highlighter.HighlightPainter painter = new TransparentHighlightPainter( Styles.EditorColor.COLOR_MARK_ALT_TRANSLATION.getColor(), 0.5F); - public static void loadPlugins() { - Core.registerMarkerClass(AltTranslationsMarker.class); - } - public static void unloadPlugins() { - } - public AltTranslationsMarker() throws Exception { super(); } @Override protected boolean isEnabled() { - return ((EditorSettings) Core.getEditor().getSettings()).isMarkAltTranslations(); + return Core.getEditor().getSettings().isMarkAltTranslations(); } @Override diff --git a/src/org/omegat/gui/main/BaseMainWindowMenu.java b/src/org/omegat/gui/main/BaseMainWindowMenu.java index 5afb3b3144..5048808df5 100644 --- a/src/org/omegat/gui/main/BaseMainWindowMenu.java +++ b/src/org/omegat/gui/main/BaseMainWindowMenu.java @@ -898,7 +898,7 @@ protected void updateCheckboxesOnStart() { viewMarkNotedSegmentsCheckBoxMenuItem .setSelected(Core.getEditor().getSettings().isMarkNotedSegments()); viewMarkAlternativeTranslationsCheckBoxMenuItem - .setSelected(((EditorSettings) Core.getEditor().getSettings()).isMarkAltTranslations()); + .setSelected(Core.getEditor().getSettings().isMarkAltTranslations()); viewMarkNBSPCheckBoxMenuItem.setSelected(Core.getEditor().getSettings().isMarkNBSP()); viewMarkWhitespaceCheckBoxMenuItem.setSelected(Core.getEditor().getSettings().isMarkWhitespace()); viewMarkBidiCheckBoxMenuItem.setSelected(Core.getEditor().getSettings().isMarkBidi()); diff --git a/src/org/omegat/gui/main/MainWindowMenuHandler.java b/src/org/omegat/gui/main/MainWindowMenuHandler.java index 3560fdb10a..10bb84728f 100644 --- a/src/org/omegat/gui/main/MainWindowMenuHandler.java +++ b/src/org/omegat/gui/main/MainWindowMenuHandler.java @@ -696,7 +696,8 @@ public void viewMarkBidiCheckBoxMenuItemActionPerformed() { } public void viewMarkAlternativeTranslationsCheckBoxMenuItemActionPerformed() { - ((EditorSettings) Core.getEditor().getSettings()) + Core.getEditor() + .getSettings() .setMarkAltTranslations( mainWindow.menu.viewMarkAlternativeTranslationsCheckBoxMenuItem.isSelected()); }