use of org.eclipse.nebula.widgets.nattable.layer.DataLayer in project nebula.widgets.nattable by eclipse.
the class EditUtilsTest method testIsConverterSameWithMultiSelectionOneChangedConverter.
@Test
public void testIsConverterSameWithMultiSelectionOneChangedConverter() {
this.selectionLayer.selectCell(1, 1, false, true);
this.selectionLayer.selectCell(2, 2, false, true);
this.selectionLayer.selectCell(3, 3, false, true);
DataLayer bodyDataLayer = (DataLayer) this.gridLayerStack.getBodyDataLayer();
this.natTable.registerLabelOnColumn(bodyDataLayer, 1, TEST_LABEL);
this.natTable.getConfigRegistry().registerConfigAttribute(CellConfigAttributes.DISPLAY_CONVERTER, new DefaultBooleanDisplayConverter(), DisplayMode.EDIT, TEST_LABEL);
assertFalse(EditUtils.isConverterSame(this.selectionLayer, this.natTable.getConfigRegistry()));
}
use of org.eclipse.nebula.widgets.nattable.layer.DataLayer in project nebula.widgets.nattable by eclipse.
the class EditUtilsTest method testIsEditorSameWithMultiSelectionOneChangedEditor.
@Test
public void testIsEditorSameWithMultiSelectionOneChangedEditor() {
this.selectionLayer.selectCell(1, 1, false, true);
this.selectionLayer.selectCell(2, 2, false, true);
this.selectionLayer.selectCell(3, 3, false, true);
DataLayer bodyDataLayer = (DataLayer) this.gridLayerStack.getBodyDataLayer();
this.natTable.registerLabelOnColumn(bodyDataLayer, 1, TEST_LABEL);
this.natTable.getConfigRegistry().registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, new CheckBoxCellEditor(), DisplayMode.EDIT, TEST_LABEL);
assertFalse(EditUtils.isEditorSame(this.selectionLayer, this.natTable.getConfigRegistry()));
}
use of org.eclipse.nebula.widgets.nattable.layer.DataLayer in project nebula.widgets.nattable by eclipse.
the class RowSelectionEditUtilsTest method testIsConverterSameWithMultiSelectionOneChangedConverter.
@Test
public void testIsConverterSameWithMultiSelectionOneChangedConverter() {
this.selectionLayer.selectCell(1, 1, false, true);
this.selectionLayer.selectCell(2, 2, false, true);
this.selectionLayer.selectCell(3, 3, false, true);
DataLayer bodyDataLayer = (DataLayer) this.gridLayerStack.getBodyDataLayer();
this.natTable.registerLabelOnColumn(bodyDataLayer, 1, TEST_LABEL);
this.natTable.getConfigRegistry().registerConfigAttribute(CellConfigAttributes.DISPLAY_CONVERTER, new DefaultBooleanDisplayConverter(), DisplayMode.EDIT, TEST_LABEL);
// the result is true here because using the IRowSelectionModel the
// anchor is used to determine the cells to edit
assertTrue(EditUtils.isConverterSame(this.selectionLayer, this.natTable.getConfigRegistry()));
}
use of org.eclipse.nebula.widgets.nattable.layer.DataLayer in project nebula.widgets.nattable by eclipse.
the class RowSelectionEditUtilsTest method testIsEditorSameWithMultiSelectionOneColumnEditorMultiSelection.
@Test
public void testIsEditorSameWithMultiSelectionOneColumnEditorMultiSelection() {
DataLayer bodyDataLayer = (DataLayer) this.gridLayerStack.getBodyDataLayer();
this.natTable.registerLabelOnColumn(bodyDataLayer, 1, TEST_LABEL);
this.natTable.getConfigRegistry().registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, new CheckBoxCellEditor(), DisplayMode.EDIT, TEST_LABEL);
this.selectionLayer.selectCell(1, 1, false, true);
this.selectionLayer.selectCell(1, 2, false, true);
this.selectionLayer.selectCell(1, 3, false, true);
assertTrue(EditUtils.isEditorSame(this.selectionLayer, this.natTable.getConfigRegistry()));
}
use of org.eclipse.nebula.widgets.nattable.layer.DataLayer in project nebula.widgets.nattable by eclipse.
the class RowSelectionEditUtilsTest method testIsConverterSameWithSingleSelectionOneChangedConverter.
@Test
public void testIsConverterSameWithSingleSelectionOneChangedConverter() {
DataLayer bodyDataLayer = (DataLayer) this.gridLayerStack.getBodyDataLayer();
this.natTable.registerLabelOnColumn(bodyDataLayer, 1, TEST_LABEL);
this.natTable.getConfigRegistry().registerConfigAttribute(CellConfigAttributes.DISPLAY_CONVERTER, new DefaultBooleanDisplayConverter(), DisplayMode.EDIT, TEST_LABEL);
this.selectionLayer.selectCell(1, 1, false, false);
assertTrue(EditUtils.isConverterSame(this.selectionLayer, this.natTable.getConfigRegistry()));
}
Aggregations