From 523ffdd55b3d6930a8984a8f24ea10297a93292f Mon Sep 17 00:00:00 2001 From: Alpi Rimppi Date: Wed, 28 Aug 2019 11:18:30 +0300 Subject: [PATCH] Set resources immutable gitlab #369 Change-Id: Id1ddcc8253339ac7ab60f2772ab53d5c06547b19 --- .../src/org/simantics/db/common/utils/CommonDBUtils.java | 5 +++++ bundles/org.simantics.scl.db/scl/Simantics/DBSupport.scl | 1 + 2 files changed, 6 insertions(+) diff --git a/bundles/org.simantics.db.common/src/org/simantics/db/common/utils/CommonDBUtils.java b/bundles/org.simantics.db.common/src/org/simantics/db/common/utils/CommonDBUtils.java index dcd3939a4..747e43cf1 100644 --- a/bundles/org.simantics.db.common/src/org/simantics/db/common/utils/CommonDBUtils.java +++ b/bundles/org.simantics.db.common/src/org/simantics/db/common/utils/CommonDBUtils.java @@ -318,6 +318,11 @@ public class CommonDBUtils { return xs.isClusterLoaded(clusterUID); } + public static void setImmutable(ReadGraph graph, Resource resource, boolean value) throws DatabaseException { + XSupport xs = graph.getService(XSupport.class); + xs.setImmutable(resource, value); + } + public static Type getSCLType(ReadGraph graph, RuntimeEnvironment runtimeEnvironment, String typeText) throws DatabaseException { try { return Environments.getType(runtimeEnvironment.getEnvironment(), typeText); diff --git a/bundles/org.simantics.scl.db/scl/Simantics/DBSupport.scl b/bundles/org.simantics.scl.db/scl/Simantics/DBSupport.scl index f6d1453f0..eddcba75b 100644 --- a/bundles/org.simantics.scl.db/scl/Simantics/DBSupport.scl +++ b/bundles/org.simantics.scl.db/scl/Simantics/DBSupport.scl @@ -9,6 +9,7 @@ importJava "org.simantics.db.common.utils.CommonDBUtils" where garbageResources :: [Resource] clusterUIDOfResource :: Resource -> ClusterUID isClusterLoaded :: ClusterUID -> Boolean + setImmutable :: Resource -> Boolean -> () importJava "org.simantics.scl.db.SCLFunctions" where collectClusters :: () -- 2.47.1