Search in sources :

Example 1 with DefaultFilterRowConfiguration

use of org.eclipse.nebula.widgets.nattable.filterrow.config.DefaultFilterRowConfiguration in project nebula.widgets.nattable by eclipse.

the class ComboBoxGlazedListsFilterStrategyTest method init.

@BeforeClass
public static void init() {
    // initialize the collection with a big amount of values
    EventList<Person> baseCollection = GlazedLists.eventList(PersonService.getFixedPersons());
    for (int i = 1; i < 1000; i++) {
        baseCollection.addAll(PersonService.getFixedPersons());
    }
    filterList = new FilterList<>(GlazedLists.eventList(baseCollection));
    configRegistry = new ConfigRegistry();
    new DefaultNatTableStyleConfiguration().configureRegistry(configRegistry);
    new DefaultFilterRowConfiguration().configureRegistry(configRegistry);
    new ComboBoxFilterRowConfiguration().configureRegistry(configRegistry);
    columnHeaderLayer = new DataLayerFixture(5, 2, 100, 50);
    IColumnAccessor<Person> bodyDataColumnAccessor = new ReflectiveColumnPropertyAccessor<>(personPropertyNames);
    comboBoxDataProvider = new GlazedListsFilterRowComboBoxDataProvider<>(new DataLayer(new ListDataProvider<>(filterList, bodyDataColumnAccessor)), baseCollection, bodyDataColumnAccessor);
    filterStrategy = new ComboBoxGlazedListsFilterStrategy<>(comboBoxDataProvider, filterList, bodyDataColumnAccessor, configRegistry);
    dataProvider = new FilterRowDataProvider<>(filterStrategy, columnHeaderLayer, columnHeaderLayer.getDataProvider(), configRegistry);
}
Also used : ComboBoxFilterRowConfiguration(org.eclipse.nebula.widgets.nattable.filterrow.combobox.ComboBoxFilterRowConfiguration) ReflectiveColumnPropertyAccessor(org.eclipse.nebula.widgets.nattable.data.ReflectiveColumnPropertyAccessor) ConfigRegistry(org.eclipse.nebula.widgets.nattable.config.ConfigRegistry) DataLayer(org.eclipse.nebula.widgets.nattable.layer.DataLayer) DefaultNatTableStyleConfiguration(org.eclipse.nebula.widgets.nattable.config.DefaultNatTableStyleConfiguration) DefaultFilterRowConfiguration(org.eclipse.nebula.widgets.nattable.filterrow.config.DefaultFilterRowConfiguration) DataLayerFixture(org.eclipse.nebula.widgets.nattable.extension.glazedlists.fixture.DataLayerFixture) Person(org.eclipse.nebula.widgets.nattable.dataset.person.Person) BeforeClass(org.junit.BeforeClass)

Example 2 with DefaultFilterRowConfiguration

use of org.eclipse.nebula.widgets.nattable.filterrow.config.DefaultFilterRowConfiguration 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);
}
Also used : ConfigRegistry(org.eclipse.nebula.widgets.nattable.config.ConfigRegistry) DefaultNatTableStyleConfiguration(org.eclipse.nebula.widgets.nattable.config.DefaultNatTableStyleConfiguration) DefaultFilterRowConfiguration(org.eclipse.nebula.widgets.nattable.filterrow.config.DefaultFilterRowConfiguration) DataLayerFixture(org.eclipse.nebula.widgets.nattable.extension.glazedlists.fixture.DataLayerFixture) Person(org.eclipse.nebula.widgets.nattable.dataset.person.Person) BeforeClass(org.junit.BeforeClass)

Example 3 with DefaultFilterRowConfiguration

