use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.ColumnHideShowLayerFixture in project nebula.widgets.nattable by eclipse.
the class ChooseColumnsFromCategoriesCommandHandlerTest method setup.
@Before
public void setup() {
this.hideShowLayerFixture = new ColumnHideShowLayerFixture();
this.commandHandler = new ChooseColumnsFromCategoriesCommandHandler(this.hideShowLayerFixture, new ColumnHeaderLayerFixture(), new DataLayerFixture(), new ColumnCategoriesModelFixture());
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.ColumnHideShowLayerFixture in project nebula.widgets.nattable by eclipse.
the class ColumnGroupExpandCollapseLayerTest method setup.
@Before
public void setup() {
this.model = new ColumnGroupModel();
// 10 Columns in total - column 10 hidden
this.underlyingLayer = new ColumnHideShowLayerFixture(9);
this.expandCollapseLayer = new ColumnGroupExpandCollapseLayer(this.underlyingLayer, this.model);
this.model.addColumnsIndexesToGroup(TEST_GROUP_NAME, 2, 3, 4, 5);
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.ColumnHideShowLayerFixture in project nebula.widgets.nattable by eclipse.
the class ColumnHideShowLayerTest method showColumnPositions.
@Test
public void showColumnPositions() throws Exception {
this.columnHideShowLayer = new ColumnHideShowLayerFixture(new DataLayerFixture(10, 2, 100, 20));
assertEquals(10, this.columnHideShowLayer.getColumnCount());
this.columnHideShowLayer.hideColumnPositions(Arrays.asList(3, 4, 5));
assertEquals(7, this.columnHideShowLayer.getColumnCount());
assertEquals(-1, this.columnHideShowLayer.getColumnPositionByIndex(3));
assertEquals(-1, this.columnHideShowLayer.getColumnPositionByIndex(4));
this.columnHideShowLayer.showColumnIndexes(Arrays.asList(3, 4));
assertEquals(9, this.columnHideShowLayer.getColumnCount());
assertEquals(3, this.columnHideShowLayer.getColumnPositionByIndex(3));
assertEquals(4, this.columnHideShowLayer.getColumnPositionByIndex(4));
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.ColumnHideShowLayerFixture in project nebula.widgets.nattable by eclipse.
the class ColumnGroupExpandCollapseLayerTest method isFirstVisibleWithColumnsReordered.
@Test
public void isFirstVisibleWithColumnsReordered() throws Exception {
// Original indexes : 0 1 2 3 4
// Indexes reordered : 4 1 0 2 3
ColumnReorderLayer reorderLayer = new ColumnReorderLayerFixture();
this.underlyingLayer = new ColumnHideShowLayerFixture(reorderLayer);
this.expandCollapseLayer = new ColumnGroupExpandCollapseLayer(this.underlyingLayer, this.model);
this.model.clear();
this.model.addColumnsIndexesToGroup(TEST_GROUP_NAME, 0, 2, 3);
// Hide index 0
this.underlyingLayer.hideColumnPositions(Arrays.asList(2));
assertFalse(ColumnGroupUtils.isFirstVisibleColumnIndexInGroup(0, this.expandCollapseLayer, this.underlyingLayer, this.model));
assertTrue(ColumnGroupUtils.isFirstVisibleColumnIndexInGroup(2, this.expandCollapseLayer, this.underlyingLayer, this.model));
assertFalse(ColumnGroupUtils.isFirstVisibleColumnIndexInGroup(3, this.expandCollapseLayer, this.underlyingLayer, this.model));
}
Aggregations