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
--- /dev/null
+// $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
/**\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
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 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
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
/**\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
\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
* @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
\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
\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
* @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
\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
/**\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