]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.db/scl/Simantics/DB.scl
Map some ListUtils functions to SCL (refs #7134).
[simantics/platform.git] / bundles / org.simantics.scl.db / scl / Simantics / DB.scl
index 280f6ebbf7286397a867b8f96e67fdfbc9c8df04..3d71ae5143a577bf7ec7aeafa3f863b4b978260b 100644 (file)
@@ -256,6 +256,22 @@ importJava "org.simantics.db.common.utils.OrderedSetUtils" where
 importJava "org.simantics.db.common.utils.ListUtils" where
     @JavaName toList
     elementsOfList :: Resource -> <ReadGraph> [Resource]
+    
+    @JavaName create
+    createList :: [Resource] -> <WriteGraph> Resource
+    
+    @javaName insertBack
+    insertBack :: Resource -> [Resource] -> <WriteGraph> ()
+    
+    @javaName removeElement
+    removeElement :: Resource -> Resource -> <WriteGraph> Boolean
+    
+    @javaName swapWithPrevious
+    swapWithPrevious :: Resource -> Resource -> <WriteGraph> Boolean
+
+    @javaName swapWithNext
+    swapWithNext :: Resource -> Resource -> <WriteGraph> Boolean
+
 
 importJava "org.simantics.db.common.utils.CommonDBUtils" where
     isParent :: Resource -> Resource -> <ReadGraph> Boolean
@@ -302,6 +318,11 @@ importJava "org.simantics.scl.db.SCLFunctions" where
     unaryQuery :: (a -> <ReadGraph,e> b) -> a -> <ReadGraph> b
     unaryQueryCached :: (a -> <ReadGraph,e> b) -> a -> <ReadGraph> b
 
+    "Makes a new read request with given procedure for calculating the result. The request is cached only if the current request is listened."
+    subquery :: (<ReadGraph,Proc> a) -> <ReadGraph,Proc> a
+    "Makes a new read request with given procedure for calculating the result. The request is always cached."
+    subqueryC :: (<ReadGraph,Proc> a) -> <ReadGraph,Proc> a
+
 importJava "org.simantics.db.layer0.util.Layer0Utils" where
     undo :: () -> <Proc> String
     undoOperations :: Integer -> <Proc> String
@@ -312,6 +333,8 @@ importJava "org.simantics.db.layer0.util.Layer0Utils" where
     sortByCluster :: [a] -> (a->Resource) -> <ReadGraph> [a]
     makeSynchronous :: Boolean -> <ReadGraph> ()
     listOntologies :: () -> <ReadGraph> [Resource]
+    emptyTrashBin :: () -> <Proc> ()
+    purgeDatabase :: () -> <Proc> ()
 
     @private
     @JavaName copyTo