]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Required changes in Spreadsheet
authorAntti Villberg <antti.villberg@semantum.fi>
Fri, 16 Nov 2018 13:11:00 +0000 (15:11 +0200)
committerAntti Villberg <antti.villberg@semantum.fi>
Sat, 17 Nov 2018 09:27:32 +0000 (11:27 +0200)
gitlab #206

Change-Id: I2366b6e7395750cc9b6649abd3e77ef1661d2d1f

23 files changed:
bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/SpreadsheetBook.java
bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/SpreadsheetReferenceResolver.java
bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/synchronization/LineCommandBuilder.java
bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/synchronization/LineNodeUpdater.java
bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/synchronization/LineUpdater.java
bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/synchronization/LinesCommandBuilder.java
bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/synchronization/NullCommandBuilder.java
bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/synchronization/NullUpdater.java
bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/synchronization/SpreadsheetSynchronizationEventHandler.java
bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/synchronization/StyleUpdater.java
bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/CommandBuilder.java [deleted file]
bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/ModuleUpdaterFactoryBase.java [deleted file]
bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/internal/Policy.java [moved from bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/internal/Policy.java with 100% similarity]
bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/utils/CommandBuilder.java [new file with mode: 0644]
bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/utils/ConnectionUpdateRule.java [moved from bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/ConnectionUpdateRule.java with 73% similarity]
bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/utils/ModuleCallback.java [moved from bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/ModuleCallback.java with 61% similarity]
bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/utils/ModuleUpdateContext.java [moved from bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/ModuleUpdateContext.java with 96% similarity]
bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/utils/ModuleUpdaterBase.java [moved from bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/ModuleUpdaterBase.java with 97% similarity]
bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/utils/ModuleUpdaterFactoryBase.java [new file with mode: 0644]
bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/utils/PropertyUpdateRule.java [moved from bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/PropertyUpdateRule.java with 77% similarity]
bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/utils/ReferenceResolverBase.java [moved from bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/ReferenceResolverBase.java with 96% similarity]
bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/utils/SolverNameUtil.java [moved from bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/SolverNameUtil.java with 95% similarity]
bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/utils/SynchronizationEventHandlerBase.java [moved from bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/SynchronizationEventHandlerBase.java with 97% similarity]

index d741d4c7abf5870958ff585a675649c9bfc6127c..88fea35da8a01daa20240ae334314865f3cced1a 100644 (file)
@@ -24,12 +24,12 @@ import org.simantics.spreadsheet.graph.synchronization.LineUpdater;
 import org.simantics.spreadsheet.graph.synchronization.NullUpdater;
 import org.simantics.spreadsheet.graph.synchronization.SheetLineComponent;
 import org.simantics.spreadsheet.graph.synchronization.StyleUpdater;
-import org.simantics.structural.synchronization.base.ModuleUpdaterBase;
-import org.simantics.structural.synchronization.base.ModuleUpdaterFactoryBase;
-import org.simantics.structural.synchronization.base.SolverNameUtil;
 import org.simantics.structural.synchronization.utils.ComponentFactory;
 import org.simantics.structural.synchronization.utils.MappingBase;
+import org.simantics.structural.synchronization.utils.ModuleUpdaterBase;
+import org.simantics.structural.synchronization.utils.ModuleUpdaterFactoryBase;
 import org.simantics.structural.synchronization.utils.Solver;
+import org.simantics.structural.synchronization.utils.SolverNameUtil;
 
 import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap;
 import it.unimi.dsi.fastutil.longs.AbstractLongList;
index 6c3c0b17ca9c648f5401f48d181ef6da0b5166c7..8bb3a9b9b34a5b6cb00cff5c114363413ea6fa47 100644 (file)
@@ -1,7 +1,7 @@
 package org.simantics.spreadsheet.graph;
 
 import org.simantics.spreadsheet.graph.synchronization.SheetLineComponent;
-import org.simantics.structural.synchronization.base.ReferenceResolverBase;
+import org.simantics.structural.synchronization.utils.ReferenceResolverBase;
 import org.simantics.structural.synchronization.utils.Solver;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
