]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.platform.ui.ontology/scl/Simantics/PlatformUI.scl
Playground for Antti.
[simantics/platform.git] / bundles / org.simantics.platform.ui.ontology / scl / Simantics / PlatformUI.scl
similarity index 61%
rename from bundles/org.simantics.platform.ui.ontology/graph/scl/SCLMain.scl
rename to bundles/org.simantics.platform.ui.ontology/scl/Simantics/PlatformUI.scl
index 44c53d80e4cfa35e9320f51ae3b93227eac94dbe..316a5f15e34fa85086dc9d58a912c6468b491c7e 100644 (file)
@@ -1,5 +1,7 @@
 include "Simantics/All"
 include "SWT/All"
+import "UI/Progress"
+import "Simantics/IssueUI"
 
 useSelectedHandler :: Variable -> (String -> Maybe String) -> <WriteGraph> String
 useSelectedHandler input parameters = do
@@ -84,4 +86,48 @@ standardPropertiesElementTransformation var = do
           Nothing -> var
           Just component -> resourceVariable component
       else var
-  
\ No newline at end of file
+
+configureButtonClickHandler :: Resource -> CommandContext -> <Proc> Maybe CommandResult
+configureButtonClickHandler indexRoot context = do
+    showIssueConfigurationDialog indexRoot 
+    Nothing
+      
+configureButtonClick :: Variable -> <ReadGraph,Proc> AbstractEventHandler
+configureButtonClick self = do
+  indexRoot = represents $ contextVariable self
+  eventHandler2 $ configureButtonClickHandler indexRoot
+
+validateButtonClickHandler :: Resource -> CommandContext -> <Proc> Maybe CommandResult
+validateButtonClickHandler indexRoot context = do
+    runActiveValidations (createNullProgressMonitor ()) indexRoot
+    Nothing
+
+validateButtonClick :: Variable -> <ReadGraph,Proc> AbstractEventHandler
+validateButtonClick self = do
+  indexRoot = represents $ contextVariable self
+  eventHandler2 $ validateButtonClickHandler indexRoot
+
+issueSourceExplorerCheckHandler :: Resource -> CommandContext -> <Proc> Maybe CommandResult
+issueSourceExplorerCheckHandler indexRoot context = match possibleValue context "item" with
+  Nothing -> Nothing
+  Just issueSource -> match possibleValue context "checked" with
+    Nothing -> Nothing
+    Just value -> if value then do
+        syncWrite $ \_ -> claim issueSource ISSUE.IssueSource.Selected (parent issueSource)
+        Nothing
+      else do
+        syncWrite $ \_ -> denyByPredicate issueSource ISSUE.IssueSource.Selected
+        Nothing  
+
+issueSourceExplorerCheck :: Variable -> <ReadGraph,Proc> AbstractEventHandler
+issueSourceExplorerCheck self = do
+  indexRoot = represents $ contextVariable self
+  eventHandler2 $ issueSourceExplorerCheckHandler indexRoot
+
+usedIssueSources :: Resource -> <ReadGraph> [Resource]
+usedIssueSources indexRoot = do
+   objectsWithType indexRoot L0.ConsistsOf ISSUE.IssueSource
+
+checkedStateRule :: BrowseNodeRule CheckedState
+checkedStateRule (ResourceX r) = if existsStatement3 r ISSUE.IssueSource.Selected (parent r) then CHECKED else NOT_CHECKED
+      
\ No newline at end of file