use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.DataLayerFixture in project nebula.widgets.nattable by eclipse.
the class RowReorderLayerTest method commandPassedOnToParentIfCannotBeHandled.
@Test
public void commandPassedOnToParentIfCannotBeHandled() throws Exception {
RowReorderLayer reorderLayer = new RowReorderLayer(new DataLayerFixture());
assertFalse(reorderLayer.doCommand(new LayerCommandFixture()));
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.DataLayerFixture in project nebula.widgets.nattable by eclipse.
the class RowReorderLayerTest method canHandleRowReorderCommand.
@Test
public void canHandleRowReorderCommand() throws Exception {
RowReorderLayer reorderLayer = new RowReorderLayer(new DataLayerFixture());
RowReorderCommand reorderCommand = new RowReorderCommand(reorderLayer, 0, 2);
assertTrue(reorderLayer.doCommand(reorderCommand));
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.DataLayerFixture in project nebula.widgets.nattable by eclipse.
the class RowReorderLayerTest method getStartYForReorderedRow.
@Test
public void getStartYForReorderedRow() throws Exception {
this.underlyingLayer = new DataLayerFixture();
this.rowReorderLayer = new RowReorderLayer(this.underlyingLayer);
// 0 1 2 3 4 - see DataLayerFixture
this.rowReorderLayer.reorderRowPosition(0, 5);
// Index: 1 2 3 4 0 Height: 70 25 40 50 40 100 40
assertEquals(0, this.rowReorderLayer.getStartYOfRowPosition(0));
assertEquals(70, this.rowReorderLayer.getStartYOfRowPosition(1));
assertEquals(95, this.rowReorderLayer.getStartYOfRowPosition(2));
assertEquals(135, this.rowReorderLayer.getStartYOfRowPosition(3));
assertEquals(185, this.rowReorderLayer.getStartYOfRowPosition(4));
assertEquals(225, this.rowReorderLayer.getStartYOfRowPosition(5));
assertEquals(265, this.rowReorderLayer.getStartYOfRowPosition(6));
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.DataLayerFixture in project nebula.widgets.nattable by eclipse.
the class RowHideShowLayerTest method showRowPositions.
@Test
public void showRowPositions() throws Exception {
this.rowHideShowLayer = new RowHideShowLayerFixture(new DataLayerFixture(2, 10, 100, 20));
assertEquals(10, this.rowHideShowLayer.getRowCount());
this.rowHideShowLayer.hideRowPositions(Arrays.asList(3, 4, 5));
assertEquals(7, this.rowHideShowLayer.getRowCount());
assertEquals(-1, this.rowHideShowLayer.getRowPositionByIndex(3));
assertEquals(-1, this.rowHideShowLayer.getRowPositionByIndex(4));
this.rowHideShowLayer.showRowIndexes(Arrays.asList(3, 4));
assertEquals(9, this.rowHideShowLayer.getRowCount());
assertEquals(3, this.rowHideShowLayer.getRowPositionByIndex(3));
assertEquals(4, this.rowHideShowLayer.getRowPositionByIndex(4));
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.DataLayerFixture 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();
}
Aggregations