use of org.eclipse.nebula.widgets.nattable.grid.data.DummyBodyDataProvider in project nebula.widgets.nattable by eclipse.
the class FreezeHandlerTest method setUp.
@Before
public void setUp() {
final DataLayer bodyDataLayer = new DataLayer(new DummyBodyDataProvider(10, 10));
final DefaultBodyLayerStack bodyLayer = new DefaultBodyLayerStack(bodyDataLayer);
this.selectionLayer = bodyLayer.getSelectionLayer();
this.freezeLayer = new FreezeLayer(this.selectionLayer);
this.compositeFreezeLayer = new CompositeFreezeLayer(this.freezeLayer, bodyLayer.getViewportLayer(), bodyLayer.getSelectionLayer());
this.viewportLayer = bodyLayer.getViewportLayer();
this.commandHandler = new FreezeCommandHandler(this.freezeLayer, this.viewportLayer, this.selectionLayer);
this.compositeFreezeLayer.registerCommandHandler(this.commandHandler);
this.compositeFreezeLayer.setClientAreaProvider(new IClientAreaProvider() {
@Override
public Rectangle getClientArea() {
return new Rectangle(0, 0, 600, 400);
}
});
// Shoot this command so that the viewport can be initialized
this.compositeFreezeLayer.doCommand(new ClientAreaResizeCommand(new Shell(Display.getDefault(), SWT.H_SCROLL | SWT.V_SCROLL)));
}
use of org.eclipse.nebula.widgets.nattable.grid.data.DummyBodyDataProvider in project nebula.widgets.nattable by eclipse.
the class RowSizeConfigurationCommandTest method setup.
@Before
public void setup() {
this.dataLayer = new DataLayer(new DummyBodyDataProvider(4, 4));
this.dataLayer.setConfigLabelAccumulator(new IConfigLabelAccumulator() {
@Override
public void accumulateConfigLabels(LabelStack configLabels, int columnPosition, int rowPosition) {
configLabels.addLabel("ROW_" + rowPosition);
}
});
}
use of org.eclipse.nebula.widgets.nattable.grid.data.DummyBodyDataProvider in project nebula.widgets.nattable by eclipse.
the class RowSizeResetCommandTest method setup.
@Before
public void setup() {
this.dataLayer = new DataLayer(new DummyBodyDataProvider(10, 10));
this.listener = new LayerListenerFixture();
this.dataLayer.addLayerListener(this.listener);
}
use of org.eclipse.nebula.widgets.nattable.grid.data.DummyBodyDataProvider in project nebula.widgets.nattable by eclipse.
the class CalculatedValueCacheTest method testCalculateInSameThreadWithRowKey.
@Test
public void testCalculateInSameThreadWithRowKey() throws Exception {
this.valueCache = new CalculatedValueCache(new DataLayer(new DummyBodyDataProvider(10, 10)), false, true);
Object result = this.valueCache.getCalculatedValue(0, 0, false, this.calculator);
assertEquals(Integer.valueOf(42), Integer.valueOf(result.toString()));
}
use of org.eclipse.nebula.widgets.nattable.grid.data.DummyBodyDataProvider in project nebula.widgets.nattable by eclipse.
the class CalculatedValueCacheTest method testCalculateInSameThreadWithColumnKey.
@Test
public void testCalculateInSameThreadWithColumnKey() throws Exception {
this.valueCache = new CalculatedValueCache(new DataLayer(new DummyBodyDataProvider(10, 10)), true, false);
Object result = this.valueCache.getCalculatedValue(0, 0, false, this.calculator);
assertEquals(Integer.valueOf(42), Integer.valueOf(result.toString()));
}
Aggregations