use of org.eclipse.nebula.widgets.nattable.util.IClientAreaProvider in project nebula.widgets.nattable by eclipse.
the class GridLayerTest method initBodyLayer.
// **** New tests using fixtures ****
/**
* @see ViewportLayerFixture#DEFAULT_CLIENT_AREA
*/
@Test
public void initBodyLayer() throws Exception {
DefaultGridLayer gridLayer = new GridLayerFixture();
ViewportLayer viewport = gridLayer.getBodyLayer().getViewportLayer();
viewport.setClientAreaProvider(new IClientAreaProvider() {
@Override
public Rectangle getClientArea() {
return new Rectangle(0, 0, 160, 80);
}
});
// Client area gets init when this command is fired
gridLayer.doCommand(new InitializeClientAreaCommandFixture());
Assert.assertEquals(160, viewport.getClientAreaWidth());
Assert.assertEquals(80, viewport.getClientAreaHeight());
Assert.assertEquals(160, viewport.getWidth());
Assert.assertEquals(80, viewport.getHeight());
}
use of org.eclipse.nebula.widgets.nattable.util.IClientAreaProvider in project nebula.widgets.nattable by eclipse.
the class CopyDataCommandHandlerTest method setUp.
@Before
public void setUp() {
final IDataProvider bodyDataProvider = new DataProviderFixture(10, 10);
this.gridLayer = new DefaultGridLayer(bodyDataProvider, getColumnHeaderDataProvider(bodyDataProvider), getRowHeaderDataProvider(bodyDataProvider));
this.gridLayer.setClientAreaProvider(new IClientAreaProvider() {
@Override
public Rectangle getClientArea() {
return new Rectangle(0, 0, 1050, 1050);
}
});
this.gridLayer.doCommand(new ClientAreaResizeCommand(new Shell(Display.getDefault(), SWT.V_SCROLL | SWT.H_SCROLL)));
this.rowHeaderLayer = this.gridLayer.getRowHeaderLayer();
this.columnHeaderLayer = this.gridLayer.getColumnHeaderLayer();
this.selectionLayer = this.gridLayer.getBodyLayer().getSelectionLayer();
this.commandHandler = new CopyDataCommandHandler(this.selectionLayer, this.columnHeaderLayer, this.rowHeaderLayer);
}
use of org.eclipse.nebula.widgets.nattable.util.IClientAreaProvider in project nebula.widgets.nattable by eclipse.
the class MultiRowResizeCommandTest method setClientAreaProvider.
private void setClientAreaProvider(ILayer layer) {
layer.setClientAreaProvider(new IClientAreaProvider() {
@Override
public Rectangle getClientArea() {
return new Rectangle(0, 0, 1050, 500);
}
});
layer.doCommand(new ClientAreaResizeCommand(new Shell(Display.getDefault(), SWT.V_SCROLL | SWT.H_SCROLL)));
}
use of org.eclipse.nebula.widgets.nattable.util.IClientAreaProvider in project nebula.widgets.nattable by eclipse.
the class GridSearchStrategyTest method setUp.
@Before
public void setUp() {
this.gridLayer = new DefaultGridLayer(getBodyDataProvider(), GridLayerFixture.colHeaderDataProvider);
this.selectionLayer = this.gridLayer.getBodyLayer().getSelectionLayer();
this.gridLayer.setClientAreaProvider(new IClientAreaProvider() {
@Override
public Rectangle getClientArea() {
return new Rectangle(0, 0, 1050, 250);
}
});
this.gridLayer.doCommand(new ClientAreaResizeCommand(new Shell(Display.getDefault(), SWT.V_SCROLL | SWT.H_SCROLL)));
this.configRegistry = new ConfigRegistry();
new DefaultNatTableStyleConfiguration().configureRegistry(this.configRegistry);
}
use of org.eclipse.nebula.widgets.nattable.util.IClientAreaProvider in project nebula.widgets.nattable by eclipse.
the class CompositeLayerTest method setup.
@Before
public void setup() {
this.layerFixture = new CompositeLayerFixture();
this.layerFixture.bodyLayer.setClientAreaProvider(new IClientAreaProvider() {
@Override
public Rectangle getClientArea() {
return new Rectangle(0, 0, 160, 100);
}
});
}
Aggregations