use of org.eclipse.nebula.widgets.nattable.dataset.fixture.data.RowDataFixture in project nebula.widgets.nattable by eclipse.
the class FilterRowHeaderCompositeTest method setup.
@Before
public void setup() {
this.columnHeaderLayer = new DataLayerFixture(10, 2, 100, 50);
this.configRegistry = new ConfigRegistry();
new DefaultNatTableStyleConfiguration().configureRegistry(this.configRegistry);
new DefaultFilterRowConfiguration().configureRegistry(this.configRegistry);
this.filterList = new FilterList<RowDataFixture>(GlazedLists.eventList(RowDataListFixture.getList()));
this.layerUnderTest = new FilterRowHeaderComposite<RowDataFixture>(new DefaultGlazedListsFilterStrategy<RowDataFixture>(this.filterList, new ReflectiveColumnPropertyAccessor<RowDataFixture>(RowDataListFixture.getPropertyNames()), this.configRegistry), this.columnHeaderLayer, this.columnHeaderLayer.getDataProvider(), this.configRegistry);
this.listener = new LayerListenerFixture();
this.layerUnderTest.addLayerListener(this.listener);
}
use of org.eclipse.nebula.widgets.nattable.dataset.fixture.data.RowDataFixture in project nebula.widgets.nattable by eclipse.
the class ListDataProviderPerformanceTest method performanceOfListDataProvider.
// Bench marked ~ 65 milliseconds. Intel 2GHZ, 2GB Ram
@Test
public void performanceOfListDataProvider() throws Exception {
List<RowDataFixture> largeList = RowDataListFixture.getList(26000);
Assert.assertTrue(largeList.size() > 25000);
this.layer = new DefaultGridLayer(largeList, RowDataListFixture.getPropertyNames(), RowDataListFixture.getPropertyToLabelMap());
}
use of org.eclipse.nebula.widgets.nattable.dataset.fixture.data.RowDataFixture 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.dataset.fixture.data.RowDataFixture in project nebula.widgets.nattable by eclipse.
the class RowSelectionIntegrationTest method shouldClearSelectionOnSetEmptyOnAdd.
@Test
public void shouldClearSelectionOnSetEmptyOnAdd() {
this.selectionProvider.setAddSelectionOnSet(true);
LayerListenerFixture listener = new LayerListenerFixture();
this.nattable.addLayerListener(listener);
this.selectionProvider.setSelection(new StructuredSelection(new RowDataFixture[] { this.eventListFixture.get(1), this.eventListFixture.get(3) }));
assertEquals(2, this.selectionLayer.getFullySelectedRowPositions().length);
assertEquals(1, listener.getEventsCount());
this.selectionProvider.setSelection(StructuredSelection.EMPTY);
assertEquals(0, this.selectionLayer.getFullySelectedRowPositions().length);
assertEquals(2, listener.getEventsCount());
}
use of org.eclipse.nebula.widgets.nattable.dataset.fixture.data.RowDataFixture in project nebula.widgets.nattable by eclipse.
the class RowSelectionIntegrationTest method setMultipleSelectionViaProviderWithAdd.
@Test
public void setMultipleSelectionViaProviderWithAdd() {
this.selectionProvider.setAddSelectionOnSet(true);
this.selectionProvider.setSelection(new StructuredSelection(new RowDataFixture[] { this.eventListFixture.get(1), this.eventListFixture.get(3) }));
assertEquals(2, this.selectionLayer.getFullySelectedRowPositions().length);
this.selectionProvider.setSelection(new StructuredSelection(new RowDataFixture[] { this.eventListFixture.get(5), this.eventListFixture.get(7) }));
assertEquals(4, this.selectionLayer.getFullySelectedRowPositions().length);
}
Aggregations