--- /dev/null
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.molecular.editor.e4.handler;
+
+
+import javax.inject.Named;
+
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.services.IServiceConstants;
+import org.eclipse.jface.resource.ImageDescriptor;
+
+import eu.etaxonomy.taxeditor.molecular.editor.AlignmentEditor;
+import eu.etaxonomy.taxeditor.molecular.editor.e4.AlignmentEditorE4;
+import eu.etaxonomy.taxeditor.molecular.handler.HandlerTools;
+
+
+
+/**
+ * Switches an {@link AlignmentEditor} between insertion and overwrite mode.
+ *
+ * @author Ben Stöver
+ * @date 04.12.2014
+ */
+public class ToggleInsertOverwriteHandlerE4 {
+ public static final String COMMAND_ID =
+ "eu.etaxonomy.taxeditor.molecular.AlignmentEditor.toggleInsertOverwrite"; //$NON-NLS-1$
+
+
+ private final ImageDescriptor INSERT_DESCRIPTOR = HandlerTools.createImageDescriptor("insert-16x16.png"); //$NON-NLS-1$
+ private final ImageDescriptor OVERWRITE_DESCRIPTOR = HandlerTools.createImageDescriptor("overwrite-16x16.png"); //$NON-NLS-1$
+
+
+ @Execute
+ public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart) {
+ AlignmentEditorE4 editor = (AlignmentEditorE4) activePart.getObject();
+ editor.toggleInsertOverwrite();
+ }
+
+
+ //FIXME E4 convert
+// @Override
+// public void updateElement(UIElement element, @SuppressWarnings("rawtypes") Map parameters) {
+// Object activeEditor = AbstractUtility.getActiveE4Editor();
+// if (activeEditor instanceof AlignmentEditor) {
+// if (((AlignmentEditor)activeEditor).isInsertMode()) {
+// element.setIcon(INSERT_DESCRIPTOR);
+// element.setText("INS"); //$NON-NLS-1$
+// element.setTooltip(Messages.ToggleInsertOverwriteHandler_SWITCH_OVERWRITE);
+// }
+// else {
+// element.setIcon(OVERWRITE_DESCRIPTOR);
+// element.setText("OVR"); //$NON-NLS-1$
+// element.setTooltip(Messages.ToggleInsertOverwriteHandler_SWITCH_INSERTION);
+// }
+// PlatformUI.getWorkbench().getService(ICommandService.class).refreshElements(
+// ToggleLeftRightInsertionHandlerE4.COMMAND_ID, null);
+// }
+// }
+}