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.common.utils.ListUtils;
10 import org.simantics.db.exception.DatabaseException;
11 import org.simantics.diagram.stubs.DiagramResource;
12 import org.simantics.scenegraph.profile.ProfileUtils;
14 public class ReferencedProfileEntries extends ResourceRead<Collection<Resource>> {
16 public ReferencedProfileEntries(Resource part) {
20 public HashSet<Resource> process(ReadGraph graph, Resource resource, HashSet<Resource> result) throws DatabaseException {
22 DiagramResource DIA = DiagramResource.getInstance(graph);
24 if(graph.isInstanceOf(resource, DIA.Profile)) {
26 for(Resource child : ProfileUtils.getProfileChildren(graph, resource)) {
27 process(graph, child, result);
30 } else if(graph.isInstanceOf(resource, DIA.ProfileEntry)) {
41 public Collection<Resource> perform(ReadGraph graph) throws DatabaseException {
42 return process(graph, resource, new HashSet<Resource>());