Search in sources :

Example 21 with DummyBodyDataProvider

use of org.eclipse.nebula.widgets.nattable.grid.data.DummyBodyDataProvider in project nebula.widgets.nattable by eclipse.

the class RowHeaderViewportSelectionDataLayerExample method createExampleControl.

@Override
public Control createExampleControl(Composite parent) {
    DummyBodyDataProvider bodyDataProvider = new DummyBodyDataProvider(1000000, 1000000);
    SelectionLayer selectionLayer = new SelectionLayer(new DataLayer(bodyDataProvider));
    ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);
    DataLayer rowHeaderDataLayer = new DataLayer(new DefaultRowHeaderDataProvider(bodyDataProvider));
    rowHeaderDataLayer.setDefaultColumnWidth(41);
    ILayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer, viewportLayer, selectionLayer);
    CompositeLayer compositeLayer = new CompositeLayer(2, 1);
    compositeLayer.setChildLayer(GridRegion.ROW_HEADER, rowHeaderLayer, 0, 0);
    compositeLayer.setChildLayer(GridRegion.BODY, viewportLayer, 1, 0);
    return new NatTable(parent, compositeLayer);
}
Also used : DummyBodyDataProvider(org.eclipse.nebula.widgets.nattable.grid.data.DummyBodyDataProvider) DataLayer(org.eclipse.nebula.widgets.nattable.layer.DataLayer) RowHeaderLayer(org.eclipse.nebula.widgets.nattable.grid.layer.RowHeaderLayer) SelectionLayer(org.eclipse.nebula.widgets.nattable.selection.SelectionLayer) ILayer(org.eclipse.nebula.widgets.nattable.layer.ILayer) NatTable(org.eclipse.nebula.widgets.nattable.NatTable) DefaultRowHeaderDataProvider(org.eclipse.nebula.widgets.nattable.grid.data.DefaultRowHeaderDataProvider) ViewportLayer(org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer) CompositeLayer(org.eclipse.nebula.widgets.nattable.layer.CompositeLayer)

Example 22 with DummyBodyDataProvider

use of org.eclipse.nebula.widgets.nattable.grid.data.DummyBodyDataProvider in project nebula.widgets.nattable by eclipse.

the class ElementalViewportLayerPerformanceTest method testViewportReorderDataLayerPerformance.

@Test
public void testViewportReorderDataLayerPerformance() {
    ColumnReorderLayer reorderLayer = new ColumnReorderLayer(new DataLayer(new DummyBodyDataProvider(1000000, 1000000)));
    reorderLayer.reorderColumnPosition(1, 2);
    layer = new ViewportLayer(reorderLayer);
}
Also used : DummyBodyDataProvider(org.eclipse.nebula.widgets.nattable.grid.data.DummyBodyDataProvider) DataLayer(org.eclipse.nebula.widgets.nattable.layer.DataLayer) ColumnReorderLayer(org.eclipse.nebula.widgets.nattable.reorder.ColumnReorderLayer) ViewportLayer(org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer) Test(org.junit.Test)

Example 23 with DummyBodyDataProvider

use of org.eclipse.nebula.widgets.nattable.grid.data.DummyBodyDataProvider in project nebula.widgets.nattable by eclipse.

the class ElementalViewportLayerPerformanceTest method testCompositeViewportDataLayerPerformance.

@Test
public void testCompositeViewportDataLayerPerformance() {
    CompositeLayer compositeLayer = new CompositeLayer(1, 1);
    compositeLayer.setChildLayer(GridRegion.BODY, new ViewportLayer(new DataLayer(new DummyBodyDataProvider(1000000, 1000000))), 0, 0);
    layer = compositeLayer;
}
Also used : DummyBodyDataProvider(org.eclipse.nebula.widgets.nattable.grid.data.DummyBodyDataProvider) DataLayer(org.eclipse.nebula.widgets.nattable.layer.DataLayer) ViewportLayer(org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer) CompositeLayer(org.eclipse.nebula.widgets.nattable.layer.CompositeLayer) Test(org.junit.Test)

Example 24 with DummyBodyDataProvider

use of org.eclipse.nebula.widgets.nattable.grid.data.DummyBodyDataProvider in project nebula.widgets.nattable by eclipse.

the class ColumnSizeConfigurationCommandTest method setup.

@Before
public void setup() {
    this.dataLayer = new DataLayer(new DummyBodyDataProvider(4, 4));
    this.dataLayer.setConfigLabelAccumulator(new ColumnLabelAccumulator());
}
Also used : DummyBodyDataProvider(org.eclipse.nebula.widgets.nattable.grid.data.DummyBodyDataProvider) DataLayer(org.eclipse.nebula.widgets.nattable.layer.DataLayer) ColumnLabelAccumulator(org.eclipse.nebula.widgets.nattable.layer.cell.ColumnLabelAccumulator) Before(org.junit.Before)

Example 25 with DummyBodyDataProvider

use of org.eclipse.nebula.widgets.nattable.grid.data.DummyBodyDataProvider in project nebula.widgets.nattable by eclipse.

the class ColumnSizeResetCommandTest method setup.

@Before
public void setup() {
    this.dataLayer = new DataLayer(new DummyBodyDataProvider(10, 10));
    this.listener = new LayerListenerFixture();
    this.dataLayer.addLayerListener(this.listener);
}
Also used : DummyBodyDataProvider(org.eclipse.nebula.widgets.nattable.grid.data.DummyBodyDataProvider) DataLayer(org.eclipse.nebula.widgets.nattable.layer.DataLayer) LayerListenerFixture(org.eclipse.nebula.widgets.nattable.test.fixture.layer.LayerListenerFixture) Before(org.junit.Before)

Aggregations

DummyBodyDataProvider (org.eclipse.nebula.widgets.nattable.grid.data.DummyBodyDataProvider)32 DataLayer (org.eclipse.nebula.widgets.nattable.layer.DataLayer)32 Test (org.junit.Test)16 NatTable (org.eclipse.nebula.widgets.nattable.NatTable)11 ILayer (org.eclipse.nebula.widgets.nattable.layer.ILayer)11 SelectionLayer (org.eclipse.nebula.widgets.nattable.selection.SelectionLayer)11 ViewportLayer (org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer)11 CompositeLayer (org.eclipse.nebula.widgets.nattable.layer.CompositeLayer)9 DummyColumnHeaderDataProvider (org.eclipse.nebula.widgets.nattable.grid.data.DummyColumnHeaderDataProvider)8 ColumnHeaderLayer (org.eclipse.nebula.widgets.nattable.grid.layer.ColumnHeaderLayer)8 DefaultRowHeaderDataProvider (org.eclipse.nebula.widgets.nattable.grid.data.DefaultRowHeaderDataProvider)6 RowHeaderLayer (org.eclipse.nebula.widgets.nattable.grid.layer.RowHeaderLayer)6 ColumnReorderLayer (org.eclipse.nebula.widgets.nattable.reorder.ColumnReorderLayer)5 Before (org.junit.Before)5 DefaultCornerDataProvider (org.eclipse.nebula.widgets.nattable.grid.data.DefaultCornerDataProvider)4 CornerLayer (org.eclipse.nebula.widgets.nattable.grid.layer.CornerLayer)4 GridLayer (org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer)4 ColumnHideShowLayer (org.eclipse.nebula.widgets.nattable.hideshow.ColumnHideShowLayer)3 DefaultNatTableStyleConfiguration (org.eclipse.nebula.widgets.nattable.config.DefaultNatTableStyleConfiguration)2 CompositeFreezeLayer (org.eclipse.nebula.widgets.nattable.freeze.CompositeFreezeLayer)2