Search in sources :

Example 11 with DummyBodyDataProvider

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

the class RowHeaderSelectionDataLayerExample method createExampleControl.

@Override
public Control createExampleControl(Composite parent) {
    DummyBodyDataProvider bodyDataProvider = new DummyBodyDataProvider(1000000, 1000000);
    SelectionLayer selectionLayer = new SelectionLayer(new DataLayer(bodyDataProvider));
    DataLayer rowHeaderDataLayer = new DataLayer(new DefaultRowHeaderDataProvider(bodyDataProvider));
    rowHeaderDataLayer.setDefaultColumnWidth(40);
    ILayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer, selectionLayer, selectionLayer);
    CompositeLayer compositeLayer = new CompositeLayer(2, 1);
    compositeLayer.setChildLayer(GridRegion.ROW_HEADER, rowHeaderLayer, 0, 0);
    compositeLayer.setChildLayer(GridRegion.BODY, selectionLayer, 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) CompositeLayer(org.eclipse.nebula.widgets.nattable.layer.CompositeLayer)

Example 12 with DummyBodyDataProvider

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

the class CompositeDataLayerExample method createExampleControl.

@Override
public Control createExampleControl(Composite parent) {
    ILayer dataLayer = new DataLayer(new DummyBodyDataProvider(1000000, 1000000));
    CompositeLayer compositeLayer = new CompositeLayer(1, 1);
    compositeLayer.setChildLayer(GridRegion.BODY, dataLayer, 0, 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) ILayer(org.eclipse.nebula.widgets.nattable.layer.ILayer) NatTable(org.eclipse.nebula.widgets.nattable.NatTable) CompositeLayer(org.eclipse.nebula.widgets.nattable.layer.CompositeLayer)

Example 13 with DummyBodyDataProvider

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

the class CompositeLayerPerformanceTest method testGridLayerPerformance.

@Test
public void testGridLayerPerformance() {
    DummyBodyDataProvider bodyDataProvider = new DummyBodyDataProvider(1000000, 1000000);
    SelectionLayer selectionLayer = new SelectionLayer(new DataLayer(bodyDataProvider));
    ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);
    DummyColumnHeaderDataProvider columnHeaderDataProvider = new DummyColumnHeaderDataProvider(bodyDataProvider);
    DataLayer columnHeaderDataLayer = new DataLayer(columnHeaderDataProvider);
    ILayer columnHeaderLayer = new ColumnHeaderLayer(columnHeaderDataLayer, viewportLayer, selectionLayer);
    DefaultRowHeaderDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(bodyDataProvider);
    DataLayer rowHeaderDataLayer = new DataLayer(rowHeaderDataProvider);
    rowHeaderDataLayer.setDefaultColumnWidth(40);
    ILayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer, viewportLayer, selectionLayer);
    ILayer cornerLayer = new CornerLayer(new DataLayer(new DefaultCornerDataProvider(columnHeaderDataProvider, rowHeaderDataProvider)), rowHeaderLayer, columnHeaderLayer);
    layer = new GridLayer(viewportLayer, columnHeaderLayer, rowHeaderLayer, cornerLayer);
}
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) CornerLayer(org.eclipse.nebula.widgets.nattable.grid.layer.CornerLayer) SelectionLayer(org.eclipse.nebula.widgets.nattable.selection.SelectionLayer) ColumnHeaderLayer(org.eclipse.nebula.widgets.nattable.grid.layer.ColumnHeaderLayer) ILayer(org.eclipse.nebula.widgets.nattable.layer.ILayer) DefaultRowHeaderDataProvider(org.eclipse.nebula.widgets.nattable.grid.data.DefaultRowHeaderDataProvider) DefaultCornerDataProvider(org.eclipse.nebula.widgets.nattable.grid.data.DefaultCornerDataProvider) GridLayer(org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer) ViewportLayer(org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer) DummyColumnHeaderDataProvider(org.eclipse.nebula.widgets.nattable.grid.data.DummyColumnHeaderDataProvider) Test(org.junit.Test)

Example 14 with DummyBodyDataProvider

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

the class ElementalLayerPerformanceTest method testBigDataLayerPerformance.

@Test
public void testBigDataLayerPerformance() {
    layer = new DataLayer(new DummyBodyDataProvider(50, 100));
    setExpectedTimeInMillis(250);
}
Also used : DummyBodyDataProvider(org.eclipse.nebula.widgets.nattable.grid.data.DummyBodyDataProvider) DataLayer(org.eclipse.nebula.widgets.nattable.layer.DataLayer) Test(org.junit.Test)

Example 15 with DummyBodyDataProvider

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

the class ElementalLayerPerformanceTest method testCompositeDataLayerPerformance.

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

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