1 package org.simantics.structural2.queries;
3 import org.simantics.db.ReadGraph;
4 import org.simantics.db.Resource;
5 import org.simantics.db.common.primitiverequest.IsSubrelationOf;
6 import org.simantics.db.common.procedure.adapter.TransientCacheAsyncListener;
7 import org.simantics.db.common.request.ResourceRead;
8 import org.simantics.db.exception.DatabaseException;
9 import org.simantics.db.layer0.request.PropertyInfo;
10 import org.simantics.db.layer0.request.PropertyInfoRequest;
11 import org.simantics.structural.stubs.StructuralResource2;
13 public class PossibleConnectionPointInfo extends ResourceRead<PropertyInfo> {
15 public PossibleConnectionPointInfo(Resource resource) {
20 public PropertyInfo perform(ReadGraph graph) throws DatabaseException {
22 PropertyInfo info = graph.syncRequest(new PropertyInfoRequest(resource), TransientCacheAsyncListener.<PropertyInfo>instance());
23 if(info != null && !info.isHasProperty) {
24 StructuralResource2 STR = StructuralResource2.getInstance(graph);
25 if(graph.syncRequest(new IsSubrelationOf(resource, STR.IsConnectedTo), TransientCacheAsyncListener.<Boolean>instance())) {
26 if (info.name != null) return info;