]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.spreadsheet/src/org/simantics/spreadsheet/solver/SpreadsheetMapping.java
Adopt spreadsheet changes made in Balas development
[simantics/platform.git] / bundles / org.simantics.spreadsheet / src / org / simantics / spreadsheet / solver / SpreadsheetMapping.java
diff --git a/bundles/org.simantics.spreadsheet/src/org/simantics/spreadsheet/solver/SpreadsheetMapping.java b/bundles/org.simantics.spreadsheet/src/org/simantics/spreadsheet/solver/SpreadsheetMapping.java
new file mode 100644 (file)
index 0000000..e08c6c0
--- /dev/null
@@ -0,0 +1,53 @@
+package org.simantics.spreadsheet.solver;
+
+import java.io.Serializable;
+
+import org.simantics.structural.synchronization.utils.ComponentFactory;
+import org.simantics.structural.synchronization.utils.MappingBase;
+import org.simantics.structural.synchronization.utils.Solver;
+import org.simantics.structural.synchronization.utils.StateUndoContextBase;
+
+public class SpreadsheetMapping extends MappingBase<SheetLineComponent> implements Serializable {
+
+    private static final long serialVersionUID = -7556699663877911393L;
+
+    final SheetLineComponent configuration;
+
+    public SpreadsheetMapping(SheetLineComponent configuration) {
+        super(configuration, true);
+        this.configuration = configuration;
+    }
+
+    @Override
+    public SheetLineComponent getConfiguration() {
+        return configuration;
+    }
+
+    @Override
+    public StateUndoContextBase createUndoContext() {
+        return new StateUndoContextBase() {
+
+            @Override
+            public void saveState(Solver solver, int componentId, String uid) {
+            }
+
+            @Override
+            public boolean loadState(Solver solver, int componentId, String uid) {
+                return false;
+            }
+        };
+    }
+
+    @Override
+    public ComponentFactory<SheetLineComponent> createComponentFactory() {
+        return new ComponentFactory<SheetLineComponent>() {
+
+            @Override
+            public SheetLineComponent create(String uid) {
+                return new SheetLineComponent(uid);
+            }
+
+        };
+    }
+
+}