AbstractAlignmentEditorHandler added.
authorb.stoever <b.stoever@localhost>
Fri, 19 Jun 2015 09:11:33 +0000 (09:11 +0000)
committerb.stoever <b.stoever@localhost>
Fri, 19 Jun 2015 09:11:33 +0000 (09:11 +0000)
.gitattributes
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/AbstractAlignmentEditorHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/CreateConsensusSequenceHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/CutPherogramLeftHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/CutPherogramRightHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ReverseComplementHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleInsertOverwriteHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleLeftRightInsertionHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/UpdateConsensusSequenceHandler.java

index 01647fa..0a972b7 100644 (file)
@@ -419,6 +419,7 @@ eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handle
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/ShowPherogramHandler.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/SpecimenPropertyTester.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/TaxonParameterConverter.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/AbstractAlignmentEditorHandler.java -text svneol=unset#text/plain
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/CreateConsensusSequenceHandler.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/CutPherogramLeftHandler.java -text svneol=unset#text/plain
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/CutPherogramRightHandler.java -text svneol=unset#text/plain
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/AbstractAlignmentEditorHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/AbstractAlignmentEditorHandler.java
new file mode 100644 (file)
index 0000000..96ce973
--- /dev/null
@@ -0,0 +1,42 @@
+// $Id$\r
+/**\r
+* Copyright (C) 2015 EDIT\r
+* European Distributed Institute of Taxonomy\r
+* http://www.e-taxonomy.eu\r
+*\r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+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
+\r
+\r
+\r
+/**\r
+ * Abstract implementation for all handlers triggering actions in an active instance of\r
+ * {@link AlignmentEditor}.\r
+ *\r
+ * @author Ben Stöver\r
+ * @date 19.06.2015\r
+ */\r
+public abstract class AbstractAlignmentEditorHandler extends AbstractHandler {\r
+    @Override\r
+    public Object execute(ExecutionEvent event) throws ExecutionException {\r
+        IEditorPart activeEditor = AbstractUtility.getActiveEditor();\r
+        if (activeEditor instanceof AlignmentEditor) {\r
+            doExecute(event, (AlignmentEditor)activeEditor);\r
+        }\r
+        return null;\r
+    }\r
+\r
+\r
+    public abstract void doExecute(ExecutionEvent event, AlignmentEditor editor) throws ExecutionException;\r
+}\r
index 64de1b1..1424b30 100644 (file)
@@ -1,31 +1,28 @@
 /**\r
 * Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
 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
 \r
 \r
 \r
-public class CreateConsensusSequenceHandler extends AbstractHandler {\r
-       @Override\r
-       public Object execute(ExecutionEvent event) throws ExecutionException {\r
-        IEditorPart activeEditor = AbstractUtility.getActiveEditor();\r
-        if (activeEditor instanceof AlignmentEditor) {\r
-               //((AlignmentEditor)activeEditor).;\r
-        }\r
-        return null;\r
-       }\r
+public class CreateConsensusSequenceHandler extends AbstractAlignmentEditorHandler {\r
+    /* (non-Javadoc)\r
+     * @see eu.etaxonomy.taxeditor.editor.handler.alignmenteditor.AbstractAlignmentEditorHandler#doExecute(org.eclipse.core.commands.ExecutionEvent, eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor)\r
+     */\r
+    @Override\r
+    public void doExecute(ExecutionEvent event, AlignmentEditor editor) throws ExecutionException {\r
+        // TODO Auto-generated method stub\r
+\r
+    }\r
 }\r
index 0b76ca9..305d63e 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 Ben Stöver\r
  * @date 15.06.2015\r
  */\r
-public class CutPherogramLeftHandler extends AbstractHandler {\r
+public class CutPherogramLeftHandler 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).cutPherogramLeft();\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.cutPherogramLeft();\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
index 15c07fb..7844fc6 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
index d3da248..f8b003e 100644 (file)
@@ -1,37 +1,30 @@
 /**\r
 * Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
 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
 \r
 \r
 \r
 /**\r
- * Reverse complements the single read sequence in an active {@link AlignmentEditor}, where the alignment cursor \r
- * is currently located. \r
- * \r
+ * Reverse complements the single read sequence in an active {@link AlignmentEditor}, where the alignment cursor\r
+ * is currently located.\r
+ *\r
  * @author Ben Stöver\r
  */\r
