Search in sources :

Example 1 with TestLayer

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

the class AbstractLayerTransformTest method setup.

@Before
public void setup() {
    String columnInfo = "0:0;100 | 1:1;100 | 2:2;100 | 3:3;100";
    String rowInfo = "0:0;40  | 1:1;40  | 2:2;40  | 3:3;40";
    String cellInfo = "A0 | <  | C0 | D0 \n" + "^  | <  | C1 | D1 \n" + "A2 | B2 | C2 | D2 \n" + "A3 | B3 | C3 | D3 \n";
    this.testLayer = new TestLayer(4, 4, columnInfo, rowInfo, cellInfo);
}
Also used : TestLayer(org.eclipse.nebula.widgets.nattable.test.fixture.TestLayer) Before(org.junit.Before)

Example 2 with TestLayer

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

the class CompositeFreezeLayerTest method testHideEndFrozenColumn.

@Test
public void testHideEndFrozenColumn() {
    this.compositeFreezeLayer.doCommand(new FreezeColumnCommand(this.compositeFreezeLayer, 2));
    this.hideShowLayer.hideColumnPositions(Arrays.asList(new Integer[] { 2 }));
    TestLayer expectedLayer = new TestLayer(3, 4, "0:0;100 | 1:1;100 | 3:0;100", "0:0;40  | 1:1;40  | 2:2;40  | 3:3;40", "A0~:FROZEN_COLUMN_REGION | B0~:FROZEN_COLUMN_REGION | D0~:NONFROZEN_REGION \n" + "A1~:FROZEN_COLUMN_REGION | B1~:FROZEN_COLUMN_REGION | D1~:NONFROZEN_REGION \n" + "A2~:FROZEN_COLUMN_REGION | B2~:FROZEN_COLUMN_REGION | D2~:NONFROZEN_REGION \n" + "A3~: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 3 with TestLayer

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

the class CompositeFreezeLayerTest method testReorderMiddleFrozenColumnToMiddleOfFrozenArea.

@Test
public void testReorderMiddleFrozenColumnToMiddleOfFrozenArea() {
    this.compositeFreezeLayer.doCommand(new FreezeColumnCommand(this.compositeFreezeLayer, 3));
    this.reorderLayer.reorderColumnPosition(2, 1);
    TestLayer expectedLayer = new TestLayer(4, 4, "0:0;100 | 2:1;100 | 1:2;100 | 3:3;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~:FROZEN_COLUMN_REGION \n" + "A1~:FROZEN_COLUMN_REGION | C1~:FROZEN_COLUMN_REGION | B1~:FROZEN_COLUMN_REGION | D1~:FROZEN_COLUMN_REGION \n" + "A2~:FROZEN_COLUMN_REGION | C2~:FROZEN_COLUMN_REGION | B2~:FROZEN_COLUMN_REGION | D2~:FROZEN_COLUMN_REGION \n" + "A3~:FROZEN_COLUMN_REGION | C3~:FROZEN_COLUMN_REGION | B3~:FROZEN_COLUMN_REGION | D3~:FROZEN_COLUMN_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 4 with TestLayer

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

the class CompositeFreezeLayerTest method testFreezeColumns.

@Test
public void testFreezeColumns() {
    this.compositeFreezeLayer.doCommand(new FreezeColumnCommand(this.compositeFreezeLayer, 1));
    TestLayer expectedLayer = new TestLayer(4, 4, "0:0;100 | 1:1;100 | 2:0;100 | 3:1;100", "0:0;40  | 1:1;40  | 2:2;40  | 3:3;40", "A0~:FROZEN_COLUMN_REGION | B0~:FROZEN_COLUMN_REGION | C0~:NONFROZEN_REGION | D0~:NONFROZEN_REGION \n" + "A1~:FROZEN_COLUMN_REGION | B1~:FROZEN_COLUMN_REGION | C1~:NONFROZEN_REGION | D1~:NONFROZEN_REGION \n" + "A2~:FROZEN_COLUMN_REGION | B2~:FROZEN_COLUMN_REGION | C2~:NONFROZEN_REGION | D2~:NONFROZEN_REGION \n" + "A3~:FROZEN_COLUMN_REGION | B3~:FROZEN_COLUMN_REGION | C3~:NONFROZEN_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 5 with TestLayer

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

the class CompositeFreezeLayerTest method testFreezeSelectionAtBeginning.

// Freeze selection
@Test
public void testFreezeSelectionAtBeginning() {
    this.selectionLayer.setSelectedCell(2, 2);
    this.compositeFreezeLayer.doCommand(new FreezeSelectionCommand());
    TestLayer expectedLayer = new TestLayer(4, 4, "0:0;100 | 1:1;100 | 2:0;100 | 3:1;100", "0:0;40  | 1:1;40  | 2:0;40  | 3:1;40", "A0~:FROZEN_REGION        | B0~:FROZEN_REGION        | C0~:FROZEN_ROW_REGION                      | D0~:FROZEN_ROW_REGION \n" + "A1~:FROZEN_REGION        | B1~:FROZEN_REGION        | C1~:FROZEN_ROW_REGION                      | D1~:FROZEN_ROW_REGION \n" + "A2~:FROZEN_COLUMN_REGION | B2~:FROZEN_COLUMN_REGION | C2~SELECT:selectionAnchor,NONFROZEN_REGION | D2~:NONFROZEN_REGION \n" + "A3~:FROZEN_COLUMN_REGION | B3~:FROZEN_COLUMN_REGION | C3~:NONFROZEN_REGION                       | D3~:NONFROZEN_REGION \n");
    LayerAssert.assertLayerEquals(expectedLayer, this.compositeFreezeLayer);
}
Also used : TestLayer(org.eclipse.nebula.widgets.nattable.test.fixture.TestLayer) FreezeSelectionCommand(org.eclipse.nebula.widgets.nattable.freeze.command.FreezeSelectionCommand) 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