use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.LayerListenerFixture in project nebula.widgets.nattable by eclipse.
the class SummaryRowIntegrationTest method shouldFireCellVisualChangeEventOnceSummaryIsCalculated.
@Test
public void shouldFireCellVisualChangeEventOnceSummaryIsCalculated() throws Exception {
// need to resize because otherwise the ViewportLayer would not process
// the CellVisualChangeEvent any further
this.natTable.setSize(800, 400);
LayerListenerFixture listener = new LayerListenerFixture();
this.natTable.addLayerListener(listener);
// Trigger summary calculation
this.natTable.getDataValueByPosition(this.askPriceColumnIndex, 4);
Thread.sleep(500);
assertTrue(listener.containsInstanceOf(CellVisualChangeEvent.class));
CellVisualChangeEvent event = (CellVisualChangeEvent) listener.getReceivedEvents().get(0);
assertEquals(this.askPriceColumnIndex, event.getColumnPosition());
assertEquals(4, event.getRowPosition());
Collection<Rectangle> changedPositionRectangles = event.getChangedPositionRectangles();
assertEquals(1, changedPositionRectangles.size());
// only the cell gets updated
Rectangle rectangle = changedPositionRectangles.iterator().next();
assertEquals(6, rectangle.x);
assertEquals(4, rectangle.y);
assertEquals(1, rectangle.width);
assertEquals(1, rectangle.height);
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.LayerListenerFixture 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.layer.LayerListenerFixture in project nebula.widgets.nattable by eclipse.
the class DataChangeLayerTempStorageTest method setup.
@Before
public void setup() {
this.dataModel = PersonService.getFixedPersons();
this.dataLayer = new DataLayer(new ListDataProvider<>(this.dataModel, new ReflectiveColumnPropertyAccessor<>(new String[] { "firstName", "lastName", "gender", "married", "birthday" })));
this.dataChangeLayer = new DataChangeLayer(this.dataLayer, new PointKeyHandler(), true);
this.listener = new LayerListenerFixture();
this.dataLayer.addLayerListener(this.listener);
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.LayerListenerFixture in project nebula.widgets.nattable by eclipse.
the class NatTableTest method shouldPassOnLayerEventsToListeners.
@Test
public void shouldPassOnLayerEventsToListeners() throws Exception {
LayerListenerFixture listener = new LayerListenerFixture();
this.natTable.addLayerListener(listener);
this.natTable.handleLayerEvent(new LayerEventFixture());
assertTrue(listener.containsInstanceOf(LayerEventFixture.class));
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.LayerListenerFixture in project nebula.widgets.nattable by eclipse.
the class ResizeEventPropagationTest method shouldFireResizeEventAfterRowResizeCommand.
@Test
public void shouldFireResizeEventAfterRowResizeCommand() {
this.dataLayer.addLayerListener(new LayerListenerFixture());
this.dataLayer.setRowHeightByPosition(2, 100);
}
Aggregations