use of org.eclipse.nebula.widgets.nattable.filterrow.config.DefaultFilterRowConfiguration 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);
}
Also used : ConfigRegistry(org.eclipse.nebula.widgets.nattable.config.ConfigRegistry) DefaultNatTableStyleConfiguration(org.eclipse.nebula.widgets.nattable.config.DefaultNatTableStyleConfiguration) DefaultFilterRowConfiguration(org.eclipse.nebula.widgets.nattable.filterrow.config.DefaultFilterRowConfiguration) DataLayerFixture(org.eclipse.nebula.widgets.nattable.extension.glazedlists.fixture.DataLayerFixture) ReflectiveColumnPropertyAccessor(org.eclipse.nebula.widgets.nattable.data.ReflectiveColumnPropertyAccessor) BeforeClass(org.junit.BeforeClass)

Example 4 with DefaultFilterRowConfiguration

use of org.eclipse.nebula.widgets.nattable.filterrow.config.DefaultFilterRowConfiguration 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);
}
Also used : ConfigRegistry(org.eclipse.nebula.widgets.nattable.config.ConfigRegistry) DefaultNatTableStyleConfiguration(org.eclipse.nebula.widgets.nattable.config.DefaultNatTableStyleConfiguration) DataLayerFixture(org.eclipse.nebula.widgets.nattable.extension.glazedlists.fixture.DataLayerFixture) DefaultFilterRowConfiguration(org.eclipse.nebula.widgets.nattable.filterrow.config.DefaultFilterRowConfiguration) RowDataFixture(org.eclipse.nebula.widgets.nattable.dataset.fixture.data.RowDataFixture) Before(org.junit.Before)

Example 5 with DefaultFilterRowConfiguration

use of org.eclipse.nebula.widgets.nattable.filterrow.config.DefaultFilterRowConfiguration in project nebula.widgets.nattable by eclipse.

the class FilterRowDataLayerTest 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 FilterRowDataLayer<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);
}
Also used : ConfigRegistry(org.eclipse.nebula.widgets.nattable.config.ConfigRegistry) IConfigRegistry(org.eclipse.nebula.widgets.nattable.config.IConfigRegistry) DefaultNatTableStyleConfiguration(org.eclipse.nebula.widgets.nattable.config.DefaultNatTableStyleConfiguration) DataLayerFixture(org.eclipse.nebula.widgets.nattable.extension.glazedlists.fixture.DataLayerFixture) DefaultFilterRowConfiguration(org.eclipse.nebula.widgets.nattable.filterrow.config.DefaultFilterRowConfiguration) LayerListenerFixture(org.eclipse.nebula.widgets.nattable.extension.glazedlists.fixture.LayerListenerFixture) RowDataFixture(org.eclipse.nebula.widgets.nattable.dataset.fixture.data.RowDataFixture) Before(org.junit.Before)

Aggregations

ConfigRegistry (org.eclipse.nebula.widgets.nattable.config.ConfigRegistry)6 DefaultNatTableStyleConfiguration (org.eclipse.nebula.widgets.nattable.config.DefaultNatTableStyleConfiguration)6 DataLayerFixture (org.eclipse.nebula.widgets.nattable.extension.glazedlists.fixture.DataLayerFixture)6 DefaultFilterRowConfiguration (org.eclipse.nebula.widgets.nattable.filterrow.config.DefaultFilterRowConfiguration)6 RowDataFixture (org.eclipse.nebula.widgets.nattable.dataset.fixture.data.RowDataFixture)3 Before (org.junit.Before)3 BeforeClass (org.junit.BeforeClass)3 IConfigRegistry (org.eclipse.nebula.widgets.nattable.config.IConfigRegistry)2 ReflectiveColumnPropertyAccessor (org.eclipse.nebula.widgets.nattable.data.ReflectiveColumnPropertyAccessor)2 Person (org.eclipse.nebula.widgets.nattable.dataset.person.Person)2 LayerListenerFixture (org.eclipse.nebula.widgets.nattable.extension.glazedlists.fixture.LayerListenerFixture)2 ComboBoxFilterRowConfiguration (org.eclipse.nebula.widgets.nattable.filterrow.combobox.ComboBoxFilterRowConfiguration)1 DataLayer (org.eclipse.nebula.widgets.nattable.layer.DataLayer)1