commit 74389de2394d9813290ce8b8d78236a4f63a1fcb
Author: Katja Luther <k.luther@bgbm.org>
Date:   Mon Oct 15 16:04:45 2018 +0200

    ref #7793: smaller chenges in factual data context menu

diff --git a/eu.etaxonomy.taxeditor.editor/fragment.e4xmi b/eu.etaxonomy.taxeditor.editor/fragment.e4xmi
index 5e9c90996..c958779d4 100644
--- a/eu.etaxonomy.taxeditor.editor/fragment.e4xmi
+++ b/eu.etaxonomy.taxeditor.editor/fragment.e4xmi
@@ -106,16 +106,16 @@
       <handlers xmi:id="_tc-7wLy2EeioE565ihOF2g" elementId="eu.etaxonomy.taxeditor.editor.view.descriptive.e4.handler.CreateDescriptionWithSourceHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.descriptive.e4.handler.CreateDescriptionWithSourceHandler" command="_Z51sQLy2EeioE565ihOF2g"/>
       <menus xsi:type="menu:PopupMenu" xmi:id="_HxxDt4GxEeehlNPrK_b5JA" elementId="eu.etaxonomy.taxeditor.editor.popupmenu.factualDataView">
         <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_bMfdYIG5EeehlNPrK_b5JA" coreExpressionId="isCdmStoreConnected"/>
+        <children xsi:type="menu:DynamicMenuContribution" xmi:id="_2t3BgIHWEeehlNPrK_b5JA" elementId="eu.etaxonomy.taxeditor.editor.view.descriptive.e4.handler.DynamicFeatureMenuE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.descriptive.e4.handler.DynamicFeatureMenuE4"/>
+        <children xsi:type="menu:DynamicMenuContribution" xmi:id="_4KNqkIGxEeehlNPrK_b5JA" elementId="eu.etaxonomy.taxeditor.editor.factual.dynamicmenucontribution.cdmViewer" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.view.CdmViewerContextMenuE4"/>
+        <children xsi:type="menu:MenuSeparator" xmi:id="_nRINkIGxEeehlNPrK_b5JA" elementId="eu.etaxonomy.taxeditor.editor.menuseparator.9"/>
         <children xsi:type="menu:HandledMenuItem" xmi:id="_jvmnkIGxEeehlNPrK_b5JA" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.factualData.addDescription" label="%command.label.27" command="_gE3lwIGyEeehlNPrK_b5JA"/>
         <children xsi:type="menu:HandledMenuItem" xmi:id="_Im49wLy2EeioE565ihOF2g" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.newfactualdatasetwithsource" label="%handledmenuitem.label.18" command="_Z51sQLy2EeioE565ihOF2g"/>
         <children xsi:type="menu:MenuSeparator" xmi:id="_ij_wEIGxEeehlNPrK_b5JA" elementId="eu.etaxonomy.taxeditor.editor.menuseparator.8"/>
-        <children xsi:type="menu:HandledMenuItem" xmi:id="_m00sEIGxEeehlNPrK_b5JA" elementId="eu.etaxonomy.taxeditor.editor.factualData.moveDescriptionElement" label="%command.label.29" command="_QJzBcIG4EeehlNPrK_b5JA"/>
         <children xsi:type="menu:HandledMenuItem" xmi:id="_mgmvkIGxEeehlNPrK_b5JA" elementId="eu.etaxonomy.taxeditor.editor.factualData.moveDescriptionToTaxon" label="%command.label.28" command="_Al6c0IG4EeehlNPrK_b5JA">
           <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_BZrDwIGyEeehlNPrK_b5JA" coreExpressionId="isDescription"/>
         </children>
-        <children xsi:type="menu:DynamicMenuContribution" xmi:id="_2t3BgIHWEeehlNPrK_b5JA" elementId="eu.etaxonomy.taxeditor.editor.view.descriptive.e4.handler.DynamicFeatureMenuE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.descriptive.e4.handler.DynamicFeatureMenuE4"/>
-        <children xsi:type="menu:MenuSeparator" xmi:id="_nRINkIGxEeehlNPrK_b5JA" elementId="eu.etaxonomy.taxeditor.editor.menuseparator.9"/>
-        <children xsi:type="menu:DynamicMenuContribution" xmi:id="_4KNqkIGxEeehlNPrK_b5JA" elementId="eu.etaxonomy.taxeditor.editor.factual.dynamicmenucontribution.cdmViewer" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.view.CdmViewerContextMenuE4"/>
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_m00sEIGxEeehlNPrK_b5JA" elementId="eu.etaxonomy.taxeditor.editor.factualData.moveDescriptionElement" label="%command.label.29" command="_QJzBcIG4EeehlNPrK_b5JA"/>
         <children xsi:type="menu:MenuSeparator" xmi:id="_pOAxAIGxEeehlNPrK_b5JA" elementId="eu.etaxonomy.taxeditor.editor.menuseparator.10"/>
         <children xsi:type="menu:HandledMenuItem" xmi:id="_rLS9EIGxEeehlNPrK_b5JA" elementId="eu.etaxonomy.taxeditor.editor.factualData.delete" label="%command.label.30" command="_AqgMcIG5EeehlNPrK_b5JA"/>
       </menus>
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/CdmViewerContextMenuE4.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/CdmViewerContextMenuE4.java
index deb819c48..6d9232bef 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/CdmViewerContextMenuE4.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/CdmViewerContextMenuE4.java
@@ -26,6 +26,7 @@ import org.eclipse.jface.viewers.TreeNode;
 import eu.etaxonomy.cdm.model.common.ICdmBase;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 import eu.etaxonomy.taxeditor.l10n.Messages;
+import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
 
 /**
  * Generic context menu for opening elements in the taxeditor.
@@ -41,9 +42,15 @@ public class CdmViewerContextMenuE4 {
 
     @AboutToShow
     public void aboutToShow(List<MMenuElement> items, @Named(IServiceConstants.ACTIVE_SELECTION) Object selectedObject) {
+
+
         if(selectedObject instanceof IStructuredSelection){
             selectedObject = ((IStructuredSelection) selectedObject).getFirstElement();
         }
+
+        if (selectedObject instanceof FeatureNodeContainer){
+            return ;
+        }
         if(selectedObject instanceof TreeNode){
             selectedObject = ((TreeNode) selectedObject).getValue();
         }
@@ -64,7 +71,11 @@ public class CdmViewerContextMenuE4 {
             Entry<Command, String> entry = enabledCommands.entrySet().iterator().next();
             final Command command = entry.getKey();
             String viewerName = entry.getValue();
-            addCommand(uuid, command, String.format(Messages.CdmViewerContextMenu_OPEN, viewerName));
+            MMenu menu = MMenuFactory.INSTANCE.createMenu();
+            menu.setLabel(Messages.CdmViewerContextMenu_OPEN_IN);
+            items.add(menu);
+           // items.add(addCommand(uuid, command, String.format(Messages.CdmViewerContextMenu_OPEN, viewerName)));
+            menu.getChildren().add(addCommand(uuid, command, viewerName));
         }
         else if(enabledCommands.size()>1){
             MMenu menu = MMenuFactory.INSTANCE.createMenu();
