+package org.simantics.scenegraph.profile;\r
+\r
+import java.util.Collections;\r
+import java.util.List;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.diagram.stubs.DiagramResource;\r
+\r
+public class ProfileUtils {\r
+\r
+ public static List<Resource> getProfileChildren(ReadGraph graph, Resource profile) throws DatabaseException {\r
+ DiagramResource DIA = DiagramResource.getInstance(graph);\r
+ Resource entries = graph.getPossibleObject(profile, DIA.HasEntries);\r
+ if(entries == null) return Collections.emptyList();\r
+ return getProfileChildrenFromEntries(graph, entries);\r
+ }\r
+\r
+ public static List<Resource> getProfileChildrenFromEntries(ReadGraph graph, Resource entries) throws DatabaseException {\r
+ DiagramResource DIA = DiagramResource.getInstance(graph);\r
+ return graph.getRelatedValue2(entries, DIA.Profile_children, entries);\r
+ }\r
+\r
+}\r