use of org.eclipse.nebula.widgets.nattable.extension.glazedlists.fixture.LayerListenerFixture 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);
}
use of org.eclipse.nebula.widgets.nattable.extension.glazedlists.fixture.LayerListenerFixture 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.extension.glazedlists.fixture.LayerListenerFixture in project nebula.widgets.nattable by eclipse.
the class RowSelectionIntegrationTest method shouldClearSelectionOnSetEmpty.
@Test
public void shouldClearSelectionOnSetEmpty() {
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.extension.glazedlists.fixture.LayerListenerFixture in project nebula.widgets.nattable by eclipse.
the class FilterRowDataProviderTest method clearingFilterFiresUpdateEvent.
@Test
public void clearingFilterFiresUpdateEvent() {
final LayerListenerFixture listener = new LayerListenerFixture();
this.columnHeaderLayer.addLayerListener(listener);
// original size
assertEquals(13, this.filterList.size());
// Apply filter
this.dataProvider.setDataValue(1, 1, "ford");
// list filtered
assertEquals(1, this.filterList.size());
// remove filter
this.dataProvider.clearAllFilters();
assertEquals(13, this.filterList.size());
assertEquals(2, listener.getEventsCount());
assertNotNull(listener.getReceivedEvent(FilterAppliedEvent.class));
}
use of org.eclipse.nebula.widgets.nattable.extension.glazedlists.fixture.LayerListenerFixture 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);
}
Aggregations