importJava "org.simantics.document.server.io.IFont" where
data IFont
+
+ @JavaName getFamily
+ fontFamily :: IFont -> <Proc> Maybe String
+ @JavaName getStyle
+ fontStyle :: IFont -> <Proc> Maybe String
+ @JavaName getHeight
+ fontHeight :: IFont -> <Proc> Integer
importJava "org.simantics.document.server.io.IColor" where
data IColor
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__"