-public class ReverseComplementHandler extends AbstractHandler {\r
-       @Override\r
-       public Object execute(ExecutionEvent event) throws ExecutionException {\r
-        IEditorPart activeEditor = AbstractUtility.getActiveEditor();\r
-        if (activeEditor instanceof AlignmentEditor) {\r
-               ((AlignmentEditor)activeEditor).reverseComplementSelectedSequences();\r
-        }\r
-        return null;\r
-       }\r
+public class ReverseComplementHandler extends AbstractAlignmentEditorHandler {\r
+    @Override\r
+    public void doExecute(ExecutionEvent event, AlignmentEditor editor) throws ExecutionException {\r
+        editor.reverseComplementSelectedSequences();\r
+    }\r
 }\r
index 56221f9..283767b 100644 (file)
@@ -12,7 +12,6 @@ package eu.etaxonomy.taxeditor.editor.handler.alignmenteditor;
 \r
 import java.util.Map;\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.jface.resource.ImageDescriptor;\r
@@ -34,7 +33,7 @@ import eu.etaxonomy.taxeditor.model.AbstractUtility;
  * @author Ben Stöver\r
  * @date 04.12.2014\r
  */\r
-public class ToggleInsertOverwriteHandler extends AbstractHandler implements IElementUpdater {\r
+public class ToggleInsertOverwriteHandler extends AbstractAlignmentEditorHandler implements IElementUpdater {\r
        public static final String COMMAND_ID =\r
                        "eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.toggleInsertOverwrite";\r
 \r
@@ -44,13 +43,9 @@ public class ToggleInsertOverwriteHandler extends AbstractHandler implements IEl
 \r
 \r
     @Override\r
-       public Object execute(ExecutionEvent event) throws ExecutionException {\r
-        IEditorPart activeEditor = AbstractUtility.getActiveEditor();\r
-        if (activeEditor instanceof AlignmentEditor) {\r
-            ((AlignmentEditor)activeEditor).toggleInsertOverwrite();\r
-        }\r
-        return null;\r
-       }\r
+    public void doExecute(ExecutionEvent event, AlignmentEditor editor) throws ExecutionException {\r
+        editor.toggleInsertOverwrite();\r
+    }\r
 \r
 \r
        @Override\r
index 8b5489e..d149eb1 100644 (file)
@@ -11,7 +11,6 @@ package eu.etaxonomy.taxeditor.editor.handler.alignmenteditor;
 \r
 import java.util.Map;\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.jface.resource.ImageDescriptor;\r
@@ -32,7 +31,7 @@ import eu.etaxonomy.taxeditor.model.AbstractUtility;
  * @author Ben Stöver\r
  * @date 04.12.2014\r
  */\r
-public class ToggleLeftRightInsertionHandler extends AbstractHandler implements IElementUpdater {\r
+public class ToggleLeftRightInsertionHandler extends AbstractAlignmentEditorHandler implements IElementUpdater {\r
     public static final String COMMAND_ID = "eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.toggleLeftRightInsertion";\r
 \r
 \r
@@ -47,12 +46,8 @@ public class ToggleLeftRightInsertionHandler extends AbstractHandler implements
 \r
 \r
     @Override\r
-    public Object execute(ExecutionEvent event) throws ExecutionException {\r
-        IEditorPart activeEditor = AbstractUtility.getActiveEditor();\r
-        if (activeEditor instanceof AlignmentEditor) {\r
-            ((AlignmentEditor)activeEditor).toggleLeftRightInsertionInPherogram();\r
-        }\r
-        return null;\r
+    public void doExecute(ExecutionEvent event, AlignmentEditor editor) throws ExecutionException {\r
+        editor.toggleLeftRightInsertionInPherogram();\r
     }\r
 \r
 \r
index 58e93a7..802c3b3 100644 (file)
@@ -1,31 +1,24 @@
 /**\r
 * Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
 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
 \r
 \r
 \r
-public class UpdateConsensusSequenceHandler extends AbstractHandler {\r
-       @Override\r
-       public Object execute(ExecutionEvent event) throws ExecutionException {\r
-        IEditorPart activeEditor = AbstractUtility.getActiveEditor();\r
-        if (activeEditor instanceof AlignmentEditor) {\r
-               //((AlignmentEditor)activeEditor).;\r
-        }\r
-        return null;\r
-       }\r
+public class UpdateConsensusSequenceHandler extends AbstractAlignmentEditorHandler {\r
+    @Override\r
+    public void doExecute(ExecutionEvent event, AlignmentEditor editor) throws ExecutionException {\r
+        //TODO implement\r
+    }\r
 }\r