From c69064f9e740eb4abe8448a63d306a085e036e1c Mon Sep 17 00:00:00 2001 From: Marko Luukkainen Date: Fri, 4 Jan 2019 17:06:34 +0200 Subject: [PATCH] Added addFirst/After/Before + remove SCL functions for Ordered Sets gitlab #244 Change-Id: I40f921dc2f8cacf34692a0733ef6080e2d048eb7 --- .../org.simantics.scl.db/scl/Simantics/DB.md | 3 ++- .../org.simantics.scl.db/scl/Simantics/DB.scl | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/bundles/org.simantics.scl.db/scl/Simantics/DB.md b/bundles/org.simantics.scl.db/scl/Simantics/DB.md index e9aadef96..81ee3b6d8 100644 --- a/bundles/org.simantics.scl.db/scl/Simantics/DB.md +++ b/bundles/org.simantics.scl.db/scl/Simantics/DB.md @@ -64,7 +64,8 @@ ## Ordered sets -::value[addToOrderedSet] +::value[addToOrderedSet,addFirstToOrderedSet,addAfterToOrderedSet,addBeforeToOrderedSet] +::value[removeFromOrderedSet] ::value[setOrderedSet] ::value[elementsOfOrderedSet] ::value[parentOrderedSet] diff --git a/bundles/org.simantics.scl.db/scl/Simantics/DB.scl b/bundles/org.simantics.scl.db/scl/Simantics/DB.scl index 2ff2f51ac..adc72bb94 100644 --- a/bundles/org.simantics.scl.db/scl/Simantics/DB.scl +++ b/bundles/org.simantics.scl.db/scl/Simantics/DB.scl @@ -275,9 +275,26 @@ resourceChildrenOf :: Resource -> [Resource] resourceChildrenOf r = r # L0.ConsistsOf importJava "org.simantics.db.common.utils.OrderedSetUtils" where + "`addToOrderedSet s e` adds element `e` to ordered set `s`" @JavaName add addToOrderedSet :: Resource -> Resource -> Boolean + "`addFirstToOrderedSet s e` adds element `e` to ordered set `s` as the first element" + @JavaName addFirst + addFirstToOrderedSet :: Resource -> Resource -> Boolean + + "`addAfterToOrderedSet s p e` adds element `e` to ordered set `s` after element `p`" + @JavaName addAfter + addAfterToOrderedSet :: Resource -> Resource -> Resource -> Boolean + + "`addBeforeToOrderedSet s p e` adds element `e` to ordered set `s` before element `p`" + @JavaName addBefore + addBeforeToOrderedSet :: Resource -> Resource -> Resource -> Boolean + + "`removeFromOrderedSet s e` removes element `e` from ordered set `s`" + @JavaName remove + removeFromOrderedSet :: Resource -> Resource -> Boolean + @JavaName set setOrderedSet :: Resource -> [Resource] -> Boolean -- 2.47.1