<children xsi:type="menu:HandledMenuItem" xmi:id="_h4pX0DumEeeOtqC_3qh40A" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.commandnamereuse_single_read" label="%command.label.REUSE_SINGLE_READ_HERE" command="_HmerkDumEeeOtqC_3qh40A"/>
<children xsi:type="menu:HandledMenuItem" xmi:id="_oQXH0DumEeeOtqC_3qh40A" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.commandlabelreuse_single_read_for_other_sequence" label="%command.label.REUSE_SINGLE_READ_FOR_OTHER_SEQUENCE" command="_N0wLsDumEeeOtqC_3qh40A"/>
<children xsi:type="menu:HandledMenuItem" xmi:id="_1apX0DumEeeOtqC_3qh40A" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.commandlabelremove_single_read_from_this_sequence" label="%command.label.REMOVE_SINGLE_READ_FROM_THIS_SEQUENCE" command="_K4DxEDumEeeOtqC_3qh40A"/>
- <children xsi:type="menu:MenuSeparator" xmi:id="_c0f98DulEeeOtqC_3qh40A" elementId="eu.etaxonomy.taxeditor.editor.menuseparator.3"/>
+ <children xsi:type="menu:MenuSeparator" xmi:id="_c0f98DulEeeOtqC_3qh40A" elementId="eu.etaxonomy.taxeditor.editor.menuseparator.beforeDelete"/>
<children xsi:type="menu:HandledMenuItem" xmi:id="_XWW6QDulEeeOtqC_3qh40A" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.commandlabel52" label="%command.label.52" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.store/icons/delete.gif" command="_YPp1wDvREeeOtqC_3qh40A"/>
<children xsi:type="menu:HandledMenuItem" xmi:id="_wg0-oDulEeeOtqC_3qh40A" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.commandlabel54" label="%command.label.54" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.editor/icons/deep-delete-16x16-32.png" command="_fKT-wDulEeeOtqC_3qh40A"/>
</menus>
org.eclipse.core.databinding.observable;bundle-version="1.4.0",
org.eclipse.core.databinding;bundle-version="1.4.0",
org.eclipse.jface.databinding;bundle-version="1.5.0",
- org.eclipse.core.databinding.property;bundle-version="1.4.0"
+ org.eclipse.core.databinding.property;bundle-version="1.4.0",
+ org.eclipse.e4.core.di.annotations,
+ org.eclipse.e4.ui.services
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Bundle-Vendor: EDIT
--- /dev/null
+<?xml version="1.0" encoding="ASCII"?>
+<fragment:ModelFragments xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:commands="http://www.eclipse.org/ui/2010/UIModel/application/commands" xmlns:fragment="http://www.eclipse.org/ui/2010/UIModel/fragment" xmlns:menu="http://www.eclipse.org/ui/2010/UIModel/application/ui/menu" xmlns:ui="http://www.eclipse.org/ui/2010/UIModel/application/ui" xmi:id="_OhwnQCTfEeeiN5lBIuqN3g">
+ <fragments xsi:type="fragment:StringModelFragment" xmi:id="__mwtMDVpEee_b7RlBzTDRw" featurename="commands" parentElementId="xpath:/">
+ <elements xsi:type="commands:Command" xmi:id="_JZdQ0H2sEeeVL5aZ55YsWA" elementId="eu.etaxonomy.taxeditor.molecular.editSequence" commandName="%command.EDIT_SEQUENCE"/>
+ </fragments>
+ <fragments xsi:type="fragment:StringModelFragment" xmi:id="_RCmzgH2sEeeVL5aZ55YsWA" featurename="handlers" parentElementId="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView">
+ <elements xsi:type="commands:Handler" xmi:id="_XuBioH2sEeeVL5aZ55YsWA" elementId="eu.etaxonomy.taxeditor.molecular.handler.EditSequenceHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.molecular/eu.etaxonomy.taxeditor.molecular.handler.EditSequenceHandler" command="_JZdQ0H2sEeeVL5aZ55YsWA"/>
+ </fragments>
+ <fragments xsi:type="fragment:StringModelFragment" xmi:id="_o08AQH2sEeeVL5aZ55YsWA" featurename="children" parentElementId="eu.etaxonomy.taxeditor.editor.popupmenu.specimeneditor" positionInList="before:eu.etaxonomy.taxeditor.editor.menuseparator.beforeDelete">
+ <elements xsi:type="menu:HandledMenuItem" xmi:id="_txARoH2sEeeVL5aZ55YsWA" elementId="eu.etaxonomy.taxeditor.molecular.handledmenuitem.commandlabeledit_sequence" label="%command.label.EDIT_SEQUENCE" command="_JZdQ0H2sEeeVL5aZ55YsWA">
+ <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_wpbQQH2sEeeVL5aZ55YsWA" coreExpressionId="isSequence"/>
+ </elements>
+ </fragments>
+</fragment:ModelFragments>
</extension>
<extension
point="org.eclipse.ui.commands">
- <command
- defaultHandler="eu.etaxonomy.taxeditor.molecular.handler.EditSequenceHandler"
- id="eu.etaxonomy.taxeditor.molecular.editSequence"
- name="%command.EDIT_SEQUENCE">
- </command>
<command
defaultHandler="eu.etaxonomy.taxeditor.molecular.handler.ShowPherogramHandler"
id="eu.etaxonomy.taxeditor.molecular.showPherogram"
name="eu.etaxonomy.taxeditor.molecular.separator5"
visible="true">
</separator>
- <command
- commandId="eu.etaxonomy.taxeditor.molecular.editSequence"
- label="%command.label.EDIT_SEQUENCE"
- style="push">
- <visibleWhen
- checkEnabled="true">
- <reference
- definitionId="isSequence">
- </reference>
- </visibleWhen>
- </command>
<command
commandId="eu.etaxonomy.taxeditor.molecular.exportSequenceToFile"
label="%command.label.EXPORT_SEQUENCE_TO_FILE"
sequence="M1+O">
</key>
</extension>
+ <extension
+ id="id1"
+ point="org.eclipse.e4.workbench.model">
+ <fragment
+ apply="always"
+ uri="fragment.e4xmi">
+ </fragment>
+ </extension>
</plugin>
package eu.etaxonomy.taxeditor.molecular.handler;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.ISelection;
+import javax.inject.Named;
+
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.ui.services.IServiceConstants;
import org.eclipse.jface.viewers.TreeNode;
import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.handlers.HandlerUtil;
import eu.etaxonomy.cdm.model.molecular.Sequence;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.molecular.TaxeditorMolecularPlugin;
import eu.etaxonomy.taxeditor.molecular.editor.AlignmentEditor;
import eu.etaxonomy.taxeditor.molecular.editor.AlignmentEditorInput;
* @author Ben Stöver
* @author pplitzner
*/
-public class EditSequenceHandler extends AbstractHandler {
+public class EditSequenceHandler {
private org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(EditSequenceHandler.class);
-
- @Override
- public Object execute(ExecutionEvent event) throws ExecutionException {
- ISelection currentSelection = HandlerUtil.getCurrentSelection(event);
- TreeNode treeNodeOfSelection = EditorUtil.getTreeNodeOfSelection(currentSelection);
+
+ @Execute
+ public void execute(@Optional@Named(IServiceConstants.ACTIVE_SELECTION)TreeNode treeNodeOfSelection) {
if(treeNodeOfSelection != null && treeNodeOfSelection.getValue() instanceof Sequence){
AlignmentEditorInput input = new AlignmentEditorInput(((Sequence)treeNodeOfSelection.getValue()).getUuid()); //TODO Should there always be a new instance created here? What if the specified CDM node is already opened in an AlignmentEditor? => Possible create Singleton that keeps instances by sequence objects in a map.
try {
logger.error(Messages.EditSequenceHandler_COULD_NOT_OPEN, e);
}
}
- return null;
}
}