use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.LayerListenerFixture in project nebula.widgets.nattable by eclipse.
the class ReorderRowEventTest method reorderEventMustPropagateToTheTop.
@Test
public void reorderEventMustPropagateToTheTop() throws Exception {
DefaultBodyLayerStack underlyingLayer = new DefaultBodyLayerStack(new RowReorderLayer(new DataLayerFixture(10, 10, 100, 20)));
NatTableFixture natTableFixture = new NatTableFixture(underlyingLayer);
// Add listener
LayerListenerFixture listenerFixture = new LayerListenerFixture();
natTableFixture.addLayerListener(listenerFixture);
Assert.assertEquals(10, natTableFixture.getRowCount());
Assert.assertEquals(1, natTableFixture.getRowIndexByPosition(1));
// Move to outside the visible range
List<Integer> rowsToMove = Arrays.asList(1, 2, 3);
int destinationPosition = 10;
natTableFixture.doCommand(new MultiRowReorderCommand(natTableFixture, rowsToMove, destinationPosition));
// Ensure that the event propagates to the top
Assert.assertEquals(1, listenerFixture.getEventsCount());
Assert.assertNotNull(listenerFixture.getReceivedEvent(RowReorderEvent.class));
Assert.assertEquals(4, natTableFixture.getRowIndexByPosition(1));
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.LayerListenerFixture in project nebula.widgets.nattable by eclipse.
the class ColumnSizeResetCommandTest method setup.
@Before
public void setup() {
this.dataLayer = new DataLayer(new DummyBodyDataProvider(10, 10));
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 HideShowRowEventTest method setUp.
@Before
public void setUp() {
this.hideShowLayer = new BaseRowHideShowLayerFixture(new DataLayerFixture(100, 40));
this.layerListener = new LayerListenerFixture();
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.LayerListenerFixture in project nebula.widgets.nattable by eclipse.
the class SelectionDragModeTest method setup.
@Before
public void setup() {
this.gridLayer = new DummyGridLayerStack();
this.natTable = new NatTable(new Shell(Display.getDefault()), this.gridLayer);
this.natTable.setSize(400, 400);
this.natTable.doCommand(new InitializeClientAreaCommandFixture());
this.dragMode = new CellSelectionDragMode();
Event event = new Event();
event.widget = new Shell();
event.x = 100;
event.y = 100;
this.mouseEvent = new MouseEvent(event);
this.listener = new LayerListenerFixture();
this.gridLayer.addLayerListener(this.listener);
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.LayerListenerFixture in project nebula.widgets.nattable by eclipse.
the class SelectionEventsTest method setup.
@Before
public void setup() {
this.nattable = new NatTableFixture();
this.listener = new LayerListenerFixture();
this.nattable.addLayerListener(this.listener);
}
Aggregations