Search in sources :

Example 1 with EventConflaterChain

use of org.eclipse.nebula.widgets.nattable.conflation.EventConflaterChain in project nebula.widgets.nattable by eclipse.

the class VisualChangeEventConflaterTest method shouldAccumulateEvents.

@Test
public void shouldAccumulateEvents() throws Exception {
    NatTableFixture natTable = new NatTableFixture();
    VisualChangeEventConflater conflater = new VisualChangeEventConflater(natTable);
    EventConflaterChain chain = new EventConflaterChain();
    chain.add(conflater);
    conflater.addEvent(new LayerEventFixture());
    conflater.addEvent(new LayerEventFixture());
    assertEquals(2, conflater.getCount());
    chain.start();
    Thread.sleep(EventConflaterChain.DEFAULT_INITIAL_DELAY + 100);
    assertEquals(0, conflater.getCount());
}
Also used : NatTableFixture(org.eclipse.nebula.widgets.nattable.test.fixture.NatTableFixture) LayerEventFixture(org.eclipse.nebula.widgets.nattable.test.fixture.LayerEventFixture) EventConflaterChain(org.eclipse.nebula.widgets.nattable.conflation.EventConflaterChain) VisualChangeEventConflater(org.eclipse.nebula.widgets.nattable.conflation.VisualChangeEventConflater) Test(org.junit.Test)

Example 2 with EventConflaterChain

use of org.eclipse.nebula.widgets.nattable.conflation.EventConflaterChain in project nebula.widgets.nattable by eclipse.

the class EventConflaterChainTest method setup.

@Before
public void setup() {
    this.conflaterChain = new EventConflaterChain(10, 10);
    this.natTableFixture = new NatTableFixture();
    this.conflater1 = new VisualChangeEventConflater(this.natTableFixture);
    this.conflater2 = new VisualChangeEventConflater(this.natTableFixture);
    this.conflaterChain.add(this.conflater1);
    this.conflaterChain.add(this.conflater2);
}
Also used : NatTableFixture(org.eclipse.nebula.widgets.nattable.test.fixture.NatTableFixture) EventConflaterChain(org.eclipse.nebula.widgets.nattable.conflation.EventConflaterChain) VisualChangeEventConflater(org.eclipse.nebula.widgets.nattable.conflation.VisualChangeEventConflater) Before(org.junit.Before)

Aggregations

EventConflaterChain (org.eclipse.nebula.widgets.nattable.conflation.EventConflaterChain)2 VisualChangeEventConflater (org.eclipse.nebula.widgets.nattable.conflation.VisualChangeEventConflater)2 NatTableFixture (org.eclipse.nebula.widgets.nattable.test.fixture.NatTableFixture)2 LayerEventFixture (org.eclipse.nebula.widgets.nattable.test.fixture.LayerEventFixture)1 Before (org.junit.Before)1 Test (org.junit.Test)1