]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/actions/ModeledActions.java
Merge branch 'feature/funcwrite'
[simantics/platform.git] / bundles / org.simantics.modeling.ui / src / org / simantics / modeling / ui / actions / ModeledActions.java
index 41062fef81798496ee4569d218240e1811867df8..478d8b761046177484db3ecbc02643ada1801feb 100644 (file)
@@ -115,17 +115,18 @@ public class ModeledActions extends DynamicMenuContribution implements IExecutab
         for (Object o : selection) {
             if ((o instanceof IAdaptable)) {
                    NodeContext nodeContext = ((IAdaptable) o).getAdapter(NodeContext.class);
-                   if (nodeContext != null)
+                   if (nodeContext != null) {
                        result.add(nodeContext);
-            } else if (o instanceof WorkbenchSelectionElement) {
-               try {
-                                       Resource res = WorkbenchSelectionUtils.getPossibleResource((WorkbenchSelectionElement)o);
-                                       if(res != null) {
-                                               result.add(NodeContextBuilder.buildWithInput(res));
-                                       }
-                               } catch (DatabaseException e) {
-                                   LOGGER.error("Failed to get node contexts for selection.", e);
-                               }
+                       continue;
+                   }
+            }
+            try {
+               Resource res = WorkbenchSelectionUtils.getPossibleResource(o);
+               if(res != null) {
+                       result.add(NodeContextBuilder.buildWithInput(res));
+               }
+            } catch (DatabaseException e) {
+               LOGGER.error("Failed to get node contexts for selection.", e);
             }
         }