checkEnabled="true">\r
<with\r
variable="selection">\r
+ <or>\r
<test\r
args="org.simantics.sysdyn.ui.browser.nodes.SCLModulesFolder"\r
property="org.simantics.sysdyn.ui.nodeClass">\r
</test>\r
+ <test\r
+ args="http://www.simantics.org/Layer0-0.0/SharedOntology"\r
+ property="org.simantics.graph.resourceType"\r
+ value="true">\r
+ </test>\r
+ <test\r
+ args="http://www.simantics.org/Layer0-0.0/Library"\r
+ property="org.simantics.graph.resourceType"\r
+ value="true">\r
+ </test>\r
+ <test\r
+ args="http://www.simantics.org/Simulation-0.0/Model"\r
+ property="org.simantics.graph.resourceType"\r
+ value="true">\r
+ </test>\r
+ </or>\r
</with>\r
</visibleWhen>\r
</command>\r
args="org.simantics.sysdyn.ui.browser.nodes.SCLModulesFolder"\r
property="org.simantics.sysdyn.ui.nodeClass">\r
</test>\r
+ <test\r
+ args="http://www.simantics.org/Layer0-0.0/SharedOntology"\r
+ property="org.simantics.graph.resourceType"\r
+ value="true">\r
+ </test>\r
+ <test\r
+ args="http://www.simantics.org/Layer0-0.0/Library"\r
+ property="org.simantics.graph.resourceType"\r
+ value="true">\r
+ </test>\r
+ <test\r
+ args="http://www.simantics.org/Simulation-0.0/Model"\r
+ property="org.simantics.graph.resourceType"\r
+ value="true">\r
+ </test>\r
</or>\r
</with>\r
</activeWhen>\r
ISelection sel = HandlerUtil.getCurrentSelection(event);\r
\r
@SuppressWarnings("unchecked")\r
- AbstractNode<Resource> node = AdaptionUtils.adaptToSingle(sel, AbstractNode.class);\r
- if (node == null)\r
- return null;\r
+ Resource res = AdaptionUtils.adaptToSingle(sel, Resource.class);\r
+ if(res == null) {\r
+ @SuppressWarnings("unchecked")\r
+ AbstractNode<Resource> node = AdaptionUtils.adaptToSingle(sel, AbstractNode.class);\r
+ if (node == null)\r
+ return null;\r
+ res = node.data;\r
+ }\r
\r
- final Resource parent = node.data;\r
+ final Resource parent = res;\r
\r
SimanticsUI.getSession().asyncRequest(new WriteRequest() {\r
\r