org.simantics.ui;bundle-version="1.0.0",
org.simantics.layer0.utils;bundle-version="0.8.0",
org.simantics.structural.ui;bundle-version="1.0.0",
- org.simantics.layer0;bundle-version="1.0.0"
+ org.simantics.layer0;bundle-version="1.0.0",
+ org.simantics.diagram.ontology;bundle-version="1.1.1",
+ org.simantics.browsing.ui.model;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Export-Package: org.simantics.interop.issues,
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r\r
+
+<adapters>\r
+\r <target interface="org.simantics.browsing.ui.model.children.ChildRule">\r <baseType uri="http://www.simantics.org/Viewpoint-1.0/ChildRule" />\r <resource\r uri="http://www.simantics.org/Interop-1.0/InteropBrowseContext/InteropChildRule"\r class="org.simantics.interop.browsing.InteropChildRule"/>\r </target>\r\r \r\r
+</adapters>
\ No newline at end of file
L0 = <http://www.simantics.org/Layer0-1.0>\r
PROJ = <http://www.simantics.org/Project-1.0>\r
\r
+MOD = <http://www.simantics.org/Modeling-1.0>\r
+VP = <http://www.simantics.org/Viewpoint-1.0>\r
+\r
+\r
\r
INTEROP = <http://www.simantics.org/Interop-1.0> : L0.Ontology\r
L0.HasResourceClass "org.simantics.interop.stubs.InteropResource"\r
\r
INTEROP.HasSource <R L0.IsWeaklyRelatedTo\r
L0.InverseOf INTEROP.HasDestination <R L0.IsWeaklyRelatedTo\r
+ \r
+IBC = INTEROP.InteropBrowseContext : VP.BrowseContext\r
+ VP.BrowseContext.IsIncludedIn MOD.ModelingBrowseContext\r
+\r
+INTEROP.INodeType <T VP.NodeType\r
+ @L0.assert VP.HasContentType "org.simantics.modeling.ui.modelBrowser.model.INode"\r
+\r
+IBC.InteropNode : INTEROP.INodeType\r
+IBC.InteropChildRule : VP.ChildRule\r
+ \r
+IBC\r
+ VP.BrowseContext.HasChildContribution _ : VP.ChildContribution\r
+ VP.ChildContribution.HasParentNodeType PROJ.Project\r
+ VP.ChildContribution.HasChildNodeType IBC.InteropNode\r
+ VP.ChildContribution.HasRule IBC.InteropChildRule\r
+ \r
<binding\r
browseContext="http://www.apros.fi/Apros-6.0/AprosModelBrowser">\r
<implementation\r
- class="org.simantics.interop.handlers.Contributor1"\r
+ class="org.simantics.interop.handlers.Contributor2"\r
preference="1.0">\r
</implementation>\r
+ </binding>\r
+ <!--\r
+ <binding\r
+ browseContext="http://www.simantics.org/Project-1.0/ProjectBrowseContext">\r
<implementation\r
class="org.simantics.interop.handlers.Contributor2"\r
- preference="1.0">\r
+ preference="-1.0">\r
</implementation>\r
</binding>\r
+ -->\r
</extension>\r
<extension\r
point="org.simantics.browsing.ui.common.evaluatorBinding">\r
preference="1">\r
</implementation>\r
</binding>\r
+\r
+ <binding\r
+ browseContext="http://www.simantics.org/Project-1.0/ProjectBrowseContext">\r
+ <implementation\r
+ class="org.simantics.interop.handlers.EvaluatorFactory1"\r
+ preference="1">\r
+ </implementation>\r
+ </binding>\r
+ \r
</extension>\r
<extension\r
point="org.eclipse.ui.views">\r
--- /dev/null
+package org.simantics.interop.browsing;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Collection;\r
+import java.util.Collections;\r
+import java.util.List;\r
+\r
+import org.simantics.browsing.ui.model.children.ChildRule;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.interop.stubs.InteropResource;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.modeling.ui.modelBrowser.model.INode;\r
+\r
+public class InteropChildRule implements ChildRule{\r
+ @Override\r
+ public boolean isCompatible(Class<?> contentType) {\r
+ return Resource.class.isAssignableFrom(contentType);\r
+ }\r
+ @Override\r
+ public Collection<?> getChildren(ReadGraph graph, Object parent_)\r
+ throws DatabaseException {\r
+ Resource parent = (Resource)parent_;\r
+\r
+ \r
+ List<INode> nodes = new ArrayList<INode>();\r
+ nodes.add(new ImportNode2(parent));\r
+ return nodes;\r
+ \r
+\r
+ }\r
+ @Override\r
+ public Collection<?> getParents(ReadGraph graph, Object child)\r
+ throws DatabaseException {\r
+ return Collections.emptyList(); // It is not necessary to support this\r
+ }\r
+\r
+}\r
public Collection<?> getContribution(ReadGraph graph, Resource input)\r
throws DatabaseException {\r
Collection<INode> nodes = new ArrayList<INode>();\r
- System.out.println("Contributor 1 " + input + " " + GraphUtils.getReadableName(graph, input));\r
+ System.out.println("Contributor 2 " + input + " " + GraphUtils.getReadableName(graph, input));\r
nodes.add(new ImportNode2(input));\r
return nodes;\r
}\r
public final Resource HasDestination;\r
public final Resource HasImportData;\r
public final Resource HasSource;\r
+ public final Resource INodeType;\r
public final Resource ImportDataOf;\r
public final Resource ImportLibrary;\r
+ public final Resource InteropBrowseContext;\r
+ public final Resource InteropBrowseContext_InteropChildRule;\r
+ public final Resource InteropBrowseContext_InteropNode;\r
\r
public static class URIs {\r
public static final String HasDestination = "http://www.simantics.org/Interop-1.0/HasDestination";\r
public static final String HasImportData = "http://www.simantics.org/Interop-1.0/HasImportData";\r
public static final String HasSource = "http://www.simantics.org/Interop-1.0/HasSource";\r
+ public static final String INodeType = "http://www.simantics.org/Interop-1.0/INodeType";\r
public static final String ImportDataOf = "http://www.simantics.org/Interop-1.0/ImportDataOf";\r
public static final String ImportLibrary = "http://www.simantics.org/Interop-1.0/ImportLibrary";\r
+ public static final String InteropBrowseContext = "http://www.simantics.org/Interop-1.0/InteropBrowseContext";\r
+ public static final String InteropBrowseContext_InteropChildRule = "http://www.simantics.org/Interop-1.0/InteropBrowseContext/InteropChildRule";\r
+ public static final String InteropBrowseContext_InteropNode = "http://www.simantics.org/Interop-1.0/InteropBrowseContext/InteropNode";\r
}\r
\r
public static Resource getResourceOrNull(ReadGraph graph, String uri) {\r
HasDestination = getResourceOrNull(graph, URIs.HasDestination);\r
HasImportData = getResourceOrNull(graph, URIs.HasImportData);\r
HasSource = getResourceOrNull(graph, URIs.HasSource);\r
+ INodeType = getResourceOrNull(graph, URIs.INodeType);\r
ImportDataOf = getResourceOrNull(graph, URIs.ImportDataOf);\r
ImportLibrary = getResourceOrNull(graph, URIs.ImportLibrary);\r
+ InteropBrowseContext = getResourceOrNull(graph, URIs.InteropBrowseContext);\r
+ InteropBrowseContext_InteropChildRule = getResourceOrNull(graph, URIs.InteropBrowseContext_InteropChildRule);\r
+ InteropBrowseContext_InteropNode = getResourceOrNull(graph, URIs.InteropBrowseContext_InteropNode);\r
}\r
\r
public static InteropResource getInstance(ReadGraph graph) {\r