Search in sources :

Example 6 with TestLayer

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

the class CompositeFreezeLayerTest method testHideMiddleFrozenColumn.

// Hide/show
@Test
public void testHideMiddleFrozenColumn() {
    this.compositeFreezeLayer.doCommand(new FreezeColumnCommand(this.compositeFreezeLayer, 2));
    this.hideShowLayer.hideColumnPositions(Arrays.asList(new Integer[] { 1 }));
    TestLayer expectedLayer = new TestLayer(3, 4, "0:0;100 | 2:1;100 | 3:0;100", "0:0;40  | 1:1;40  | 2:2;40  | 3:3;40", "A0~:FROZEN_COLUMN_REGION | C0~:FROZEN_COLUMN_REGION | D0~:NONFROZEN_REGION \n" + "A1~:FROZEN_COLUMN_REGION | C1~:FROZEN_COLUMN_REGION | D1~:NONFROZEN_REGION \n" + "A2~:FROZEN_COLUMN_REGION | C2~:FROZEN_COLUMN_REGION | D2~:NONFROZEN_REGION \n" + "A3~:FROZEN_COLUMN_REGION | C3~:FROZEN_COLUMN_REGION | D3~:NONFROZEN_REGION \n");
    LayerAssert.assertLayerEquals(expectedLayer, this.compositeFreezeLayer);
}
Also used : TestLayer(org.eclipse.nebula.widgets.nattable.test.fixture.TestLayer) FreezeColumnCommand(org.eclipse.nebula.widgets.nattable.freeze.command.FreezeColumnCommand) Test(org.junit.Test)

Example 7 with TestLayer

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

the class CompositeFreezeLayerTest method testReorderBeginningFrozenColumnToMiddleOfFrozenArea.

@Test
public void testReorderBeginningFrozenColumnToMiddleOfFrozenArea() {
    this.compositeFreezeLayer.doCommand(new FreezeColumnCommand(this.compositeFreezeLayer, 2));
    this.reorderLayer.reorderColumnPosition(0, 2);
    TestLayer expectedLayer = new TestLayer(4, 4, "1:0;100 | 0:1;100 | 2:2;100 | 3:0;100", "0:0;40  | 1:1;40  | 2:2;40  | 3:3;40", "B0~:FROZEN_COLUMN_REGION | A0~:FROZEN_COLUMN_REGION | C0~:FROZEN_COLUMN_REGION | D0~:NONFROZEN_REGION \n" + "B1~:FROZEN_COLUMN_REGION | A1~:FROZEN_COLUMN_REGION | C1~:FROZEN_COLUMN_REGION | D1~:NONFROZEN_REGION \n" + "B2~:FROZEN_COLUMN_REGION | A2~:FROZEN_COLUMN_REGION | C2~:FROZEN_COLUMN_REGION | D2~:NONFROZEN_REGION \n" + "B3~:FROZEN_COLUMN_REGION | A3~:FROZEN_COLUMN_REGION | C3~:FROZEN_COLUMN_REGION | D3~:NONFROZEN_REGION \n");
    LayerAssert.assertLayerEquals(expectedLayer, this.compositeFreezeLayer);
}
Also used : TestLayer(org.eclipse.nebula.widgets.nattable.test.fixture.TestLayer) FreezeColumnCommand(org.eclipse.nebula.widgets.nattable.freeze.command.FreezeColumnCommand) Test(org.junit.Test)

Example 8 with TestLayer

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

the class CompositeFreezeLayerTest method testReorderMiddleFrozenColumnToEndOfFrozenArea.

