use of org.eclipse.nebula.widgets.nattable.hideshow.command.RowHideCommand in project nebula.widgets.nattable by eclipse.
the class RowStructuralChangeEventIntegrationTest method testHideReorder.
@Test
public void testHideReorder() {
testInit();
// hide row at position 2: 0 1 3 4
this.natTable.doCommand(new RowHideCommand(this.viewportLayer, 2));
// reorder to inverse order: 4 3 1 0
this.natTable.doCommand(new RowReorderCommand(this.viewportLayer, 3, 0));
this.natTable.doCommand(new RowReorderCommand(this.viewportLayer, 3, 1));
this.natTable.doCommand(new RowReorderCommand(this.viewportLayer, 3, 2));
assertEquals(4, this.viewportLayer.getRowCount());
assertEquals(4, this.viewportLayer.getRowIndexByPosition(0));
assertEquals(3, this.viewportLayer.getRowIndexByPosition(1));
assertEquals(1, this.viewportLayer.getRowIndexByPosition(2));
assertEquals(0, this.viewportLayer.getRowIndexByPosition(3));
assertEquals(-1, this.viewportLayer.getRowIndexByPosition(4));
assertEquals("five", this.viewportLayer.getDataValueByPosition(0, 0));
assertEquals("four", this.viewportLayer.getDataValueByPosition(0, 1));
assertEquals("two", this.viewportLayer.getDataValueByPosition(0, 2));
assertEquals("one", this.viewportLayer.getDataValueByPosition(0, 3));
}
Aggregations