use of org.eclipse.nebula.widgets.nattable.grid.command.ClientAreaResizeCommand 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.grid.command.ClientAreaResizeCommand 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.grid.command.ClientAreaResizeCommand in project nebula.widgets.nattable by eclipse.
the class RowSizeConfigurationCommandTest method testSetPercentageValue.
@Test
public void testSetPercentageValue() {
assertEquals(20, this.dataLayer.getRowHeightByPosition(0));
assertEquals(20, this.dataLayer.getRowHeightByPosition(1));
assertEquals(20, this.dataLayer.getRowHeightByPosition(2));
assertEquals(20, this.dataLayer.getRowHeightByPosition(3));
this.dataLayer.doCommand(new RowSizeConfigurationCommand("ROW_0", 20, true));
this.dataLayer.doCommand(new RowSizeConfigurationCommand("ROW_1", 20, true));
this.dataLayer.doCommand(new RowSizeConfigurationCommand("ROW_2", 30, true));
this.dataLayer.doCommand(new RowSizeConfigurationCommand("ROW_3", 30, true));
// recalculate percentages
ClientAreaResizeCommand resizeCommand = new ClientAreaResizeCommand(null);
resizeCommand.setCalcArea(new Rectangle(0, 0, 1000, 1000));
this.dataLayer.doCommand(resizeCommand);
assertEquals(200, this.dataLayer.getRowHeightByPosition(0));
assertEquals(200, this.dataLayer.getRowHeightByPosition(1));
assertEquals(300, this.dataLayer.getRowHeightByPosition(2));
assertEquals(300, this.dataLayer.getRowHeightByPosition(3));
}
use of org.eclipse.nebula.widgets.nattable.grid.command.ClientAreaResizeCommand 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.grid.command.ClientAreaResizeCommand in project nebula.widgets.nattable by eclipse.
the class ColumnGroupsCommandHandlerTest method setUp.
@Before
public void setUp() {
this.gridLayer = new GridLayerFixture();
this.selectionLayer = (SelectionLayer) this.gridLayer.getBodyLayer().getViewportLayer().getScrollableLayer();
this.model = new ColumnGroupModel();
this.handler = new ColumnGroupsCommandHandler(this.model, this.selectionLayer, new ColumnGroupHeaderLayer(this.gridLayer.getColumnHeaderLayer(), this.gridLayer.getBodyLayer().getSelectionLayer(), new ColumnGroupModel()));
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)));
}
Aggregations