X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.modeling.ui%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Fui%2FcomponentTypeEditor%2FDerivedPropertiesSection.java;h=67acda962e65aa8fe7d9400f65a3a060dec5b924;hb=d4ae50a56473513bfa680c7ba8c0ac5786761abb;hp=0d6ae80d88004f06079b87795a8c9c192641fc50;hpb=7331142ca75736ec52fc2ef8487a49915e61e70d;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/DerivedPropertiesSection.java b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/DerivedPropertiesSection.java index 0d6ae80d8..67acda962 100644 --- a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/DerivedPropertiesSection.java +++ b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/DerivedPropertiesSection.java @@ -324,12 +324,7 @@ public class DerivedPropertiesSection implements ComponentTypeViewerSection { SCLContext sclContext = SCLContext.getCurrent(); Object oldGraph = sclContext.get("graph"); try { - CompileSCLMonitorRequest compileSCLMonitorRequest = new CompileSCLMonitorRequest(graph, context) { - @Override - protected String getExpressionText(ReadGraph graph) throws DatabaseException { - return expression; - } - }; + CompileSCLMonitorRequest compileSCLMonitorRequest = new ValidationCompilationRequest(graph, context, expression); Function1 exp = graph.syncRequest(compileSCLMonitorRequest); sclContext.put("graph", graph); //return exp.apply(context.getParent(graph)); @@ -416,4 +411,29 @@ public class DerivedPropertiesSection implements ComponentTypeViewerSection { return 100.0; } + private static final class ValidationCompilationRequest extends CompileSCLMonitorRequest { + private final String expression; + + private ValidationCompilationRequest(ReadGraph graph, Variable context, String expression) + throws DatabaseException { + super(graph, context); + this.expression = expression; + } + + @Override + protected String getExpressionText(ReadGraph graph) throws DatabaseException { + return expression; + } + + @Override + public int hashCode() { + return super.hashCode() + 37 * expression.hashCode(); + } + + @Override + public boolean equals(Object obj) { + return super.equals(obj) && ((ValidationCompilationRequest)obj).expression.equals(expression); + } + } + } \ No newline at end of file