X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.ui%2Fsrc%2Forg%2Fsimantics%2Fui%2Fselection%2FWorkbenchSelectionUtils.java;h=111ac8a3a2722b89b7945343830d059e2c3d82f5;hp=47e866d0f61a651d7df83d53c93e6041740cdd09;hb=a52f0324c9435755d3da3f053794c077f7d58213;hpb=93a80604794a5a80666f965abde2abf0b10ccb9c diff --git a/bundles/org.simantics.ui/src/org/simantics/ui/selection/WorkbenchSelectionUtils.java b/bundles/org.simantics.ui/src/org/simantics/ui/selection/WorkbenchSelectionUtils.java index 47e866d0f..111ac8a3a 100644 --- a/bundles/org.simantics.ui/src/org/simantics/ui/selection/WorkbenchSelectionUtils.java +++ b/bundles/org.simantics.ui/src/org/simantics/ui/selection/WorkbenchSelectionUtils.java @@ -18,6 +18,8 @@ import org.simantics.db.common.primitiverequest.IsInstanceOf; import org.simantics.db.common.primitiverequest.Supertypes; import org.simantics.db.common.primitiverequest.Types; import org.simantics.db.exception.DatabaseException; +import org.simantics.db.layer0.request.PossibleGUID; +import org.simantics.db.layer0.request.PossibleVariableGUID; import org.simantics.db.layer0.request.PossibleURI; import org.simantics.db.layer0.request.PossibleVariableRepresents; import org.simantics.db.layer0.request.VariableRead; @@ -105,16 +107,22 @@ public class WorkbenchSelectionUtils { String typesStr = getTypeResourceString(processor, res, var); if(var != null) { String uri = processor.syncRequest(new VariableURI(var)); + String guid = processor.syncRequest(new PossibleVariableGUID(var)); return toJSONObjectString( "type", "\"Variable\"", "uri", safeQuotedString(uri), + "guid", safeQuotedString(guid), + "resourceId", res == null ? "" : Long.toString(res.getResourceId()), "typeResources", typesStr); } if(res != null) { - String uri = processor.syncRequest(new PossibleURI(res)); + String uri = processor.syncRequest(new PossibleURI(res)); + String guid = processor.syncRequest(new PossibleGUID(res)); return toJSONObjectString( "type", "\"Resource\"", "uri", safeQuotedString(uri), + "guid", safeQuotedString(guid), + "resourceId", Long.toString(res.getResourceId()), "typeResources", typesStr); } return "{ \"type\": \"Unknown\" }";