@Override //Override to sync underlying Model with UiModel public Range deleteCell(final int rowIndex, final int columnIndex) { final Range range = super.deleteCell(rowIndex, columnIndex); synchronizer.deleteCell(range, columnIndex); return range; }
public Range deleteCellInternal(final int rowIndex, final int columnIndex) { final boolean isMerged = isMerged(); try { this.isMerged = false; return super.deleteCell(rowIndex, columnIndex); } finally { this.isMerged = isMerged; } } }
@Override //Override to sync underlying Model with UiModel public Range deleteCell(final int rowIndex, final int columnIndex) { final Range range = super.deleteCell(rowIndex, columnIndex); synchronizer.deleteCell(range, columnIndex); return range; }
public Range deleteCellInternal(final int rowIndex, final int columnIndex) { final boolean isMerged = isMerged(); try { this.isMerged = false; return super.deleteCell(rowIndex, columnIndex); } finally { this.isMerged = isMerged; } } }
@Override public Range deleteCell(int rowIndex, int columnIndex) { FactMapping factMapping = simulation.getSimulationDescriptor().getFactMappingByIndex(columnIndex); simulation.getScenarioByIndex(rowIndex) .removeFactMappingValueByIdentifiers(factMapping.getFactIdentifier(), factMapping.getExpressionIdentifier()); return super.deleteCell(rowIndex, columnIndex); }
/** * This method <i>set</i> a cell value to the grid <b>and</b> to the underlying model * @param rowIndex * @param columnIndex * @param cellSupplier */ @Override public Range setCell(int rowIndex, int columnIndex, Supplier<GridCell<?>> cellSupplier) { checkSimulation(); Range toReturn = super.setCell(rowIndex, columnIndex, cellSupplier); try { Optional<?> optionalValue = getCellValue(getCell(rowIndex, columnIndex)); Object rawValue = optionalValue.orElse(null); String cellValue = (rawValue instanceof String) ? (String) rawValue : null; Scenario scenarioByIndex = simulation.getScenarioByIndex(rowIndex); FactMapping factMappingByIndex = simulation.getSimulationDescriptor().getFactMappingByIndex(columnIndex); FactIdentifier factIdentifier = factMappingByIndex.getFactIdentifier(); ExpressionIdentifier expressionIdentifier = factMappingByIndex.getExpressionIdentifier(); scenarioByIndex.addOrUpdateMappingValue(factIdentifier, expressionIdentifier, cellValue); } catch (Throwable t) { toReturn = super.deleteCell(rowIndex, columnIndex); eventBus.fireEvent(new ScenarioGridReloadEvent()); } return toReturn; }