cloneCommandContext :: CommandContext -> <Proc> CommandContextMutable
cloneCommandContext context = merge (commandContext ()) context
+instance Show CommandContext where
+ show ctx = printContext ctx
+
importJava "org.simantics.document.server.io.CommandResult" where
data CommandResult
displayValue0 :: Variable -> <ReadGraph> String
displayValue0 var = propertyValue var "HasDisplayValue"
-consoleLog :: Variable -> String -> <ReadGraph> ()
-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 -> <Proc> IDocument
contextDocument ctx = justValue ctx "__document__"