From 9a54e6b7fe17613852fc676deb4dc42c3c5e2b8f Mon Sep 17 00:00:00 2001 From: Marko Luukkainen Date: Wed, 30 May 2018 17:25:16 +0300 Subject: [PATCH] Minor adjustments Allowing code re-use by making things public Fix for property change matching (for filtering) gitlab #1 Change-Id: I40a1493ee7777f4e1ffbc820ca642878ae5b19ab --- .../interop/update/model/ModelUpdate.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/org.simantics.interop.update/src/org/simantics/interop/update/model/ModelUpdate.java b/org.simantics.interop.update/src/org/simantics/interop/update/model/ModelUpdate.java index 2149fc5..e736e22 100644 --- a/org.simantics.interop.update/src/org/simantics/interop/update/model/ModelUpdate.java +++ b/org.simantics.interop.update/src/org/simantics/interop/update/model/ModelUpdate.java @@ -3,6 +3,7 @@ package org.simantics.interop.update.model; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.Deque; import java.util.List; import java.util.Map.Entry; @@ -145,6 +146,10 @@ public abstract class ModelUpdate { } + public List getFilters() { + return Collections.unmodifiableList(filters); + } + /** * Adds an user filter. Use refreshUserFilters() to apply the changes. * @param filter @@ -168,6 +173,10 @@ public abstract class ModelUpdate { userFilters.clear(); } + public List getUserFilters() { + return userFilters; + } + public void refreshUserFilters() throws DatabaseException{ // use user filters to set visible flags of changes. // First, set all changes visible. @@ -233,6 +242,7 @@ public abstract class ModelUpdate { continue; if (lc.getFirst().equals(rc.getFirst())) { comparable.map(lc, rc); + break; } } } @@ -331,7 +341,7 @@ public abstract class ModelUpdate { - private class FilterChangesRead implements Read { + public static class FilterChangesRead implements Read { private GraphChanges changes; private List filters; @@ -347,7 +357,7 @@ public abstract class ModelUpdate { /** * Filters changes: - * 1. Changes that are not essential for model update (changes that can be found when the models are axcatly the same) + * 1. Changes that are not essential for model update (changes that can be found when the models are exactly the same) * 2. Runs custom filters for value changes. * * @param g -- 2.47.1