use of org.eclipse.nebula.widgets.nattable.columnRename.RenameColumnHeaderCommand in project nebula.widgets.nattable by eclipse.
the class RenameColumnIntegrationTest method shouldUpdateRenamedColumnOnAddingMultipleColumn.
@Test
public void shouldUpdateRenamedColumnOnAddingMultipleColumn() {
this.natTableFixture.doCommand(new TurnViewportOffCommand());
assertEquals("Column 5", this.natTableFixture.getDataValueByPosition(5, 0).toString());
this.natTableFixture.doCommand(new RenameColumnHeaderCommand(this.natTableFixture, 5, TEST_COLUMN_NAME));
assertEquals(TEST_COLUMN_NAME, this.natTableFixture.getDataValueByPosition(5, 0).toString());
// simulate deletion of a column
this.provider.setColumnCount(this.provider.getColumnCount() + 3);
this.grid.getColumnHeaderDataLayer().fireLayerEvent(new ColumnInsertEvent(this.grid.getBodyDataLayer(), new Range(1, 4)));
assertEquals(TEST_COLUMN_NAME, this.natTableFixture.getDataValueByPosition(8, 0).toString());
assertEquals("Column 5", this.natTableFixture.getDataValueByPosition(5, 0).toString());
}
use of org.eclipse.nebula.widgets.nattable.columnRename.RenameColumnHeaderCommand in project nebula.widgets.nattable by eclipse.
the class RenameColumnIntegrationTest method shouldUpdateRenamedColumnOnDeleteMultipleColumn.
@Test
public void shouldUpdateRenamedColumnOnDeleteMultipleColumn() {
assertEquals("Column 5", this.natTableFixture.getDataValueByPosition(5, 0).toString());
this.natTableFixture.doCommand(new RenameColumnHeaderCommand(this.natTableFixture, 5, TEST_COLUMN_NAME));
assertEquals(TEST_COLUMN_NAME, this.natTableFixture.getDataValueByPosition(5, 0).toString());
// simulate deletion of a column
this.provider.setColumnCount(this.provider.getColumnCount() - 3);
this.grid.getColumnHeaderDataLayer().fireLayerEvent(new ColumnDeleteEvent(this.grid.getBodyDataLayer(), new Range(1, 4)));
assertEquals(TEST_COLUMN_NAME, this.natTableFixture.getDataValueByPosition(2, 0).toString());
assertEquals("Column 5", this.natTableFixture.getDataValueByPosition(5, 0).toString());
}
use of org.eclipse.nebula.widgets.nattable.columnRename.RenameColumnHeaderCommand in project nebula.widgets.nattable by eclipse.
the class RenameColumnIntegrationTest method shouldUpdateRenamedColumnOnAddingOneColumn.
@Test
public void shouldUpdateRenamedColumnOnAddingOneColumn() {
assertEquals("Column 5", this.natTableFixture.getDataValueByPosition(5, 0).toString());
this.natTableFixture.doCommand(new RenameColumnHeaderCommand(this.natTableFixture, 5, TEST_COLUMN_NAME));
assertEquals(TEST_COLUMN_NAME, this.natTableFixture.getDataValueByPosition(5, 0).toString());
// simulate deletion of a column
this.provider.setColumnCount(this.provider.getColumnCount() + 1);
this.grid.getColumnHeaderDataLayer().fireLayerEvent(new ColumnInsertEvent(this.grid.getBodyDataLayer(), 0));
assertEquals(TEST_COLUMN_NAME, this.natTableFixture.getDataValueByPosition(6, 0).toString());
assertEquals("Column 5", this.natTableFixture.getDataValueByPosition(5, 0).toString());
}
Aggregations