use of org.eclipse.nebula.widgets.nattable.config.ConfigRegistry in project nebula.widgets.nattable by eclipse.
the class DefaultGlazedListsFilterStrategyTest method init.
@BeforeClass
public static void init() {
// initialize the collection with a big amount of values
filterList = new FilterList<>(GlazedLists.eventList(PersonService.getFixedPersons()));
for (int i = 1; i < 1000; i++) {
filterList.addAll(PersonService.getFixedPersons());
}
configRegistry = new ConfigRegistry();
new DefaultNatTableStyleConfiguration().configureRegistry(configRegistry);
new DefaultFilterRowConfiguration().configureRegistry(configRegistry);
columnHeaderLayer = new DataLayerFixture(5, 2, 100, 50);
dataProvider = new FilterRowDataProvider<>(new DefaultGlazedListsFilterStrategy<>(filterList, new ReflectiveColumnPropertyAccessor<Person>(personPropertyNames), configRegistry), columnHeaderLayer, columnHeaderLayer.getDataProvider(), configRegistry);
}
use of org.eclipse.nebula.widgets.nattable.config.ConfigRegistry in project nebula.widgets.nattable by eclipse.
the class HideMultipleColumnsIntegrationTest method hideAllColumnsWithColumnGroupsEnabled.
/**
* Exposing bug: http://nattable.org/jira/browse/NTBL-471
*/
@Test
public void hideAllColumnsWithColumnGroupsEnabled() throws Exception {
BodyLayerStackFixture<RowDataFixture> bodyLayerStackFixture = new BodyLayerStackFixture<RowDataFixture>(GlazedLists.eventList(RowDataListFixture.getList()), new ReflectiveColumnPropertyAccessor<RowDataFixture>(RowDataListFixture.getPropertyNames()), new ConfigRegistry());
NatTableFixture natTableFixture = new NatTableFixture(bodyLayerStackFixture);
LayerListenerFixture listenerFixture = new LayerListenerFixture();
natTableFixture.addLayerListener(listenerFixture);
Assert.assertEquals(37, bodyLayerStackFixture.getBodyDataProvider().getColumnCount());
Assert.assertEquals(6, natTableFixture.getColumnCount());
MultiColumnHideCommand hideAllCommand = new MultiColumnHideCommand(natTableFixture, new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36 });
natTableFixture.doCommand(hideAllCommand);
Assert.assertEquals(1, listenerFixture.getEventsCount());
ILayerEvent receivedEvent = listenerFixture.getReceivedEvent(HideColumnPositionsEvent.class);
Assert.assertNotNull(receivedEvent);
}
use of org.eclipse.nebula.widgets.nattable.config.ConfigRegistry in project nebula.widgets.nattable by eclipse.
the class SortIntegrationTest method setup.
@Before
public void setup() {
EventList<RowDataFixture> eventList = GlazedLists.eventList(RowDataListFixture.getList().subList(0, 4));
ConfigRegistry configRegistry = new ConfigRegistry();
this.gridLayerStack = new GlazedListsGridLayer<RowDataFixture>(GlazedLists.threadSafeList(eventList), RowDataListFixture.getPropertyNames(), RowDataListFixture.getPropertyToLabelMap(), configRegistry);
this.nattable = new NatTableFixture(this.gridLayerStack, false);
this.nattable.setConfigRegistry(configRegistry);
this.nattable.addConfiguration(new DefaultNatTableStyleConfiguration());
this.nattable.addConfiguration(new DefaultSortConfiguration());
this.nattable.configure();
}
use of org.eclipse.nebula.widgets.nattable.config.ConfigRegistry in project nebula.widgets.nattable by eclipse.
the class DefaultGlazedListsStaticFilterStrategyTest method init.
@BeforeClass
public static void init() {
// initialize the collection with a big amount of values
filterList = new FilterList<>(GlazedLists.eventList(PersonService.getFixedPersons()));
for (int i = 1; i < 1000; i++) {
filterList.addAll(PersonService.getFixedPersons());
}
configRegistry = new ConfigRegistry();
new DefaultNatTableStyleConfiguration().configureRegistry(configRegistry);
new DefaultFilterRowConfiguration().configureRegistry(configRegistry);
columnHeaderLayer = new DataLayerFixture(5, 2, 100, 50);
filterStrategy = new DefaultGlazedListsStaticFilterStrategy<>(filterList, new ReflectiveColumnPropertyAccessor<Person>(personPropertyNames), configRegistry);
dataProvider = new FilterRowDataProvider<>(filterStrategy, columnHeaderLayer, columnHeaderLayer.getDataProvider(), configRegistry);
}
use of org.eclipse.nebula.widgets.nattable.config.ConfigRegistry in project nebula.widgets.nattable by eclipse.
the class FilterRowDataProviderTest 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<>(GlazedLists.eventList(RowDataListFixture.getList()));
this.dataProvider = new FilterRowDataProvider<>(new DefaultGlazedListsFilterStrategy<>(this.filterList, new ReflectiveColumnPropertyAccessor<RowDataFixture>(RowDataListFixture.getPropertyNames()), this.configRegistry), this.columnHeaderLayer, this.columnHeaderLayer.getDataProvider(), this.configRegistry);
}
Aggregations