use of org.eclipse.nebula.widgets.nattable.selection.event.SelectionLayerStructuralChangeEventHandler in project nebula.widgets.nattable by eclipse.
the class SelectionLayerStructuralChangeEventHandlerTest method shouldLeaveSelectionUnchangedIfASelectedRowIsNotModified.
@Test
public void shouldLeaveSelectionUnchangedIfASelectedRowIsNotModified() throws Exception {
this.selectionModel.addSelection(2, 3);
SelectionLayerStructuralChangeEventHandler handler = new SelectionLayerStructuralChangeEventHandler(this.selectionLayer);
handler.handleLayerEvent(new RowDeleteEvent(this.dataLayer, 5));
Assert.assertFalse(this.selectionModel.isEmpty());
Assert.assertTrue(this.selectionModel.isRowPositionSelected(3));
}
use of org.eclipse.nebula.widgets.nattable.selection.event.SelectionLayerStructuralChangeEventHandler in project nebula.widgets.nattable by eclipse.
the class SelectionLayerStructuralChangeEventHandlerTest method shouldClearSelectionIfAllRowsAreHidden.
@Test
public void shouldClearSelectionIfAllRowsAreHidden() {
this.selectionModel.addSelection(3, 4);
SelectionLayerStructuralChangeEventHandler handler = new SelectionLayerStructuralChangeEventHandler(this.selectionLayer);
List<Integer> rows = new ArrayList<Integer>();
rows.add(0);
rows.add(1);
rows.add(2);
rows.add(3);
rows.add(4);
rows.add(5);
rows.add(6);
rows.add(7);
rows.add(8);
rows.add(9);
handler.handleLayerEvent(new HideRowPositionsEvent(this.dataLayer, rows));
Assert.assertTrue(this.selectionModel.isEmpty());
}
use of org.eclipse.nebula.widgets.nattable.selection.event.SelectionLayerStructuralChangeEventHandler in project nebula.widgets.nattable by eclipse.
the class SelectionLayerStructuralChangeEventHandlerTest method shouldLeaveSelectionUnchangedIfTheFollowingRowIsModified.
@Test
public void shouldLeaveSelectionUnchangedIfTheFollowingRowIsModified() throws Exception {
this.selectionModel.addSelection(3, 4);
SelectionLayerStructuralChangeEventHandler handler = new SelectionLayerStructuralChangeEventHandler(this.selectionLayer);
handler.handleLayerEvent(new RowDeleteEvent(this.dataLayer, 5));
Assert.assertFalse(this.selectionModel.isEmpty());
Assert.assertTrue(this.selectionModel.isRowPositionSelected(4));
}
use of org.eclipse.nebula.widgets.nattable.selection.event.SelectionLayerStructuralChangeEventHandler in project nebula.widgets.nattable by eclipse.
the class SelectionLayerStructuralChangeEventHandlerTest method shouldClearSelectionIfASelectedRowIsModified.
@Test
public void shouldClearSelectionIfASelectedRowIsModified() throws Exception {
this.selectionModel.addSelection(2, 3);
SelectionLayerStructuralChangeEventHandler handler = new SelectionLayerStructuralChangeEventHandler(this.selectionLayer);
handler.handleLayerEvent(new RowDeleteEvent(this.dataLayer, 3));
Assert.assertTrue(this.selectionModel.isEmpty());
}
use of org.eclipse.nebula.widgets.nattable.selection.event.SelectionLayerStructuralChangeEventHandler in project nebula.widgets.nattable by eclipse.
the class SelectionLayerStructuralChangeEventHandlerTest method shouldClearSelectionIfListIsCleared.
@Test
public void shouldClearSelectionIfListIsCleared() {
this.selectionModel.addSelection(3, 4);
SelectionLayerStructuralChangeEventHandler handler = new SelectionLayerStructuralChangeEventHandler(this.selectionLayer);
handler.handleLayerEvent(new RowDeleteEvent(this.dataLayer, new Range(0, 9)));
Assert.assertTrue(this.selectionModel.isEmpty());
}
Aggregations