ref #5923 "Open in.." menu restructuring
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / view / CdmViewerContextMenu.java
index 18ac555e67a1e21096f86e337f436ccb272cb45b..09edf27acceb7a3cba2e134461b5419bc6c398a4 100644 (file)
@@ -12,6 +12,7 @@ import org.eclipse.jface.action.ContributionItem;
 import org.eclipse.jface.action.IContributionItem;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TreeNode;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
@@ -100,6 +101,10 @@ public class CdmViewerContextMenu extends CompoundContributionItem {
             if (selectedObject instanceof UuidAndTitleCache){
                 selectedObject = CdmStore.getCommonService().find(CdmBase.class, ((UuidAndTitleCache)selectedObject).getUuid());
             }
+            //for tree nodes get the value resp. the object of the node
+            else if (selectedObject instanceof TreeNode){
+                selectedObject = ((TreeNode) selectedObject).getValue();
+            }
             if(selectedObject instanceof ICdmBase){
                 params.put(command.getId()+".uuid", ((ICdmBase) selectedObject).getUuid()); //$NON-NLS-1$
             }