use of org.eclipse.nebula.widgets.nattable.grid.layer.DefaultGridLayer in project nebula.widgets.nattable by eclipse.
the class ListDataProviderPerformanceTest method performanceOfGlazedListDataProvider.
// Bench marked ~ 45 milliseconds. Intel 2GHZ, 2GB Ram
@Test
public void performanceOfGlazedListDataProvider() throws Exception {
String[] propertyNames = RowDataListFixture.getPropertyNames();
Map<String, String> propertyToLabelMap = RowDataListFixture.getPropertyToLabelMap();
List<RowDataFixture> largeList = RowDataListFixture.getList(26000);
Assert.assertTrue(largeList.size() > 25000);
IDataProvider glazedListsDataProvider = new GlazedListsDataProvider<RowDataFixture>(GlazedLists.eventList(largeList), new ReflectiveColumnPropertyAccessor<RowDataFixture>(propertyNames));
IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(propertyNames, propertyToLabelMap);
this.layer = new DefaultGridLayer(glazedListsDataProvider, columnHeaderDataProvider);
}
use of org.eclipse.nebula.widgets.nattable.grid.layer.DefaultGridLayer in project nebula.widgets.nattable by eclipse.
the class GridLayerTest method setup.
@Before
public void setup() {
this.bodyDataLayer = new BaseDataLayerFixture();
this.columnHeaderDataLayer = new BaseDataLayerFixture();
this.rowHeaderDataLayer = new BaseDataLayerFixture();
this.cornerDataLayer = new BaseDataLayerFixture();
this.gridLayerUnderTest = new DefaultGridLayer(this.bodyDataLayer, this.columnHeaderDataLayer, this.rowHeaderDataLayer, this.cornerDataLayer);
}
use of org.eclipse.nebula.widgets.nattable.grid.layer.DefaultGridLayer in project nebula.widgets.nattable by eclipse.
the class GridLayerTest method initBodyLayer.
// **** New tests using fixtures ****
/**
* @see ViewportLayerFixture#DEFAULT_CLIENT_AREA
*/
@Test
public void initBodyLayer() throws Exception {
DefaultGridLayer gridLayer = new GridLayerFixture();
ViewportLayer viewport = gridLayer.getBodyLayer().getViewportLayer();
viewport.setClientAreaProvider(new IClientAreaProvider() {
@Override
public Rectangle getClientArea() {
return new Rectangle(0, 0, 160, 80);
}
});
// Client area gets init when this command is fired
gridLayer.doCommand(new InitializeClientAreaCommandFixture());
Assert.assertEquals(160, viewport.getClientAreaWidth());
Assert.assertEquals(80, viewport.getClientAreaHeight());
Assert.assertEquals(160, viewport.getWidth());
Assert.assertEquals(80, viewport.getHeight());
}
use of org.eclipse.nebula.widgets.nattable.grid.layer.DefaultGridLayer in project nebula.widgets.nattable by eclipse.
the class CopyDataCommandHandlerTest method setUp.
@Before
public void setUp() {
final IDataProvider bodyDataProvider = new DataProviderFixture(10, 10);
this.gridLayer = new DefaultGridLayer(bodyDataProvider, getColumnHeaderDataProvider(bodyDataProvider), getRowHeaderDataProvider(bodyDataProvider));
this.gridLayer.setClientAreaProvider(new IClientAreaProvider() {
@Override
public Rectangle getClientArea() {
return new Rectangle(0, 0, 1050, 1050);
}
});
this.gridLayer.doCommand(new ClientAreaResizeCommand(new Shell(Display.getDefault(), SWT.V_SCROLL | SWT.H_SCROLL)));
this.rowHeaderLayer = this.gridLayer.getRowHeaderLayer();
this.columnHeaderLayer = this.gridLayer.getColumnHeaderLayer();
this.selectionLayer = this.gridLayer.getBodyLayer().getSelectionLayer();
this.commandHandler = new CopyDataCommandHandler(this.selectionLayer, this.columnHeaderLayer, this.rowHeaderLayer);
}
use of org.eclipse.nebula.widgets.nattable.grid.layer.DefaultGridLayer in project nebula.widgets.nattable by eclipse.
the class GridSearchStrategyTest method setUp.
@Before
public void setUp() {
this.gridLayer = new DefaultGridLayer(getBodyDataProvider(), GridLayerFixture.colHeaderDataProvider);
this.selectionLayer = this.gridLayer.getBodyLayer().getSelectionLayer();
this.gridLayer.setClientAreaProvider(new IClientAreaProvider() {
@Override
public Rectangle getClientArea() {
return new Rectangle(0, 0, 1050, 250);
}
});
this.gridLayer.doCommand(new ClientAreaResizeCommand(new Shell(Display.getDefault(), SWT.V_SCROLL | SWT.H_SCROLL)));
this.configRegistry = new ConfigRegistry();
new DefaultNatTableStyleConfiguration().configureRegistry(this.configRegistry);
}
Aggregations