]> gerrit.simantics Code Review - simantics/platform.git/blob - 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
1 package org.simantics.spreadsheet.solver;
2
3 import java.io.Serializable;
4
5 import org.simantics.structural.synchronization.utils.ComponentFactory;
6 import org.simantics.structural.synchronization.utils.MappingBase;
7 import org.simantics.structural.synchronization.utils.Solver;
8 import org.simantics.structural.synchronization.utils.StateUndoContextBase;
9
10 public class SpreadsheetMapping extends MappingBase<SheetLineComponent> implements Serializable {
11
12     private static final long serialVersionUID = -7556699663877911393L;
13
14     final SheetLineComponent configuration;
15
16     public SpreadsheetMapping(SheetLineComponent configuration) {
17         super(configuration, true);
18         this.configuration = configuration;
19     }
20
21     @Override
22     public SheetLineComponent getConfiguration() {
23         return configuration;
24     }
25
26     @Override
27     public StateUndoContextBase createUndoContext() {
28         return new StateUndoContextBase() {
29
30             @Override
31             public void saveState(Solver solver, int componentId, String uid) {
32             }
33
34             @Override
35             public boolean loadState(Solver solver, int componentId, String uid) {
36                 return false;
37             }
38         };
39     }
40
41     @Override
42     public ComponentFactory<SheetLineComponent> createComponentFactory() {
43         return new ComponentFactory<SheetLineComponent>() {
44
45             @Override
46             public SheetLineComponent create(String uid) {
47                 return new SheetLineComponent(uid);
48             }
49
50         };
51     }
52
53 }