private int findMaxRowIndexForCellUpdate(final int rowIndex, final int columnIndex) { int maxRowIndex = rowIndex + 1; final GridRow currentRow = getRow(rowIndex); final GridCell<?> currentRowCell = currentRow.getCells().get(columnIndex); //Find maximum row with a cell containing the same value as that being updated boolean foundBottomSplitMarker = false; while (maxRowIndex < rows.size()) { final GridRow nextRow = rows.get(maxRowIndex); final GridCell<?> nextRowCell = nextRow.getCells().get(columnIndex); if (!nextRow.isCollapsed()) { if (nextRowCell == null) { break; } if (nextRowCell.isCollapsed() && foundBottomSplitMarker) { maxRowIndex--; break; } if (!nextRowCell.equals(currentRowCell)) { break; } if (nextRowCell.getMergedCellCount() > 0) { foundBottomSplitMarker = true; } } maxRowIndex++; } return maxRowIndex - 1; }
private int findMaxRowIndexForCellUpdate(final int rowIndex, final int columnIndex) { int maxRowIndex = rowIndex + 1; final GridRow currentRow = getRow(rowIndex); final GridCell<?> currentRowCell = currentRow.getCells().get(columnIndex); //Find maximum row with a cell containing the same value as that being updated boolean foundBottomSplitMarker = false; while (maxRowIndex < rows.size()) { final GridRow nextRow = rows.get(maxRowIndex); final GridCell<?> nextRowCell = nextRow.getCells().get(columnIndex); if (!nextRow.isCollapsed()) { if (nextRowCell == null) { break; } if (nextRowCell.isCollapsed() && foundBottomSplitMarker) { maxRowIndex--; break; } if (!nextRowCell.equals(currentRowCell)) { break; } if (nextRowCell.getMergedCellCount() > 0) { foundBottomSplitMarker = true; } } maxRowIndex++; } return maxRowIndex - 1; }
private int findMinRowIndexForCellUpdate(final int rowIndex, final int columnIndex) { int minRowIndex = rowIndex; final GridRow currentRow = getRow(rowIndex); final GridCell<?> currentRowCell = currentRow.getCells().get(columnIndex); //Find minimum row with a cell containing the same value as that being updated boolean foundTopSplitMarker = currentRowCell != null && currentRowCell.getMergedCellCount() > 0; while (minRowIndex > 0) { final GridRow previousRow = rows.get(minRowIndex - 1); final GridCell<?> previousRowCell = previousRow.getCells().get(columnIndex); if (!(previousRow.isCollapsed() && currentRow.isCollapsed())) { if (previousRowCell == null) { break; } if (previousRowCell.isCollapsed() && foundTopSplitMarker) { break; } if (!previousRowCell.equals(currentRowCell)) { break; } if (previousRowCell.getMergedCellCount() > 0) { foundTopSplitMarker = true; } } minRowIndex--; } return minRowIndex; }
private int findMinRowIndexForCellUpdate(final int rowIndex, final int columnIndex) { int minRowIndex = rowIndex; final GridRow currentRow = getRow(rowIndex); final GridCell<?> currentRowCell = currentRow.getCells().get(columnIndex); //Find minimum row with a cell containing the same value as that being updated boolean foundTopSplitMarker = currentRowCell != null && currentRowCell.getMergedCellCount() > 0; while (minRowIndex > 0) { final GridRow previousRow = rows.get(minRowIndex - 1); final GridCell<?> previousRowCell = previousRow.getCells().get(columnIndex); if (!(previousRow.isCollapsed() && currentRow.isCollapsed())) { if (previousRowCell == null) { break; } if (previousRowCell.isCollapsed() && foundTopSplitMarker) { break; } if (!previousRowCell.equals(currentRowCell)) { break; } if (previousRowCell.getMergedCellCount() > 0) { foundTopSplitMarker = true; } } minRowIndex--; } return minRowIndex; }
assertEquals(1, uiRows.size()); assertTrue(uiRows.contains(uiModel.getRow(0)));
assertEquals(1, uiRows.size()); assertTrue(uiRows.contains(uiModel.getRow(0)));