BooleanDOMElementColumn extends BaseGridColumn<Boolean> implements HasMultipleDOMElementResources { @Override public void edit(final GridCell<Boolean> cell, final GridBodyCellRenderContext context, final Consumer<GridCellValue<Boolean>> callback) { callback.accept(new BaseGridCellValue<>(!cell.getValue().getValue())); } BooleanDOMElementColumn(final GridColumn.HeaderMetaData headerMetaData,
                                   final CheckBoxDOMElementFactory factory,
                                   final double width);  BooleanDOMElementColumn(final List<GridColumn.HeaderMetaData> headerMetaData,
                                   final CheckBoxDOMElementFactory factory,
                                   final double width); @Override void initialiseResources(); @Override void destroyResources(); @Override void freeUnusedResources(); @Override void edit(final GridCell<Boolean> cell,
                     final GridBodyCellRenderContext context,
                     final Consumer<GridCellValue<Boolean>> callback);  }
@Test @SuppressWarnings("unchecked") public void editTrueToFalse() { 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()); }
@Test @SuppressWarnings("unchecked") public void editFalseToTrue() { final GridCell<Boolean> cell = new BaseGridCell<>(new BaseGridCellValue<>(false)); column.edit(cell, context, callback); verify(callback, times(1)).accept(callbackArgumentCaptor.capture()); final BaseGridCellValue<Boolean> callbackArgument = callbackArgumentCaptor.getValue(); assertTrue(callbackArgument.getValue()); }