eu.etaxonomy.taxeditor.help/tocnameparser.xml -text
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/editor/AlignmentEditorActionUpdater.java -text
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/handler/AbstractFocusedAlignmentAreaHandler.java -text
+eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/handler/AlignmentEditorCutHandler.java -text
eu.etaxonomy.taxeditor.navigation/.classpath -text
eu.etaxonomy.taxeditor.navigation/.project -text
eu.etaxonomy.taxeditor.navigation/META-INF/MANIFEST.MF -text
</with>
</activeWhen>
</handler>
+ <handler
+ class="eu.etaxonomy.taxeditor.molecular.handler.AlignmentEditorCutHandler"
+ commandId="org.eclipse.ui.edit.cut">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="eu.etaxonomy.taxeditor.molecular.AlignmentEditor">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
</extension>
<extension
point="org.eclipse.core.expressions.definitions">
package eu.etaxonomy.taxeditor.molecular.editor;\r
\r
\r
-import org.eclipse.swt.widgets.Composite;\r
-import org.eclipse.swt.widgets.Control;\r
import org.eclipse.swt.widgets.Event;\r
import org.eclipse.swt.widgets.Listener;\r
import org.eclipse.ui.PlatformUI;\r
import org.eclipse.ui.commands.ICommandService;\r
\r
import eu.etaxonomy.taxeditor.molecular.handler.AbstractAlignmentEditorHandler;\r
-import info.bioinfweb.libralign.alignmentarea.AlignmentArea;\r
import info.bioinfweb.libralign.alignmentarea.selection.SelectionChangeEvent;\r
import info.bioinfweb.libralign.alignmentarea.selection.SelectionListener;\r
\r
* @date 25.08.2015\r
*/\r
public class AlignmentEditorActionUpdater implements SelectionListener, Listener {\r
- private void updateEvents() {\r
- ((ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class)).refreshElements(\r
- ActionFactory.COPY.getCommandId(), null);\r
+ private void updateEvents(String[] ids) {\r
+ ICommandService service = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class);\r
+ for (int i = 0; i < ids.length; i++) {\r
+ service.refreshElements(ids[i], null);\r
+ }\r
}\r
\r
\r
public void handleEvent(Event event) {\r
AlignmentEditor editor = AbstractAlignmentEditorHandler.getActiveAlignmentEditor();\r
if (editor != null) {\r
- updateEvents();\r
+ updateEvents(new String[]{ActionFactory.COPY.getCommandId(), ActionFactory.CUT.getCommandId(), \r
+ ActionFactory.PASTE.getCommandId()});\r
}\r
}\r
\r
if ((e.getSource() == editor.getReadsArea().getSelection()) || \r
(e.getSource() == editor.getEditableConsensusArea().getSelection())) {\r
\r
- updateEvents();\r
+ updateEvents(new String[]{ActionFactory.COPY.getCommandId(), ActionFactory.CUT.getCommandId()});\r
}\r
}\r
}\r
--- /dev/null
+package eu.etaxonomy.taxeditor.molecular.handler;\r
+\r
+\r
+import info.bioinfweb.libralign.alignmentarea.AlignmentArea;\r
+\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+\r
+import eu.etaxonomy.taxeditor.molecular.editor.AlignmentEditor;\r
+\r
+\r
+\r
+public class AlignmentEditorCutHandler extends AlignmentEditorCopyHandler {\r
+ @Override\r
+ protected void doExecute2(ExecutionEvent event, AlignmentEditor editor, AlignmentArea focusedArea) {\r
+ super.doExecute2(event, editor, focusedArea); // Copy selected contents.\r
+ focusedArea.getActionProvider().deleteForward(); // Delete selection. Direction does not matter, if selection is not empty.\r
+ }\r
+}\r