Search in sources :

Example 6 with DataLayerFixture

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

the class CompositeLayerTest method getHeight.

@Test
public void getHeight() throws Exception {
    assertEquals(70, this.layerFixture.getHeight());
    // 20 rows, each 20 high
    this.layerFixture.setChildLayer(GridRegion.CORNER, new DataLayerFixture(10, 10, 100, 20), 0, 0);
    this.layerFixture.setChildLayer(GridRegion.ROW_HEADER, new DataLayerFixture(10, 10, 100, 20), 0, 1);
    assertEquals(400, this.layerFixture.getHeight());
}
Also used : DataLayerFixture(org.eclipse.nebula.widgets.nattable.test.fixture.layer.DataLayerFixture) Test(org.junit.Test)

Example 7 with DataLayerFixture

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

the class ColumnGroupReorderDragModeTest method setup.

@Before
public void setup() {
    this.testLayer = new DataLayerFixture(10, 5, 100, 20);
    this.columnGroupModel = new ColumnGroupModelFixture();
    this.groupReorderDragMode = new ColumnGroupHeaderReorderDragMode(this.columnGroupModel);
}
Also used : ColumnGroupModelFixture(org.eclipse.nebula.widgets.nattable.test.fixture.group.ColumnGroupModelFixture) DataLayerFixture(org.eclipse.nebula.widgets.nattable.test.fixture.layer.DataLayerFixture) Before(org.junit.Before)

Example 8 with DataLayerFixture

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

the class ColumnHeaderReoderDragModeTest method setup.

@Before
public void setup() {
    this.model = new ColumnGroupModelFixture();
    this.model.addColumnsIndexesToGroup("G4", 18, 19, 20);
    this.model.getColumnGroupByIndex(0).setUnbreakable(true);
    this.model.getColumnGroupByIndex(10).setUnbreakable(true);
    this.testLayer = new DataLayerFixture(20, 10, 100, 20);
    this.dragMode = new ColumnHeaderReorderDragMode(this.model);
}
Also used : ColumnHeaderReorderDragMode(org.eclipse.nebula.widgets.nattable.group.action.ColumnHeaderReorderDragMode) ColumnGroupModelFixture(org.eclipse.nebula.widgets.nattable.test.fixture.group.ColumnGroupModelFixture) DataLayerFixture(org.eclipse.nebula.widgets.nattable.test.fixture.layer.DataLayerFixture) Before(org.junit.Before)

Example 9 with DataLayerFixture

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

the class ColumnHideShowLayerTest method showColumnPositions.

@Test
public void showColumnPositions() throws Exception {
    this.columnHideShowLayer = new ColumnHideShowLayerFixture(new DataLayerFixture(10, 2, 100, 20));
    assertEquals(10, this.columnHideShowLayer.getColumnCount());
    this.columnHideShowLayer.hideColumnPositions(Arrays.asList(3, 4, 5));
    assertEquals(7, this.columnHideShowLayer.getColumnCount());
    assertEquals(-1, this.columnHideShowLayer.getColumnPositionByIndex(3));
    assertEquals(-1, this.columnHideShowLayer.getColumnPositionByIndex(4));
    this.columnHideShowLayer.showColumnIndexes(Arrays.asList(3, 4));
    assertEquals(9, this.columnHideShowLayer.getColumnCount());
    assertEquals(3, this.columnHideShowLayer.getColumnPositionByIndex(3));
    assertEquals(4, this.columnHideShowLayer.getColumnPositionByIndex(4));
}
Also used : ColumnHideShowLayerFixture(org.eclipse.nebula.widgets.nattable.test.fixture.layer.ColumnHideShowLayerFixture) DataLayerFixture(org.eclipse.nebula.widgets.nattable.test.fixture.layer.DataLayerFixture) Test(org.junit.Test)

Example 10 with DataLayerFixture

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

the class ColumnOverrideLabelAccumulatorTest method setUp.

@Before
public void setUp() {
    this.labelAccumulator = new ColumnOverrideLabelAccumulator(new DataLayerFixture());
    this.testProperties = new Properties();
}
Also used : DataLayerFixture(org.eclipse.nebula.widgets.nattable.test.fixture.layer.DataLayerFixture) Properties(java.util.Properties) Before(org.junit.Before)

Aggregations

DataLayerFixture (org.eclipse.nebula.widgets.nattable.test.fixture.layer.DataLayerFixture)57 Test (org.junit.Test)28 Before (org.junit.Before)27 BaseDataLayerFixture (org.eclipse.nebula.widgets.nattable.test.fixture.layer.BaseDataLayerFixture)11 LayerListenerFixture (org.eclipse.nebula.widgets.nattable.test.fixture.layer.LayerListenerFixture)7 Rectangle (org.eclipse.swt.graphics.Rectangle)7 DefaultBodyLayerStack (org.eclipse.nebula.widgets.nattable.layer.stack.DefaultBodyLayerStack)6 ViewportLayer (org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer)6 NatTableFixture (org.eclipse.nebula.widgets.nattable.test.fixture.NatTableFixture)5 IClientAreaProvider (org.eclipse.nebula.widgets.nattable.util.IClientAreaProvider)5 SelectionLayer (org.eclipse.nebula.widgets.nattable.selection.SelectionLayer)4 ColumnOverrideLabelAccumulator (org.eclipse.nebula.widgets.nattable.layer.cell.ColumnOverrideLabelAccumulator)3 LayerCommandFixture (org.eclipse.nebula.widgets.nattable.test.fixture.command.LayerCommandFixture)3 ColumnGroupModelFixture (org.eclipse.nebula.widgets.nattable.test.fixture.group.ColumnGroupModelFixture)3 Properties (java.util.Properties)2 IConfigRegistry (org.eclipse.nebula.widgets.nattable.config.IConfigRegistry)2 IDataProvider (org.eclipse.nebula.widgets.nattable.data.IDataProvider)2 RowDataFixture (org.eclipse.nebula.widgets.nattable.dataset.fixture.data.RowDataFixture)2 ColumnHideShowLayer (org.eclipse.nebula.widgets.nattable.hideshow.ColumnHideShowLayer)2 RowHideShowLayer (org.eclipse.nebula.widgets.nattable.hideshow.RowHideShowLayer)2