Search in sources :

Example 1 with InitializeClientAreaCommandFixture

use of org.eclipse.nebula.widgets.nattable.test.fixture.InitializeClientAreaCommandFixture in project nebula.widgets.nattable by eclipse.

the class CellSelectionTest method setUp.

@Before
public void setUp() {
    this.gridLayer = new GridLayerFixture();
    this.gridLayer.doCommand(new InitializeClientAreaCommandFixture());
}
Also used : InitializeClientAreaCommandFixture(org.eclipse.nebula.widgets.nattable.test.fixture.InitializeClientAreaCommandFixture) GridLayerFixture(org.eclipse.nebula.widgets.nattable.test.fixture.layer.GridLayerFixture) Before(org.junit.Before)

Example 2 with InitializeClientAreaCommandFixture

use of org.eclipse.nebula.widgets.nattable.test.fixture.InitializeClientAreaCommandFixture 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());
}
Also used : InitializeClientAreaCommandFixture(org.eclipse.nebula.widgets.nattable.test.fixture.InitializeClientAreaCommandFixture) GridLayerFixture(org.eclipse.nebula.widgets.nattable.test.fixture.layer.GridLayerFixture) Before(org.junit.Before)

Example 3 with InitializeClientAreaCommandFixture

use of org.eclipse.nebula.widgets.nattable.test.fixture.InitializeClientAreaCommandFixture in project nebula.widgets.nattable by eclipse.

the class CompositeFreezeLayerTest method setup.

@Before
public void setup() {
    TestLayer dataLayer = new TestLayer(4, 4, "0:0;100 | 1:1;100 | 2:2;100 | 3:3;100", "0:0;40  | 1:1;40  | 2:2;40  | 3:3;40", "A0 | B0 | C0 | D0 \n" + "A1 | B1 | C1 | D1 \n" + "A2 | B2 | C2 | D2 \n" + "A3 | B3 | C3 | D3 \n");
    this.reorderLayer = new ColumnReorderLayer(dataLayer);
    this.hideShowLayer = new ColumnHideShowLayer(this.reorderLayer);
    this.selectionLayer = new SelectionLayer(this.hideShowLayer);
    this.viewportLayer = new ViewportLayer(this.selectionLayer);
    this.freezeLayer = new FreezeLayer(this.selectionLayer);
    this.compositeFreezeLayer = new CompositeFreezeLayer(this.freezeLayer, this.viewportLayer, this.selectionLayer);
    this.compositeFreezeLayer.setClientAreaProvider(new IClientAreaProvider() {

        @Override
        public Rectangle getClientArea() {
            return new Rectangle(0, 0, 400, 160);
        }
    });
    this.compositeFreezeLayer.doCommand(new InitializeClientAreaCommandFixture());
}
Also used : InitializeClientAreaCommandFixture(org.eclipse.nebula.widgets.nattable.test.fixture.InitializeClientAreaCommandFixture) IClientAreaProvider(org.eclipse.nebula.widgets.nattable.util.IClientAreaProvider) SelectionLayer(org.eclipse.nebula.widgets.nattable.selection.SelectionLayer) FreezeLayer(org.eclipse.nebula.widgets.nattable.freeze.FreezeLayer) CompositeFreezeLayer(org.eclipse.nebula.widgets.nattable.freeze.CompositeFreezeLayer) Rectangle(org.eclipse.swt.graphics.Rectangle) TestLayer(org.eclipse.nebula.widgets.nattable.test.fixture.TestLayer) ColumnReorderLayer(org.eclipse.nebula.widgets.nattable.reorder.ColumnReorderLayer) CompositeFreezeLayer(org.eclipse.nebula.widgets.nattable.freeze.CompositeFreezeLayer) ColumnHideShowLayer(org.eclipse.nebula.widgets.nattable.hideshow.ColumnHideShowLayer) ViewportLayer(org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer) Before(org.junit.Before)

Example 4 with InitializeClientAreaCommandFixture

use of org.eclipse.nebula.widgets.nattable.test.fixture.InitializeClientAreaCommandFixture 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());
}
Also used : InitializeClientAreaCommandFixture(org.eclipse.nebula.widgets.nattable.test.fixture.InitializeClientAreaCommandFixture) ILayer(org.eclipse.nebula.widgets.nattable.layer.ILayer) GridLayer(org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer) DefaultGridLayer(org.eclipse.nebula.widgets.nattable.grid.layer.DefaultGridLayer) GridLayerFixture(org.eclipse.nebula.widgets.nattable.test.fixture.layer.GridLayerFixture) Test(org.junit.Test)

Example 5 with InitializeClientAreaCommandFixture

use of org.eclipse.nebula.widgets.nattable.test.fixture.InitializeClientAreaCommandFixture 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());
}
Also used : InitializeClientAreaCommandFixture(org.eclipse.nebula.widgets.nattable.test.fixture.InitializeClientAreaCommandFixture) IClientAreaProvider(org.eclipse.nebula.widgets.nattable.util.IClientAreaProvider) Rectangle(org.eclipse.swt.graphics.Rectangle) ViewportLayer(org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer) DefaultGridLayer(org.eclipse.nebula.widgets.nattable.grid.layer.DefaultGridLayer) GridLayerFixture(org.eclipse.nebula.widgets.nattable.test.fixture.layer.GridLayerFixture) Test(org.junit.Test)

Aggregations

InitializeClientAreaCommandFixture (org.eclipse.nebula.widgets.nattable.test.fixture.InitializeClientAreaCommandFixture)7 GridLayerFixture (org.eclipse.nebula.widgets.nattable.test.fixture.layer.GridLayerFixture)5 Before (org.junit.Before)5 DefaultGridLayer (org.eclipse.nebula.widgets.nattable.grid.layer.DefaultGridLayer)2 IClientAreaProvider (org.eclipse.nebula.widgets.nattable.util.IClientAreaProvider)2 ViewportLayer (org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer)2 Rectangle (org.eclipse.swt.graphics.Rectangle)2 Test (org.junit.Test)2 NatTable (org.eclipse.nebula.widgets.nattable.NatTable)1 CompositeFreezeLayer (org.eclipse.nebula.widgets.nattable.freeze.CompositeFreezeLayer)1 FreezeLayer (org.eclipse.nebula.widgets.nattable.freeze.FreezeLayer)1 GridLayer (org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer)1 ColumnHideShowLayer (org.eclipse.nebula.widgets.nattable.hideshow.ColumnHideShowLayer)1 ILayer (org.eclipse.nebula.widgets.nattable.layer.ILayer)1 ILayerEvent (org.eclipse.nebula.widgets.nattable.layer.event.ILayerEvent)1 DummyGridLayerStack (org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack)1 ColumnReorderLayer (org.eclipse.nebula.widgets.nattable.reorder.ColumnReorderLayer)1 SelectionLayer (org.eclipse.nebula.widgets.nattable.selection.SelectionLayer)1 TestLayer (org.eclipse.nebula.widgets.nattable.test.fixture.TestLayer)1 LayerListenerFixture (org.eclipse.nebula.widgets.nattable.test.fixture.layer.LayerListenerFixture)1