use of org.eclipse.nebula.widgets.nattable.selection.command.SelectColumnCommand in project nebula.widgets.nattable by eclipse.
the class ColumnSelectionTest method shouldNotIncludeDeselectedCellsWithCtrlModifier.
@Test
public void shouldNotIncludeDeselectedCellsWithCtrlModifier() {
// test a previous bug where single deselected cells where added to the
// selection with following modifier selections
// start from a clear selection state
this.selectionLayer.clear();
// select a single cell
this.selectionLayer.doCommand(new SelectCellCommand(this.selectionLayer, 2, 0, false, false));
// deselect the cell again
this.selectionLayer.doCommand(new SelectCellCommand(this.selectionLayer, 2, 0, false, true));
// trigger selection of column 4 with ctrl
this.selectionLayer.doCommand(new SelectColumnCommand(this.selectionLayer, 4, 0, false, true));
assertEquals(4, this.selectionLayer.getSelectionAnchor().getColumnPosition());
assertEquals(0, this.selectionLayer.getSelectionAnchor().getRowPosition());
assertFalse("[2, 0] is selected", this.selectionLayer.isCellPositionSelected(2, 0));
assertTrue("column 4 not fully selected", this.selectionLayer.isColumnPositionFullySelected(4));
}
Aggregations