X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.district.network%2Fsrc%2Forg%2Fsimantics%2Fdistrict%2Fnetwork%2Ftechtype%2Frequests%2FPossibleTechTypeTableData.java;fp=org.simantics.district.network%2Fsrc%2Forg%2Fsimantics%2Fdistrict%2Fnetwork%2Ftechtype%2Frequests%2FPossibleTechTypeTableData.java;h=8dd886665c64194f8995b9d7ec58c0d0e04d6a51;hb=96d2122ccc3a7d3503d0bf2ab121eb8fd2186323;hp=0000000000000000000000000000000000000000;hpb=40d019be6ff00ecec1c3250a03bb5c046ad98182;p=simantics%2Fdistrict.git diff --git a/org.simantics.district.network/src/org/simantics/district/network/techtype/requests/PossibleTechTypeTableData.java b/org.simantics.district.network/src/org/simantics/district/network/techtype/requests/PossibleTechTypeTableData.java new file mode 100644 index 00000000..8dd88666 --- /dev/null +++ b/org.simantics.district.network/src/org/simantics/district/network/techtype/requests/PossibleTechTypeTableData.java @@ -0,0 +1,23 @@ +package org.simantics.district.network.techtype.requests; + +import org.simantics.databoard.Bindings; +import org.simantics.db.ReadGraph; +import org.simantics.db.Resource; +import org.simantics.db.common.procedure.adapter.TransientCacheListener; +import org.simantics.db.common.request.ResourceRead2; +import org.simantics.db.exception.DatabaseException; +import org.simantics.district.network.ontology.DistrictNetworkResource; + +public class PossibleTechTypeTableData extends ResourceRead2 { + public PossibleTechTypeTableData(Resource model, Resource componentType) { + super(model, componentType); + } + + @Override + public String perform(ReadGraph graph) throws DatabaseException { + DistrictNetworkResource DN = DistrictNetworkResource.getInstance(graph); + + Resource ttt = graph.syncRequest(new PossibleTechTypeTable(resource, resource2), TransientCacheListener.instance()); + return ttt != null ? graph.getPossibleRelatedValue2(ttt, DN.TechType_TechTypeTable_HasData, Bindings.STRING) : null; + } +}