From: Marko Luukkainen Date: Wed, 30 May 2018 14:25:16 +0000 (+0300) Subject: Minor adjustments X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F11%2F1811%2F1;p=simantics%2Finterop.git Minor adjustments Allowing code re-use by making things public Fix for property change matching (for filtering) gitlab #1 Change-Id: I40a1493ee7777f4e1ffbc820ca642878ae5b19ab --- 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