use of org.eclipse.nebula.widgets.nattable.test.fixture.NatTableFixture in project nebula.widgets.nattable by eclipse.
the class CellLabelMouseEventMatcherTest method setUpCustomCellLabel.
@Before
public void setUpCustomCellLabel() {
DummyGridLayerStack gridLayerStack = new DummyGridLayerStack(5, 5);
this.natTableFixture = new NatTableFixture(gridLayerStack);
// Register custom label
DataLayer bodyDataLayer = (DataLayer) gridLayerStack.getBodyDataLayer();
this.natTableFixture.registerLabelOnColumn(bodyDataLayer, 0, TEST_LABEL);
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.NatTableFixture in project nebula.widgets.nattable by eclipse.
the class ColumnStructuralChangeEventIntegrationTest method setup.
@Before
public void setup() {
this.natTableFixture = new NatTableFixture(this.grid);
this.listener = new LayerListenerFixture();
this.natTableFixture.addLayerListener(this.listener);
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.NatTableFixture in project nebula.widgets.nattable by eclipse.
the class EventConflaterChainTest method setup.
@Before
public void setup() {
this.conflaterChain = new EventConflaterChain(10, 10);
this.natTableFixture = new NatTableFixture();
this.conflater1 = new VisualChangeEventConflater(this.natTableFixture);
this.conflater2 = new VisualChangeEventConflater(this.natTableFixture);
this.conflaterChain.add(this.conflater1);
this.conflaterChain.add(this.conflater2);
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.NatTableFixture in project nebula.widgets.nattable by eclipse.
the class RowSizeResetCommandTest method testResetOnlyBody.
@Test
public void testResetOnlyBody() {
DummyGridLayerStack dummyGridLayerStack = new DummyGridLayerStack();
NatTable natTable = new NatTableFixture(dummyGridLayerStack);
assertEquals(20, dummyGridLayerStack.getColumnHeaderDataLayer().getRowHeightByPosition(0));
assertEquals(20, dummyGridLayerStack.getBodyDataLayer().getRowHeightByPosition(2));
((DataLayer) dummyGridLayerStack.getColumnHeaderDataLayer()).setRowHeightByPosition(0, 50);
((DataLayer) dummyGridLayerStack.getBodyDataLayer()).setRowHeightByPosition(2, 50);
assertEquals(50, dummyGridLayerStack.getColumnHeaderDataLayer().getRowHeightByPosition(0));
assertEquals(50, dummyGridLayerStack.getBodyDataLayer().getRowHeightByPosition(2));
natTable.doCommand(new RowHeightResetCommand(GridRegion.BODY));
assertEquals(50, dummyGridLayerStack.getColumnHeaderDataLayer().getRowHeightByPosition(0));
assertEquals(20, dummyGridLayerStack.getBodyDataLayer().getRowHeightByPosition(2));
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.NatTableFixture in project nebula.widgets.nattable by eclipse.
the class ColumnHideShowLayerTest2 method scrollAndHideTheLastColumn.
/**
* Integration test
*/
@Test
public void scrollAndHideTheLastColumn() throws Exception {
// Total columns in fixture - 20 (index 0 - 19)
NatTableFixture natTable = new NatTableFixture();
LayerListenerFixture natTableListener = new LayerListenerFixture();
natTable.addLayerListener(natTableListener);
// Scroll to position 14 in grid/14 in body
natTable.scrollToColumn(14);
assertEquals(14, natTable.getColumnIndexByPosition(1));
// Hide last column - position 6/index 19
assertEquals(19, natTable.getColumnIndexByPosition(6));
natTable.doCommand(new ColumnHideCommand(natTable, 6));
// Assert event received
assertNotNull(natTableListener.getReceivedEvent(HideColumnPositionsEvent.class));
HideColumnPositionsEvent hideEvent = (HideColumnPositionsEvent) natTableListener.getReceivedEvent(HideColumnPositionsEvent.class);
// When last column is hidden it is not carrying the following info
assertEquals(1, hideEvent.getColumnPositionRanges().size());
// View port adjusted origin to move an extra column in
Range hiddenRange = hideEvent.getColumnPositionRanges().iterator().next();
assertEquals(7, hiddenRange.start);
assertEquals(8, hiddenRange.end);
}
Aggregations