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
* @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