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
25 importJava "org.simantics.document.server.io.IColor" where
28 importJava "org.simantics.modeling.services.ComponentNamingStrategy" where
29 data ComponentNamingStrategy
31 importJava "org.simantics.document.server.handler.EventHandler" where
34 importJava "org.simantics.document.server.handler.AbstractEventHandler" where
35 data AbstractEventHandler
37 importJava "org.simantics.document.server.bean.Command" where
40 importJava "org.simantics.document.server.bean.DataDefinition" where
43 importJava "org.simantics.document.server.io.CommandContext" where
47 possibleString :: CommandContext -> String -> Maybe String
50 possibleValue :: CommandContext -> String -> Maybe a
53 justValue :: CommandContext -> String -> a
56 containsKey :: CommandContext -> String -> Boolean
58 getKeys :: CommandContext -> [String]
60 importJava "org.simantics.document.server.io.CommandContextMutable" where
61 data CommandContextMutable
64 putString :: CommandContextMutable -> String -> String -> <Proc> CommandContextMutable
66 putValue :: CommandContextMutable -> String -> a -> <Proc> CommandContextMutable
68 merge :: CommandContextMutable -> CommandContext -> <Proc> CommandContextMutable
70 importJava "org.simantics.document.server.io.CommandContextImpl" where
73 commandContext :: () -> CommandContextMutable
75 instance Coercible CommandContextMutable CommandContext where
76 coerce = Java.unsafeCoerce
78 cloneCommandContext :: CommandContext -> <Proc> CommandContextMutable
79 cloneCommandContext context = merge (commandContext ()) context
81 importJava "org.simantics.document.server.io.CommandResult" where
84 importJava "org.simantics.document.server.serverResponse.ServerResponse" where
87 commandResult :: Integer -> String -> CommandContextMutable -> CommandResult
89 importJava "org.simantics.document.server.Functions" where
92 putTuple :: CommandContextMutable -> String -> a -> CommandContextMutable
95 getTuples :: CommandContext -> String -> [a]
97 printContext :: CommandContext -> String
99 commandList :: Variable -> <ReadGraph> [Command]
101 dataDefinitions :: Variable -> <ReadGraph> [DataDefinition]
103 emptyOnClick :: () -> <ReadGraph> AbstractEventHandler
105 writeEventHandler :: Variable -> (Variable -> (String -> Maybe String) -> <WriteGraph> String) -> <ReadGraph> AbstractEventHandler
106 readEventHandler :: Variable -> (Variable -> (String -> Maybe String) -> <ReadGraph> String) -> <ReadGraph> AbstractEventHandler
107 eventHandler :: ((String -> Maybe String) -> String) -> <ReadGraph> AbstractEventHandler
109 readEventHandler2 :: (CommandContext -> <ReadGraph> Maybe CommandResult) -> <ReadGraph> AbstractEventHandler
110 writeEventHandler2 :: (CommandContext -> <WriteGraph> Maybe CommandResult) -> <ReadGraph> AbstractEventHandler
111 eventHandler2 :: (CommandContext -> Maybe CommandResult) -> <ReadGraph> AbstractEventHandler
113 responseHandler :: Variable -> String -> <ReadGraph> AbstractEventHandler
115 sclStateVariable :: Variable -> Variable -> String -> <ReadGraph> Variable
116 sclStateValueOrDefault :: Variable -> Variable -> String -> a -> <ReadGraph> a
117 setSclStateValue :: Variable -> Variable -> String -> a -> <WriteGraph> ()
119 projectComponentState :: Variable -> String -> a -> <ReadGraph> a
120 setProjectComponentState :: Variable -> String -> a -> <WriteGraph> ()
122 documentModelContribution :: Resource -> <ReadGraph> [Variable]
123 documentModelContributionLabel :: Variable -> <ReadGraph> String
125 @JavaName getPropertyValueCached
126 propertyValueCached_ :: Variable -> String -> Binding a -> <ReadGraph> a
128 stateVariable :: Variable -> <ReadGraph> Variable
130 propertyValueCached :: Serializable a => Typeable a => Variable -> String -> <ReadGraph> a
131 propertyValueCached var prop = propertyValueCached_ var prop binding
133 displayValue :: Variable -> String -> <ReadGraph> String
134 displayValue var str = propertyValue (property var str) "HasDisplayValue"
136 displayValue0 :: Variable -> <ReadGraph> String
137 displayValue0 var = propertyValue var "HasDisplayValue"
139 consoleLog :: Variable -> String -> <ReadGraph> ()
140 consoleLog state message = do
141 console = state#console
142 runProc $ addMessage console message
144 contextDocument :: CommandContext -> <Proc> IDocument
145 contextDocument ctx = justValue ctx "__document__"