@Test
public void testReorderMiddleFrozenColumnToEndOfFrozenArea() {
    this.compositeFreezeLayer.doCommand(new FreezeColumnCommand(this.compositeFreezeLayer, 2));
    this.reorderLayer.reorderColumnPosition(1, 3);
    TestLayer expectedLayer = new TestLayer(4, 4, "0:0;100 | 2:1;100 | 1:2;100 | 3:0;100", "0:0;40  | 1:1;40  | 2:2;40  | 3:3;40", "A0~:FROZEN_COLUMN_REGION | C0~:FROZEN_COLUMN_REGION | B0~:FROZEN_COLUMN_REGION | D0~:NONFROZEN_REGION \n" + "A1~:FROZEN_COLUMN_REGION | C1~:FROZEN_COLUMN_REGION | B1~:FROZEN_COLUMN_REGION | D1~:NONFROZEN_REGION \n" + "A2~:FROZEN_COLUMN_REGION | C2~:FROZEN_COLUMN_REGION | B2~:FROZEN_COLUMN_REGION | D2~:NONFROZEN_REGION \n" + "A3~:FROZEN_COLUMN_REGION | C3~:FROZEN_COLUMN_REGION | B3~:FROZEN_COLUMN_REGION | D3~:NONFROZEN_REGION \n");
    LayerAssert.assertLayerEquals(expectedLayer, this.compositeFreezeLayer);
}
Also used : TestLayer(org.eclipse.nebula.widgets.nattable.test.fixture.TestLayer) FreezeColumnCommand(org.eclipse.nebula.widgets.nattable.freeze.command.FreezeColumnCommand) Test(org.junit.Test)

Example 9 with TestLayer

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

the class FreezeLayerTest2 method testFreezeStart.

@Test
public void testFreezeStart() {
    this.freezeLayer.setTopLeftPosition(0, 0);
    this.freezeLayer.setBottomRightPosition(1, 1);
    TestLayer expectedLayer = new TestLayer(2, 2, "0:0;100 | 1:1;100", "0:0;40  | 1:1;40", "A0 | B0 \n" + "A1 | B1 \n");
    LayerAssert.assertLayerEquals(expectedLayer, this.freezeLayer);
}
Also used : TestLayer(org.eclipse.nebula.widgets.nattable.test.fixture.TestLayer) Test(org.junit.Test)

Example 10 with TestLayer

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

the class ColumnHideShowLayerTest2 method hideColumn.

@Test
public void hideColumn() {
    this.hideShowLayer.hideColumnPositions(Arrays.asList(new Integer[] { 0, 2 }));
    TestLayer expectedLayer = new TestLayer(2, 4, "1:1;100 | 3:3;100", "0:0;40  | 1:1;40  | 2:2;40  | 3:3;40", "B0 | D0 \n" + "B1 | D1 \n" + "B2 | D2 \n" + "B3 | D3 \n");
    LayerAssert.assertLayerEquals(expectedLayer, this.hideShowLayer);
}
Also used : TestLayer(org.eclipse.nebula.widgets.nattable.test.fixture.TestLayer) Test(org.junit.Test)

Aggregations

TestLayer (org.eclipse.nebula.widgets.nattable.test.fixture.TestLayer)36 Test (org.junit.Test)26 FreezeColumnCommand (org.eclipse.nebula.widgets.nattable.freeze.command.FreezeColumnCommand)15 Before (org.junit.Before)10 IClientAreaProvider (org.eclipse.nebula.widgets.nattable.util.IClientAreaProvider)3 Rectangle (org.eclipse.swt.graphics.Rectangle)3 FreezeLayer (org.eclipse.nebula.widgets.nattable.freeze.FreezeLayer)2 FreezeSelectionCommand (org.eclipse.nebula.widgets.nattable.freeze.command.FreezeSelectionCommand)2 ColumnHideShowLayer (org.eclipse.nebula.widgets.nattable.hideshow.ColumnHideShowLayer)2 ViewportLayer (org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer)2 CompositeFreezeLayer (org.eclipse.nebula.widgets.nattable.freeze.CompositeFreezeLayer)1 ColumnReorderLayer (org.eclipse.nebula.widgets.nattable.reorder.ColumnReorderLayer)1 SelectionLayer (org.eclipse.nebula.widgets.nattable.selection.SelectionLayer)1 InitializeClientAreaCommandFixture (org.eclipse.nebula.widgets.nattable.test.fixture.InitializeClientAreaCommandFixture)1