X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.db.layer0%2Fsrc%2Forg%2Fsimantics%2Fdb%2Flayer0%2Futil%2FLayer0Utils.java;h=6b9b2fc6502845763871aa1383d8d8a1835ef33b;hp=dc253137f7a74fc3a5cda7783c46706c8bec265c;hb=c7adae2a1ad46c9f316093213df0320b44461606;hpb=547942cd382c0212a72b528aaa85aa686f7c1d83 diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/Layer0Utils.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/Layer0Utils.java index dc253137f..6b9b2fc65 100644 --- a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/Layer0Utils.java +++ b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/Layer0Utils.java @@ -74,6 +74,7 @@ import org.simantics.db.common.request.ObjectsWithType; import org.simantics.db.common.request.PossibleChild; import org.simantics.db.common.request.PossibleIndexRoot; import org.simantics.db.common.utils.NameUtils; +import org.simantics.db.event.ChangeListener; import org.simantics.db.exception.CancelTransactionException; import org.simantics.db.exception.DatabaseException; import org.simantics.db.exception.ServiceException; @@ -99,6 +100,7 @@ import org.simantics.db.service.ClusterControl; import org.simantics.db.service.ClusteringSupport; import org.simantics.db.service.CollectionSupport; import org.simantics.db.service.DebugSupport; +import org.simantics.db.service.GraphChangeListenerSupport; import org.simantics.db.service.ManagementSupport; import org.simantics.db.service.UndoRedoSupport; import org.simantics.db.service.XSupport; @@ -1435,4 +1437,13 @@ public class Layer0Utils { } return false; } + + public static void addMetadataListener(ChangeListener listener) { + SimanticsInternal.getSession().getService(GraphChangeListenerSupport.class).addMetadataListener(listener); + } + + public static void removeMetadataListener(ChangeListener listener) { + SimanticsInternal.getSession().getService(GraphChangeListenerSupport.class).removeMetadataListener(listener); + } + }