use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.GridLayerFixture in project nebula.widgets.nattable by eclipse.
the class ColumnHeaderLayerSelectionTest method setUp.
@Before
public void setUp() {
this.gridLayer = new GridLayerFixture();
this.gridLayer.doCommand(new InitializeClientAreaCommandFixture());
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.GridLayerFixture in project nebula.widgets.nattable by eclipse.
the class GridLayerTest method initCorner.
@Test
public void initCorner() throws Exception {
GridLayer gridLayer = new GridLayerFixture();
ILayer colHeader = gridLayer.getCornerLayer();
Assert.assertEquals(20, colHeader.getHeight());
Assert.assertEquals(40, colHeader.getWidth());
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.GridLayerFixture in project nebula.widgets.nattable by eclipse.
the class GridLayerTest method initRowHeaderHeight.
@Test
public void initRowHeaderHeight() throws Exception {
GridLayer gridLayer = new GridLayerFixture();
gridLayer.doCommand(new InitializeClientAreaCommandFixture());
ILayer rowHeader = gridLayer.getRowHeaderLayer();
// Only visible rows are counted
Assert.assertEquals(100, rowHeader.getHeight());
Assert.assertEquals(40, rowHeader.getWidth());
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.GridLayerFixture in project nebula.widgets.nattable by eclipse.
the class GridLayerTest method initBodyLayer.
// **** New tests using fixtures ****
/**
* @see ViewportLayerFixture#DEFAULT_CLIENT_AREA
*/
@Test
public void initBodyLayer() throws Exception {
DefaultGridLayer gridLayer = new GridLayerFixture();
ViewportLayer viewport = gridLayer.getBodyLayer().getViewportLayer();
viewport.setClientAreaProvider(new IClientAreaProvider() {
@Override
public Rectangle getClientArea() {
return new Rectangle(0, 0, 160, 80);
}
});
// Client area gets init when this command is fired
gridLayer.doCommand(new InitializeClientAreaCommandFixture());
Assert.assertEquals(160, viewport.getClientAreaWidth());
Assert.assertEquals(80, viewport.getClientAreaHeight());
Assert.assertEquals(160, viewport.getWidth());
Assert.assertEquals(80, viewport.getHeight());
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.GridLayerFixture in project nebula.widgets.nattable by eclipse.
the class ColumnGroupsCommandHandlerTest method setUp.
@Before
public void setUp() {
this.gridLayer = new GridLayerFixture();
this.selectionLayer = (SelectionLayer) this.gridLayer.getBodyLayer().getViewportLayer().getScrollableLayer();
this.model = new ColumnGroupModel();
this.handler = new ColumnGroupsCommandHandler(this.model, this.selectionLayer, new ColumnGroupHeaderLayer(this.gridLayer.getColumnHeaderLayer(), this.gridLayer.getBodyLayer().getSelectionLayer(), new ColumnGroupModel()));
this.gridLayer.setClientAreaProvider(new IClientAreaProvider() {
@Override
public Rectangle getClientArea() {
return new Rectangle(0, 0, 1050, 250);
}
});
this.gridLayer.doCommand(new ClientAreaResizeCommand(new Shell(Display.getDefault(), SWT.V_SCROLL | SWT.H_SCROLL)));
}
Aggregations