X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.spreadsheet.graph%2Fsrc%2Forg%2Fsimantics%2Fspreadsheet%2Fgraph%2Ffunction%2FAll.java;h=49099344135daab31bc72218b881568e278298dd;hb=5c67a96d34fe904b8c4b0375cd08ff1d543bf369;hp=0affbc1c56cade37845ebee95ed19a33155b19ca;hpb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/function/All.java b/bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/function/All.java index 0affbc1c5..490993441 100644 --- a/bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/function/All.java +++ b/bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/function/All.java @@ -29,7 +29,6 @@ import org.simantics.db.common.request.WriteRequest; import org.simantics.db.common.utils.Logger; import org.simantics.db.common.utils.NameUtils; import org.simantics.db.exception.DatabaseException; -import org.simantics.db.layer0.StandardRealm; import org.simantics.db.layer0.exception.MissingVariableException; import org.simantics.db.layer0.function.StandardChildDomainChildren; import org.simantics.db.layer0.request.PossibleActiveRun; @@ -50,26 +49,30 @@ import org.simantics.document.server.io.IFont; import org.simantics.document.server.io.ITableCell; import org.simantics.layer0.Layer0; import org.simantics.scl.reflection.annotations.SCLValue; +import org.simantics.simulator.toolkit.StandardRealm; import org.simantics.simulator.variable.exceptions.NodeManagerException; import org.simantics.spreadsheet.CellEditor; import org.simantics.spreadsheet.ClientModel; import org.simantics.spreadsheet.Range; -import org.simantics.spreadsheet.graph.ExcelFormula; -import org.simantics.spreadsheet.graph.SheetNode; -import org.simantics.spreadsheet.graph.SpreadsheetBook; -import org.simantics.spreadsheet.graph.SpreadsheetCell; -import org.simantics.spreadsheet.graph.SpreadsheetCellContent; -import org.simantics.spreadsheet.graph.SpreadsheetFormula; +import org.simantics.spreadsheet.Transaction; import org.simantics.spreadsheet.graph.SpreadsheetGraphUtils; -import org.simantics.spreadsheet.graph.SpreadsheetSCLConstant; import org.simantics.spreadsheet.graph.SpreadsheetSessionManager; -import org.simantics.spreadsheet.graph.SpreadsheetStyle; -import org.simantics.spreadsheet.graph.SpreadsheetStyle.SpreadsheetStyleBuilder; import org.simantics.spreadsheet.graph.celleditor.GraphCellEditorAdapter; -import org.simantics.spreadsheet.graph.parser.ParseException; -import org.simantics.spreadsheet.graph.parser.SheetFormulaParser; -import org.simantics.spreadsheet.graph.parser.ast.AstValue; import org.simantics.spreadsheet.resource.SpreadsheetResource; +import org.simantics.spreadsheet.solver.SheetNode; +import org.simantics.spreadsheet.solver.SpreadsheetBook; +import org.simantics.spreadsheet.solver.SpreadsheetCell; +import org.simantics.spreadsheet.solver.SpreadsheetCellContent; +import org.simantics.spreadsheet.solver.SpreadsheetFormula; +import org.simantics.spreadsheet.solver.SpreadsheetSCLConstant; +import org.simantics.spreadsheet.solver.SpreadsheetStyle; +import org.simantics.spreadsheet.solver.SpreadsheetStyle.SpreadsheetStyleBuilder; +import org.simantics.spreadsheet.solver.formula.parser.ParseException; +import org.simantics.spreadsheet.solver.formula.parser.SheetFormulaParser; +import org.simantics.spreadsheet.solver.formula.parser.ast.AstValue; +import org.simantics.spreadsheet.synchronization.ExcelFormula; +import org.simantics.spreadsheet.synchronization.LineContentBean; +import org.simantics.spreadsheet.synchronization.LineContentBeanCell; import org.simantics.spreadsheet.util.SpreadsheetUtils; import gnu.trove.map.TMap; @@ -200,7 +203,7 @@ public class All { SpreadsheetCell sc = book.get(sheet.getName(graph), r.startRow, r.startColumn); sc.setContent(value); // book.accept(new InvalidateAll()); - List changed = book.invalidate(sc); +// List changed = book.invalidate(sc); //Invalidation handled by SpreadsheetNodeManager realm.asyncExec(new Runnable() { @Override @@ -620,20 +623,21 @@ public class All { private CellEditor getPossibleCellEditor(WriteGraph graph, String location, Variant value) throws DatabaseException { SpreadsheetResource SHEET = SpreadsheetResource.getInstance(graph); - Range range = SpreadsheetUtils.decodeCellAbsolute(location); - - List cells = SpreadsheetGraphUtils.possibleConfigurationCellVariables(graph, sheet, range); - if (cells.isEmpty()) { - if (value == null) { - return null; - } else { - cells = SpreadsheetGraphUtils.getOrCreateConfigurationCellVariables(graph, sheet, range); - } - } - if (cells.size() != 1) - throw new DatabaseException("Can edit only one cell at a time!"); - - return cells.iterator().next().getPropertyValue(graph, SHEET.cellEditor); + Range range = SpreadsheetUtils.decodePossibleCellAbsolute(location); + if(range == null) return null; //No editor found + + List cells = SpreadsheetGraphUtils.possibleConfigurationCellVariables(graph, sheet, range); + if (cells.isEmpty()) { + if (value == null) { + return null; + } else { + cells = SpreadsheetGraphUtils.getOrCreateConfigurationCellVariables(graph, sheet, range); + } + } + if (cells.size() != 1) + throw new DatabaseException("Can edit only one cell at a time!"); + + return cells.iterator().next().getPropertyValue(graph, SHEET.cellEditor); } @Override