1 package org.simantics.diagram.profile.request;
3 import java.util.Collection;
4 import java.util.HashSet;
6 import org.simantics.db.ReadGraph;
7 import org.simantics.db.Resource;
8 import org.simantics.db.common.request.ResourceRead;
9 import org.simantics.db.exception.DatabaseException;
10 import org.simantics.diagram.stubs.DiagramResource;
11 import org.simantics.scenegraph.profile.ProfileUtils;
13 public class ReferencedProfileEntries extends ResourceRead<Collection<Resource>> {
15 public ReferencedProfileEntries(Resource part) {
19 public HashSet<Resource> process(ReadGraph graph, Resource resource, HashSet<Resource> result) throws DatabaseException {
21 DiagramResource DIA = DiagramResource.getInstance(graph);
23 if(graph.isInstanceOf(resource, DIA.Profile)) {
25 for(Resource child : ProfileUtils.getProfileChildren(graph, resource)) {
26 process(graph, child, result);
29 } else if(graph.isInstanceOf(resource, DIA.ProfileEntry)) {
40 public Collection<Resource> perform(ReadGraph graph) throws DatabaseException {
41 return process(graph, resource, new HashSet<Resource>());