Search in sources :

Example 1 with DataLayerFixture

use of org.eclipse.nebula.widgets.nattable.extension.glazedlists.fixture.DataLayerFixture in project nebula.widgets.nattable by eclipse.

the class GlazedListsEventLayerTest method setup.

@Before
public void setup() {
    this.listFixture = GlazedLists.eventList(RowDataListFixture.getList());
    this.layerUnderTest = new GlazedListsEventLayer<RowDataFixture>(new DataLayerFixture(), this.listFixture);
    this.layerUnderTest.setTestMode(true);
    this.listenerFixture = new LayerListenerFixture();
    this.layerUnderTest.addLayerListener(this.listenerFixture);
}
Also used : DataLayerFixture(org.eclipse.nebula.widgets.nattable.extension.glazedlists.fixture.DataLayerFixture) LayerListenerFixture(org.eclipse.nebula.widgets.nattable.extension.glazedlists.fixture.LayerListenerFixture) RowDataFixture(org.eclipse.nebula.widgets.nattable.dataset.fixture.data.RowDataFixture) BlinkingRowDataFixture(org.eclipse.nebula.widgets.nattable.dataset.fixture.data.BlinkingRowDataFixture) Before(org.junit.Before)

Example 2 with DataLayerFixture

use of org.eclipse.nebula.widgets.nattable.extension.glazedlists.fixture.DataLayerFixture 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 3 with DataLayerFixture

use of org.eclipse.nebula.widgets.nattable.extension.glazedlists.fixture.DataLayerFixture 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 4 with DataLayerFixture

use of org.eclipse.nebula.widgets.nattable.extension.glazedlists.fixture.DataLayerFixture 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 5 with DataLayerFixture

use of org.eclipse.nebula.widgets.nattable.extension.glazedlists.fixture.DataLayerFixture 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)

Aggregations

DataLayerFixture (org.eclipse.nebula.widgets.nattable.extension.glazedlists.fixture.DataLayerFixture)7 ConfigRegistry (org.eclipse.nebula.widgets.nattable.config.ConfigRegistry)6 DefaultNatTableStyleConfiguration (org.eclipse.nebula.widgets.nattable.config.DefaultNatTableStyleConfiguration)6 DefaultFilterRowConfiguration (org.eclipse.nebula.widgets.nattable.filterrow.config.DefaultFilterRowConfiguration)6 RowDataFixture (org.eclipse.nebula.widgets.nattable.dataset.fixture.data.RowDataFixture)4 Before (org.junit.Before)4 LayerListenerFixture (org.eclipse.nebula.widgets.nattable.extension.glazedlists.fixture.LayerListenerFixture)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 BlinkingRowDataFixture (org.eclipse.nebula.widgets.nattable.dataset.fixture.data.BlinkingRowDataFixture)1 ComboBoxFilterRowConfiguration (org.eclipse.nebula.widgets.nattable.filterrow.combobox.ComboBoxFilterRowConfiguration)1 DataLayer (org.eclipse.nebula.widgets.nattable.layer.DataLayer)1