X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.document.server%2Fscl%2FDocument%2FAll.scl;h=641f4fdc158f1e6e5546f1d6f6dbd601da3b6538;hp=23896814224bdeed738e03fb32723c466fc5d367;hb=8959bb33806d2252cdf09e42386afd242919630a;hpb=0ae2b770234dfc3cbb18bd38f324125cf0faca07 diff --git a/bundles/org.simantics.document.server/scl/Document/All.scl b/bundles/org.simantics.document.server/scl/Document/All.scl index 238968142..641f4fdc1 100644 --- a/bundles/org.simantics.document.server/scl/Document/All.scl +++ b/bundles/org.simantics.document.server/scl/Document/All.scl @@ -21,6 +21,13 @@ importJava "org.simantics.document.server.io.ITreeTableCell" where importJava "org.simantics.document.server.io.IFont" where data IFont + + @JavaName getFamily + fontFamily :: IFont -> Maybe String + @JavaName getStyle + fontStyle :: IFont -> Maybe String + @JavaName getHeight + fontHeight :: IFont -> Integer importJava "org.simantics.document.server.io.IColor" where data IColor @@ -78,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 @@ -127,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 @@ -136,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__"