protected GridCell<T> assertCell(final GridCell<T> cell) { if (cell != null) { return cell; } return new BaseGridCell<>(makeDefaultCellValue()); }
@Override public boolean isMerged() { return getMergedCellCount() != 1; }
@Override @SuppressWarnings("unchecked") public Range setCellValue(final int rowIndex, final int columnIndex, final GridCellValue<?> value) { return doSetCell(rowIndex, columnIndex, (pair) -> { final Optional<BaseGridCell> cell = Optional.ofNullable((BaseGridCell) getCell(pair.getKey(), pair.getValue())); final BaseGridCell c = cell.orElse(new BaseGridCell<>(value)); c.setValue(value); return c; }); }
private void updateMergeMetaData(final int minBlockRowIndex, final int maxBlockRowIndex, final int columnIndex) { for (int i = minBlockRowIndex; i < maxBlockRowIndex; i++) { final GridRow row = gridData.getRow(i); final BaseGridCell cell = ((BaseGridCell) row.getCells().get(columnIndex)); if (cell != null) { cell.setMergedCellCount(0); } updateRowMergedCells(row); } final GridRow row = gridData.getRow(minBlockRowIndex); final BaseGridCell cell = ((BaseGridCell) row.getCells().get(columnIndex)); if (cell != null) { cell.setMergedCellCount(maxBlockRowIndex - minBlockRowIndex); } updateRowMergedCells(row); }
private void updateMergeMetaData(final int minBlockRowIndex, final int maxBlockRowIndex, final int columnIndex) { for (int i = minBlockRowIndex; i < maxBlockRowIndex; i++) { final GridRow row = gridData.getRow(i); final BaseGridCell cell = ((BaseGridCell) row.getCells().get(columnIndex)); if (cell != null) { cell.setMergedCellCount(0); } updateRowMergedCells(row); } final GridRow row = gridData.getRow(minBlockRowIndex); final BaseGridCell cell = ((BaseGridCell) row.getCells().get(columnIndex)); if (cell != null) { cell.setMergedCellCount(maxBlockRowIndex - minBlockRowIndex); } updateRowMergedCells(row); }
private GridCell<String> assertCell(final GridCell<String> cell) { if (cell != null) { return cell; } return new BaseGridCell<String>(new BaseGridCellValue<String>("")); }
@Override @SuppressWarnings("unchecked") public Range setCellValue(final int rowIndex, final int columnIndex, final GridCellValue<?> value) { return doSetCell(rowIndex, columnIndex, (pair) -> { final Optional<BaseGridCell> cell = Optional.ofNullable((BaseGridCell) getCell(pair.getKey(), pair.getValue())); final BaseGridCell c = cell.orElse(new BaseGridCell<>(value)); c.setValue(value); return c; }); }
final GridCell<?> cell = gridData.getCell(i, columnIndex); ((BaseGridCell) cell).setMergedCellCount(0); updateRowMergedCells(row); final GridCell<?> cell = gridData.getCell(rowIndex, columnIndex); ((BaseGridCell) cell).setMergedCellCount(maxRowIndex - rowIndex); updateRowMergedCells(row);
@Override public boolean isMerged() { return getMergedCellCount() != 1; }
private GridCell<String> assertCell(final GridCell<String> cell) { if (cell != null) { return cell; } return new BaseGridCell<String>(new BaseGridCellValue<String>("")); } }
final GridCell<?> cell = gridData.getCell(i, columnIndex); ((BaseGridCell) cell).setMergedCellCount(0); updateRowMergedCells(row); final GridCell<?> cell = gridData.getCell(rowIndex, columnIndex); ((BaseGridCell) cell).setMergedCellCount(maxRowIndex - rowIndex); updateRowMergedCells(row);
private GridCell<String> assertCell(final GridCell<String> cell) { if (cell != null) { return cell; } return new BaseGridCell<String>(new BaseGridCellValue<String>("")); } }
final BaseGridCell bottomSplitRowCell = ((BaseGridCell) bottomSplitRow.getCells().get(columnIndex)); if (bottomSplitRowCell != null) { bottomSplitRowCell.setMergedCellCount(maxRowIndex - expandMaxRowIndex); cell.setMergedCellCount(expandMaxRowIndex - minRowIndex);
private GridCell<String> assertCell(final GridCell<String> cell) { if (cell != null) { return cell; } return new BaseGridCell<String>(new BaseGridCellValue<String>("")); }
final BaseGridCell bottomSplitRowCell = ((BaseGridCell) bottomSplitRow.getCells().get(columnIndex)); if (bottomSplitRowCell != null) { bottomSplitRowCell.setMergedCellCount(maxRowIndex - expandMaxRowIndex); cell.setMergedCellCount(expandMaxRowIndex - minRowIndex);
@Override public Group render(final GridBodyCellRenderContext context) { final BaseGridCellValue<String> hasNameCellValue = new BaseGridCellValue<>(this.getName().getValue()); return RendererUtils.getCenteredCellText(context, new BaseGridCell<>(hasNameCellValue)); } };
final BaseGridCell cell = ((BaseGridCell) row.getCells().get(columnIndex)); if (cell != null) { cell.setMergedCellCount(0); final BaseGridCell topSplitRowCell = ((BaseGridCell) topSplitRow.getCells().get(columnIndex)); if (topSplitRowCell != null) { topSplitRowCell.setMergedCellCount(minRowIndex - checkMinRowIndex); final BaseGridCell cell = ((BaseGridCell) row.getCells().get(columnIndex)); if (cell != null) { cell.setMergedCellCount(0); final BaseGridCell bottomSplitRowCell = ((BaseGridCell) bottomSplitRow.getCells().get(columnIndex)); if (bottomSplitRowCell != null) { bottomSplitRowCell.setMergedCellCount(checkMaxRowIndex - minRowIndex);
@Test @SuppressWarnings("unchecked") public void editReadOnly() { when( access.isEditable() ).thenReturn( false ); final GridCell<Boolean> cell = new BaseGridCell<>( new BaseGridCellValue<>( true ) ); column.edit( cell, context, callback ); verify( callback, never() ).accept( any( BaseGridCellValue.class ) ); }
final BaseGridCell cell = ((BaseGridCell) row.getCells().get(columnIndex)); if (cell != null) { cell.setMergedCellCount(0); final BaseGridCell topSplitRowCell = ((BaseGridCell) topSplitRow.getCells().get(columnIndex)); if (topSplitRowCell != null) { topSplitRowCell.setMergedCellCount(minRowIndex - checkMinRowIndex); final BaseGridCell cell = ((BaseGridCell) row.getCells().get(columnIndex)); if (cell != null) { cell.setMergedCellCount(0); final BaseGridCell bottomSplitRowCell = ((BaseGridCell) bottomSplitRow.getCells().get(columnIndex)); if (bottomSplitRowCell != null) { bottomSplitRowCell.setMergedCellCount(checkMaxRowIndex - minRowIndex);
@Test @SuppressWarnings("unchecked") public void editTrueToFalse() { when( access.isEditable() ).thenReturn( true ); final GridCell<Boolean> cell = new BaseGridCell<>( new BaseGridCellValue<>( true ) ); column.edit( cell, context, callback ); verify( callback, times( 1 ) ).accept( callbackArgumentCaptor.capture() ); final BaseGridCellValue<Boolean> callbackArgument = callbackArgumentCaptor.getValue(); assertFalse( callbackArgument.getValue() ); }