X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.document.server%2Fscl%2FDocument%2FAll.scl;h=641f4fdc158f1e6e5546f1d6f6dbd601da3b6538;hb=7fe2a02ad295ec7406f44e8f86b7d25deedceb8b;hp=fa83a224acfc2d7076af4417e2f2e181680e93e7;hpb=e3f78a075fb589c0c940f6e13d92a45a39a3ac0f;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.document.server/scl/Document/All.scl b/bundles/org.simantics.document.server/scl/Document/All.scl index fa83a224a..641f4fdc1 100644 --- a/bundles/org.simantics.document.server/scl/Document/All.scl +++ b/bundles/org.simantics.document.server/scl/Document/All.scl @@ -85,6 +85,9 @@ instance Coercible CommandContextMutable CommandContext where cloneCommandContext :: CommandContext -> CommandContextMutable cloneCommandContext context = merge (commandContext ()) context +instance Show CommandContext where + show ctx = printContext ctx + importJava "org.simantics.document.server.io.CommandResult" where data CommandResult @@ -134,6 +137,8 @@ importJava "org.simantics.document.server.Functions" where stateVariable :: Variable -> Variable + compileDocumentSCLValueExpression :: Variable -> String + propertyValueCached :: Serializable a => Typeable a => Variable -> String -> a propertyValueCached var prop = propertyValueCached_ var prop binding @@ -143,10 +148,10 @@ displayValue var str = propertyValue (property var str) "HasDisplayValue" displayValue0 :: Variable -> String displayValue0 var = propertyValue var "HasDisplayValue" -consoleLog :: Variable -> String -> () -consoleLog state message = do - console = state#console - runProc $ addMessage console message +consoleLog :: CommandContext -> String -> () +consoleLog context message = match possibleValue context "console" with + Nothing -> () + Just console -> runProc $ addMessage console message contextDocument :: CommandContext -> IDocument contextDocument ctx = justValue ctx "__document__"