]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/synchronization/LinesCommandBuilder.java
Adopt spreadsheet changes made in Balas development
[simantics/platform.git] / bundles / org.simantics.spreadsheet.graph / src / org / simantics / spreadsheet / graph / synchronization / LinesCommandBuilder.java
diff --git a/bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/synchronization/LinesCommandBuilder.java b/bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/synchronization/LinesCommandBuilder.java
deleted file mode 100644 (file)
index 4cf804c..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-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.Solver;
-
-public class LinesCommandBuilder implements CommandBuilder {
-       
-       private final boolean update;
-    private String name;
-       int[] keys;
-       
-       public LinesCommandBuilder(String name, boolean update) {
-               this.name = name;
-               this.update = update;
-       }
-
-       @Override
-       public void apply(Solver solver) {
-//         if (update)
-//             return;
-               
-               SpreadsheetBook book = solver.getConcreteSolver();
-               SpreadsheetLines node = book.ensureSubprocess(name);
-               node.setKeys(keys);
-               
-//             String path = name.substring(0, name.lastIndexOf("/"));
-//             String lineName = name.substring(name.lastIndexOf("/")+1);
-//             int row = Integer.parseInt(lineName.substring(3));
-//             
-               
-//             SpreadsheetLine line = node.lines.get(-row);
-//             if(line == null) {
-//                     line = new SpreadsheetLine(node, row);
-//                     node.lines.put(-row, line);
-//             }
-//             
-//             for(int i=0;i<bean.cells.length;i++) {
-//                     
-//                     LineContentBeanCell cell = bean.cells[i];
-//                     
-//                     try {
-//                             
-//                             if(ExcelFormula.BINDING.type().equals(cell.content.getBinding().type())) {
-//                                     ExcelFormula formula = (ExcelFormula)cell.content.getValue(ExcelFormula.BINDING);
-//                                     SheetFormulaParser p = new SheetFormulaParser(new StringReader(formula.expression));
-//                                     AstValue v = p.relation();
-//                                     line.cells.add(new SpreadsheetCell(line, i, new SpreadsheetFormula(v, formula.expression), 0));
-//                             } else {
-//                                     line.cells.add(new SpreadsheetCell(line, i, cell.content.getValue(), 0));
-//                             }
-//                     } catch (Throwable e) {
-//                             line.cells.add(new SpreadsheetCell(line, i, cell.content.getValue(), 0));
-//                             try {
-//                                     new Exception("failed: " + ((ExcelFormula)(cell.content.getValue(ExcelFormula.BINDING))).expression, e).printStackTrace();
-//                             } catch (AdaptException e1) {
-//                                     e1.printStackTrace();
-//                             }
-//                     }
-//                     
-//             }
-               
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public <T> T getConcrete() {
-               return (T)this;
-       }
-       
-}
\ No newline at end of file