ref #6913 Remove alignment handler
[taxeditor.git] / eu.etaxonomy.taxeditor.molecular / src / main / java / eu / etaxonomy / taxeditor / molecular / handler / HandlerTools.java
index 77792d62f869e46e1809a6390bfed8e7ce0774bb..c79a0305bc637e6dce1e9b9d7117842c4f6df0b3 100644 (file)
@@ -15,7 +15,9 @@ import org.eclipse.core.runtime.FileLocator;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.jface.resource.ImageDescriptor;
 
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.molecular.TaxeditorMolecularPlugin;
+import eu.etaxonomy.taxeditor.molecular.editor.e4.AlignmentEditorE4;
 import eu.etaxonomy.taxeditor.molecular.l10n.Messages;
 
 
@@ -37,4 +39,13 @@ public class HandlerTools {  //TODO Move this class or method somewhere else?
             throw new InternalError(String.format(Messages.HandlerTools_COULD_NOT_LOAD_ICON, iconName));  //TODO Throw other type of exception?
         }
     }
+    public static AlignmentEditorE4 getActiveAlignmentEditor() {
+        Object activeEditor = AbstractUtility.getActiveEditor();
+        if (activeEditor instanceof AlignmentEditorE4) {
+            return (AlignmentEditorE4)activeEditor;
+        }
+        else {
+            return null;
+        }
+    }
 }