2 import "Simantics/Variables"
3 import "JavaBuiltin" as Java
5 importJava "org.simantics.document.server.io.IConsole" where
7 addMessage :: IConsole -> String -> <Proc> ()
8 sendEvent :: IConsole -> String -> String -> Vector Dynamic -> <Proc> ()
10 importJava "org.simantics.document.server.io.IDocument" where
12 elementIdToObjectId :: IDocument -> String -> <Proc> String
13 getDocumentURI :: IDocument -> <Proc> String
14 getSessionGUID :: IDocument -> <Proc> String
16 importJava "org.simantics.document.server.io.ITableCell" where
19 importJava "org.simantics.document.server.io.ITreeTableCell" where
22 importJava "org.simantics.document.server.io.IFont" where
26 fontFamily :: IFont -> <Proc> Maybe String
28 fontStyle :: IFont -> <Proc> Maybe String
30 fontHeight :: IFont -> <Proc> Integer
32 importJava "org.simantics.document.server.io.IColor" where
35 importJava "org.simantics.modeling.services.ComponentNamingStrategy" where
36 data ComponentNamingStrategy
38 importJava "org.simantics.document.server.handler.EventHandler" where
41 importJava "org.simantics.document.server.handler.AbstractEventHandler" where
42 data AbstractEventHandler
44 importJava "org.simantics.document.server.bean.Command" where
47 importJava "org.simantics.document.server.bean.DataDefinition" where
50 importJava "org.simantics.document.server.io.CommandContext" where
54 possibleString :: CommandContext -> String -> Maybe String
57 possibleValue :: CommandContext -> String -> Maybe a
60 justValue :: CommandContext -> String -> a
63 containsKey :: CommandContext -> String -> Boolean
65 getKeys :: CommandContext -> [String]
67 importJava "org.simantics.document.server.io.CommandContextMutable" where
68 data CommandContextMutable
71 putString :: CommandContextMutable -> String -> String -> <Proc> CommandContextMutable
73 putValue :: CommandContextMutable -> String -> a -> <Proc> CommandContextMutable
75 merge :: CommandContextMutable -> CommandContext -> <Proc> CommandContextMutable
77 importJava "org.simantics.document.server.io.CommandContextImpl" where
80 commandContext :: () -> CommandContextMutable
82 instance Coercible CommandContextMutable CommandContext where
83 coerce = Java.unsafeCoerce
85 cloneCommandContext :: CommandContext -> <Proc> CommandContextMutable
86 cloneCommandContext context = merge (commandContext ()) context
88 instance Show CommandContext where
89 show ctx = printContext ctx
91 importJava "org.simantics.document.server.io.CommandResult" where
94 importJava "org.simantics.document.server.serverResponse.ServerResponse" where
97 commandResult :: Integer -> String -> CommandContextMutable -> CommandResult
99 importJava "org.simantics.document.server.Functions" where
102 putTuple :: CommandContextMutable -> String -> a -> CommandContextMutable
105 getTuples :: CommandContext -> String -> [a]
107 printContext :: CommandContext -> String
109 commandList :: Variable -> <ReadGraph> [Command]
111 dataDefinitions :: Variable -> <ReadGraph> [DataDefinition]
113 emptyOnClick :: () -> <ReadGraph> AbstractEventHandler
115 writeEventHandler :: Variable -> (Variable -> (String -> Maybe String) -> <WriteGraph> String) -> <ReadGraph> AbstractEventHandler
116 readEventHandler :: Variable -> (Variable -> (String -> Maybe String) -> <ReadGraph> String) -> <ReadGraph> AbstractEventHandler
117 eventHandler :: ((String -> Maybe String) -> String) -> <ReadGraph> AbstractEventHandler
119 readEventHandler2 :: (CommandContext -> <ReadGraph> Maybe CommandResult) -> <ReadGraph> AbstractEventHandler
120 writeEventHandler2 :: (CommandContext -> <WriteGraph> Maybe CommandResult) -> <ReadGraph> AbstractEventHandler
121 eventHandler2 :: (CommandContext -> Maybe CommandResult) -> <ReadGraph> AbstractEventHandler
123 responseHandler :: Variable -> String -> <ReadGraph> AbstractEventHandler
125 sclStateVariable :: Variable -> Variable -> String -> <ReadGraph> Variable
126 sclStateValueOrDefault :: Variable -> Variable -> String -> a -> <ReadGraph> a
127 setSclStateValue :: Variable -> Variable -> String -> a -> <WriteGraph> ()
129 projectComponentState :: Variable -> String -> a -> <ReadGraph> a
130 setProjectComponentState :: Variable -> String -> a -> <WriteGraph> ()
132 documentModelContribution :: Resource -> <ReadGraph> [Variable]
133 documentModelContributionLabel :: Variable -> <ReadGraph> String
135 @JavaName getPropertyValueCached
136 propertyValueCached_ :: Variable -> String -> Binding a -> <ReadGraph> a
138 stateVariable :: Variable -> <ReadGraph> Variable
140 compileDocumentSCLValueExpression :: Variable -> <ReadGraph> String
142 propertyValueCached :: Serializable a => Typeable a => Variable -> String -> <ReadGraph> a
143 propertyValueCached var prop = propertyValueCached_ var prop binding
145 displayValue :: Variable -> String -> <ReadGraph> String
146 displayValue var str = propertyValue (property var str) "HasDisplayValue"
148 displayValue0 :: Variable -> <ReadGraph> String
149 displayValue0 var = propertyValue var "HasDisplayValue"
151 consoleLog :: CommandContext -> String -> ()
152 consoleLog context message = match possibleValue context "console" with
154 Just console -> runProc $ addMessage console message
156 contextDocument :: CommandContext -> <Proc> IDocument
157 contextDocument ctx = justValue ctx "__document__"