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 01647faa59600c4eb278247122e9b1909a514654..0a972b7a2fad9bb1d74a1e788df20e2c278abcbb 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 64de1b11d4d9dc11bac68d0b1f2dfbbd5d8a0373..1424b3088f8d55484f04e4637e63dc05655a0269 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 0b76ca9f0d3953333108b495a9cb4b3d8a34a458..305d63edfabdfedc07e79e262da3a5cc0dbc41b4 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 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
index d3da248a9e6c3a7280837a42e03d464666ca9584..f8b003e5605841f1948f9dc2a9a1e4268b86d9fa 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 56221f9781f7866f700450fd7e09c1f154fdc4bd..283767bd3edaa5150644e0e9c4161efab4657dae 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 8b5489ee89d01aef2d908c5806986a00ebc86433..d149eb16bc4d5bada68ffb0333e6056606932286 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 58e93a7d5bbe083d4c9b2dca7c16848c504ad1d0..802c3b3e52beb40a28d6605a1de1d80576f8b0dd 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