L0.HasResourceClass "org.simantics.interop.stubs.InteropResource"\r
@L0.new\r
\r
+INTEROP.HasImportData <R L0.IsWeaklyRelatedTo\r
+ L0.InverseOf INTEROP.ImportDataOf <R L0.IsWeaklyRelatedTo\r
\r
INTEROP.ImportLibrary <T L0.Library\r
\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.interop.Activator;\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 ImportNode implements INode {\r
@Override\r
public Collection<?> getChildren(ReadGraph graph) throws DatabaseException {\r
List<INode> nodes = new ArrayList<INode>();\r
- Builtins b = graph.getBuiltins();\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
InteropResource i = InteropResource.getInstance(graph);\r
// Collection<Resource> models = graph.getObjects(project, b.ConsistsOf);\r
// for (Resource m : models) {\r
// }\r
// }\r
// }\r
- Collection<Resource> objs = graph.getObjects(model, b.ConsistsOf);\r
+ //Collection<Resource> objs = graph.getObjects(model, b.ConsistsOf);\r
+ Collection<Resource> objs = graph.getObjects(model, i.HasImportData);\r
for (Resource o : objs) {\r
if (graph.isInstanceOf(o, i.ImportLibrary)) {\r
INode node = graph.adapt(o, INode.class);\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.interop.Activator;\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 ImportNode2 implements INode {\r
@Override\r
public Collection<?> getChildren(ReadGraph graph) throws DatabaseException {\r
List<INode> nodes = new ArrayList<INode>();\r
- Builtins b = graph.getBuiltins();\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
InteropResource i = InteropResource.getInstance(graph);\r
// Collection<Resource> models = graph.getObjects(project, b.ConsistsOf);\r
// for (Resource m : models) {\r
// }\r
// }\r
// }\r
- Collection<Resource> objs = graph.getObjects(project, b.ConsistsOf);\r
+ //Collection<Resource> objs = graph.getObjects(project, b.ConsistsOf);\r
+ Collection<Resource> objs = graph.getObjects(project, i.HasImportData);\r
for (Resource o : objs) {\r
if (graph.isInstanceOf(o, i.ImportLibrary)) {\r
INode node = graph.adapt(o, INode.class);\r
public class InteropResource {\r
\r
public final Resource HasDestination;\r
+ public final Resource HasImportData;\r
public final Resource HasSource;\r
+ public final Resource ImportDataOf;\r
public final Resource ImportLibrary;\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 ImportDataOf = "http://www.simantics.org/Interop-1.0/ImportDataOf";\r
public static final String ImportLibrary = "http://www.simantics.org/Interop-1.0/ImportLibrary";\r
}\r
\r
\r
public InteropResource(ReadGraph graph) {\r
HasDestination = getResourceOrNull(graph, URIs.HasDestination);\r
+ HasImportData = getResourceOrNull(graph, URIs.HasImportData);\r
HasSource = getResourceOrNull(graph, URIs.HasSource);\r
+ ImportDataOf = getResourceOrNull(graph, URIs.ImportDataOf);\r
ImportLibrary = getResourceOrNull(graph, URIs.ImportLibrary);\r
}\r
\r