AbstractAlignmentEditorHandler added.
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / handler / alignmenteditor / CutPherogramRightHandler.java
index 15c07fb5849f32f2be94e233d4e41fe9c754c281..7844fc610c814dcb8f42da0cf2fd023e3471155b 100644 (file)
 package eu.etaxonomy.taxeditor.editor.handler.alignmenteditor;\r
 \r
 \r
-import org.eclipse.core.commands.AbstractHandler;\r
 import org.eclipse.core.commands.ExecutionEvent;\r
 import org.eclipse.core.commands.ExecutionException;\r
-import org.eclipse.ui.IEditorPart;\r
 \r
 import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor;\r
-import eu.etaxonomy.taxeditor.model.AbstractUtility;\r
 import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
 \r
 \r
@@ -28,16 +25,12 @@ import eu.etaxonomy.taxeditor.model.MessagingUtils;
  * @author BenStoever\r
  * @date 15.06.2015\r
  */\r
-public class CutPherogramRightHandler extends AbstractHandler {\r
+public class CutPherogramRightHandler extends AbstractAlignmentEditorHandler {\r
     @Override\r
-    public Object execute(ExecutionEvent event) throws ExecutionException {\r
-        IEditorPart activeEditor = AbstractUtility.getActiveEditor();\r
-        if (activeEditor instanceof AlignmentEditor) {\r
-            String errorMessage = ((AlignmentEditor)activeEditor).cutPherogramRight();\r
-            if (errorMessage != null) {\r
-                MessagingUtils.errorDialog("Unable to cut base call sequence", this, errorMessage, "eu.etaxonomy.taxeditor.editor", null, false);  //TODO set pluginID\r
-            }\r
+    public void doExecute(ExecutionEvent event, AlignmentEditor editor) throws ExecutionException {\r
+        String errorMessage = editor.cutPherogramRight();\r
+        if (errorMessage != null) {\r
+            MessagingUtils.errorDialog("Unable to cut base call sequence", this, errorMessage, "eu.etaxonomy.taxeditor.editor", null, false);  //TODO set pluginID\r
         }\r
-        return null;\r
     }\r
 }\r