index 90c96cc2d017f5be51e411e1aa1f8d0fb7987f9c..a7e5f87b14a7af63035d5a723f586126a4da83c3 100644 (file)
@@ -17,7 +17,7 @@ import org.simantics.spreadsheet.graph.function.LineContentBeanCell;
 import org.simantics.spreadsheet.graph.parser.SheetFormulaParser;
 import org.simantics.spreadsheet.graph.parser.ast.AstArrayFormulaReference;
 import org.simantics.spreadsheet.graph.parser.ast.AstValue;
-import org.simantics.structural.synchronization.base.CommandBuilder;
+import org.simantics.structural.synchronization.utils.CommandBuilder;
 import org.simantics.structural.synchronization.utils.Solver;
 
 public class LineCommandBuilder implements CommandBuilder {
index 811a35c23b3a9dc3f44827b75beb92954042624d..c731c44370517ae5397a136d6508c32bd30bac96 100644 (file)
@@ -4,10 +4,10 @@ import java.util.Collection;
 import java.util.Map;
 
 import org.simantics.databoard.binding.mutable.Variant;
-import org.simantics.structural.synchronization.base.CommandBuilder;
-import org.simantics.structural.synchronization.base.ModuleUpdateContext;
-import org.simantics.structural.synchronization.base.ModuleUpdaterBase;
-import org.simantics.structural.synchronization.base.PropertyUpdateRule;
+import org.simantics.structural.synchronization.utils.CommandBuilder;
+import org.simantics.structural.synchronization.utils.ModuleUpdateContext;
+import org.simantics.structural.synchronization.utils.ModuleUpdaterBase;
+import org.simantics.structural.synchronization.utils.PropertyUpdateRule;
 
 public class LineNodeUpdater extends ModuleUpdaterBase<SheetLineComponent> {
        
index baa0851b2503006182b9cb53cc055329cfdc8fe1..66acdcefef4e4faabc008b15e25ae433d984ddcc 100644 (file)
@@ -6,11 +6,10 @@ import java.util.Map;
 import org.simantics.databoard.adapter.AdaptException;
 import org.simantics.databoard.binding.mutable.Variant;
 import org.simantics.spreadsheet.graph.function.LineContentBean;
-import org.simantics.structural.synchronization.base.CommandBuilder;
-import org.simantics.structural.synchronization.base.ModuleUpdateContext;
-import org.simantics.structural.synchronization.base.ModuleUpdaterBase;
-import org.simantics.structural.synchronization.base.PropertyUpdateRule;
-import org.simantics.structural.synchronization.utils.Solver;
+import org.simantics.structural.synchronization.utils.CommandBuilder;
+import org.simantics.structural.synchronization.utils.ModuleUpdateContext;
+import org.simantics.structural.synchronization.utils.ModuleUpdaterBase;
+import org.simantics.structural.synchronization.utils.PropertyUpdateRule;
 
 public class LineUpdater extends ModuleUpdaterBase<SheetLineComponent> {
        
index 4cf804c2dd1cb1859591ec050c4fcc6990f160a3..cd1a6f36ae5e5943f2d6aba88264c3fe71ef155a 100644 (file)
@@ -2,7 +2,7 @@ package org.simantics.spreadsheet.graph.synchronization;
 
 import org.simantics.spreadsheet.graph.SpreadsheetBook;
 import org.simantics.spreadsheet.graph.SpreadsheetLines;
-import org.simantics.structural.synchronization.base.CommandBuilder;
+import org.simantics.structural.synchronization.utils.CommandBuilder;
 import org.simantics.structural.synchronization.utils.Solver;
 
 public class LinesCommandBuilder implements CommandBuilder {
index 80ed1ca13cda9743697563548b1ddb45d7f9c680..ea37490ff53c5cb5fa9871f22edc92a3b0c94c39 100644 (file)
@@ -1,6 +1,6 @@
 package org.simantics.spreadsheet.graph.synchronization;
 
-import org.simantics.structural.synchronization.base.CommandBuilder;
+import org.simantics.structural.synchronization.utils.CommandBuilder;
 import org.simantics.structural.synchronization.utils.Solver;
 
 public class NullCommandBuilder implements CommandBuilder {
index e03169fd4b9f0f72bb92d01747662591bac53051..3fa3379aa9b2c3fa5b9e27c62dba4ce5f18c0541 100644 (file)
@@ -1,7 +1,7 @@
 package org.simantics.spreadsheet.graph.synchronization;
 
-import org.simantics.structural.synchronization.base.CommandBuilder;
-import org.simantics.structural.synchronization.base.ModuleUpdaterBase;
+import org.simantics.structural.synchronization.utils.CommandBuilder;
+import org.simantics.structural.synchronization.utils.ModuleUpdaterBase;
 
 public class NullUpdater extends ModuleUpdaterBase<SheetLineComponent> {
        
index 716086b63b76635a654b787a1079a6d46242b735..4d943fb342b8d22615873ed48ef890372945b5e8 100644 (file)
@@ -3,7 +3,7 @@ package org.simantics.spreadsheet.graph.synchronization;
 import org.simantics.db.ReadGraph;
 import org.simantics.spreadsheet.graph.SpreadsheetBook;
 import org.simantics.spreadsheet.graph.SpreadsheetReferenceResolver;
-import org.simantics.structural.synchronization.base.SynchronizationEventHandlerBase;
+import org.simantics.structural.synchronization.utils.SynchronizationEventHandlerBase;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index 4451d13140a6049d3b3271d90757b4bfcf2921ce..be020a6257c803541d777a7ed29ca02736f2390d 100644 (file)
@@ -8,10 +8,10 @@ import org.simantics.datatypes.literal.Font;
 import org.simantics.datatypes.literal.RGB;
 import org.simantics.spreadsheet.graph.SpreadsheetBook;
 import org.simantics.spreadsheet.graph.SpreadsheetStyle;
-import org.simantics.structural.synchronization.base.CommandBuilder;
-import org.simantics.structural.synchronization.base.ModuleUpdateContext;
-import org.simantics.structural.synchronization.base.ModuleUpdaterBase;
-import org.simantics.structural.synchronization.base.PropertyUpdateRule;
+import org.simantics.structural.synchronization.utils.CommandBuilder;
+import org.simantics.structural.synchronization.utils.ModuleUpdateContext;
+import org.simantics.structural.synchronization.utils.ModuleUpdaterBase;
+import org.simantics.structural.synchronization.utils.PropertyUpdateRule;
 import org.simantics.structural.synchronization.utils.Solver;
 
 public class StyleUpdater extends ModuleUpdaterBase<SheetLineComponent> {
diff --git a/bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/CommandBuilder.java b/bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/CommandBuilder.java
deleted file mode 100644 (file)
index 57b8d9a..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.simantics.structural.synchronization.base;
-
-import org.simantics.structural.synchronization.utils.Solver;
-
-public interface CommandBuilder {
-
-       void apply(Solver solver);
-       <T> T getConcrete();
-       
-}
diff --git a/bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/ModuleUpdaterFactoryBase.java b/bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/ModuleUpdaterFactoryBase.java
deleted file mode 100644 (file)
index f30527e..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.simantics.structural.synchronization.base;
-
-import org.simantics.db.exception.DatabaseException;
-import org.simantics.structural.synchronization.utils.ComponentBase;
-
-
-public interface ModuleUpdaterFactoryBase<T extends ComponentBase<T>> {
-
-    public ModuleUpdaterBase<T> createUpdater(String id) throws DatabaseException;
-
-}
diff --git a/bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/utils/CommandBuilder.java b/bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/utils/CommandBuilder.java
new file mode 100644 (file)
index 0000000..8440900
--- /dev/null
@@ -0,0 +1,8 @@
+package org.simantics.structural.synchronization.utils;
+
+public interface CommandBuilder {
+
+       void apply(Solver solver);
+       <T> T getConcrete();
+       
+}
@@ -1,10 +1,9 @@
-package org.simantics.structural.synchronization.base;
+package org.simantics.structural.synchronization.utils;
 
 import java.util.Collection;
 import java.util.Map;
 
 import org.simantics.databoard.binding.mutable.Variant;
-import org.simantics.structural.synchronization.utils.ComponentBase;
 
 public interface ConnectionUpdateRule<T extends ComponentBase<T>> {
 
@@ -1,12 +1,10 @@
-package org.simantics.structural.synchronization.base;
-
-import gnu.trove.map.hash.THashMap;
+package org.simantics.structural.synchronization.utils;
 
 import java.util.ArrayList;
 
 import org.simantics.databoard.binding.mutable.Variant;
-import org.simantics.structural.synchronization.utils.ComponentBase;
-import org.simantics.structural.synchronization.utils.Solver;
+
+import gnu.trove.map.hash.THashMap;
 
 public class ModuleUpdateContext<T extends ComponentBase<T>> {
 
@@ -1,6 +1,4 @@
-package org.simantics.structural.synchronization.base;
-
-import gnu.trove.map.hash.THashMap;
+package org.simantics.structural.synchronization.utils;
 
 import java.util.Collection;
 import java.util.Collections;
@@ -9,7 +7,8 @@ import java.util.Map;
 import org.simantics.databoard.binding.mutable.Variant;
 import org.simantics.structural.synchronization.protocol.Connection;
 import org.simantics.structural.synchronization.protocol.SerializedVariable;
-import org.simantics.structural.synchronization.utils.ComponentBase;
+
+import gnu.trove.map.hash.THashMap;
 
 abstract public class ModuleUpdaterBase<T extends ComponentBase<T>> {
 
diff --git a/bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/utils/ModuleUpdaterFactoryBase.java b/bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/utils/ModuleUpdaterFactoryBase.java
new file mode 100644 (file)
index 0000000..670ab00
--- /dev/null
@@ -0,0 +1,7 @@
+package org.simantics.structural.synchronization.utils;
+
+public interface ModuleUpdaterFactoryBase<T extends ComponentBase<T>> {
+
+    public ModuleUpdaterBase<T> createUpdater(String id) throws Exception;
+
+}
@@ -1,10 +1,9 @@
-package org.simantics.structural.synchronization.base;
+package org.simantics.structural.synchronization.utils;
 
 import java.util.Collection;
 import java.util.Map;
 
 import org.simantics.databoard.binding.mutable.Variant;
-import org.simantics.structural.synchronization.utils.ComponentBase;
 
 
 public interface PropertyUpdateRule<T extends ComponentBase<T>> {
@@ -1,17 +1,15 @@
-package org.simantics.structural.synchronization.base;
-
-import gnu.trove.map.hash.THashMap;
-import gnu.trove.procedure.TObjectObjectProcedure;
+package org.simantics.structural.synchronization.utils;
 
 import java.util.ArrayList;
 import java.util.Collections;
 
 import org.simantics.databoard.util.URIStringUtils;
 import org.simantics.structural.synchronization.protocol.SynchronizationEventHandler;
-import org.simantics.structural.synchronization.utils.ComponentBase;
-import org.simantics.structural.synchronization.utils.Solver;
 import org.slf4j.Logger;
 
+import gnu.trove.map.hash.THashMap;
+import gnu.trove.procedure.TObjectObjectProcedure;
+
 abstract public class ReferenceResolverBase<T extends ComponentBase<T>> {
        
     protected SynchronizationEventHandler eventHandler;
@@ -1,4 +1,4 @@
-package org.simantics.structural.synchronization.base;
+package org.simantics.structural.synchronization.utils;
 
 import java.util.ArrayDeque;
 import java.util.Collection;
@@ -8,17 +8,12 @@ import java.util.Queue;
 
 import org.simantics.databoard.Bindings;
 import org.simantics.databoard.adapter.AdaptException;
-import org.simantics.db.exception.DatabaseException;
 import org.simantics.structural.synchronization.internal.Policy;
 import org.simantics.structural.synchronization.protocol.ChildInfo;
 import org.simantics.structural.synchronization.protocol.Connection;
 import org.simantics.structural.synchronization.protocol.SerializedVariable;
 import org.simantics.structural.synchronization.protocol.SynchronizationEventHandler;
 import org.simantics.structural.synchronization.protocol.SynchronizationException;
-import org.simantics.structural.synchronization.utils.ComponentBase;
-import org.simantics.structural.synchronization.utils.ComponentFactory;
-import org.simantics.structural.synchronization.utils.MappingBase;
-import org.simantics.structural.synchronization.utils.Solver;
 import org.slf4j.Logger;
 
 import gnu.trove.map.hash.THashMap;
@@ -379,7 +374,7 @@ public abstract class SynchronizationEventHandlerBase<T extends ComponentBase<T>
             ModuleUpdaterBase<T> updater;
             try {
                 updater = moduleUpdaterFactory.createUpdater(id);
-            } catch (DatabaseException e) {
+            } catch (Exception e) {
                 throw new RuntimeException(e);
             }
             if(updater == null)