use of org.eclipse.nebula.widgets.nattable.test.fixture.data.DataProviderFixture in project nebula.widgets.nattable by eclipse.
the class SelectionUtilsTest method testGetBottomRightSelectRegionDeselectTopEdge.
@Test
public void testGetBottomRightSelectRegionDeselectTopEdge() {
DataLayer dataLayer = new DataLayer(new DataProviderFixture(10, 10));
SelectionLayer selectionLayer = new SelectionLayer(dataLayer);
// select region
selectionLayer.selectRegion(2, 2, 3, 3);
// deselect a cell
selectionLayer.clearSelection(2, 2);
ILayerCell bottomRight = SelectionUtils.getBottomRightCellInSelection(selectionLayer);
assertNull(bottomRight);
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.data.DataProviderFixture 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.test.fixture.data.DataProviderFixture in project nebula.widgets.nattable by eclipse.
the class SelectionUtilsTest method testGetBottomRightSelectNothing.
@Test
public void testGetBottomRightSelectNothing() {
DataLayer dataLayer = new DataLayer(new DataProviderFixture(10, 10));
SelectionLayer selectionLayer = new SelectionLayer(dataLayer);
ILayerCell bottomRight = SelectionUtils.getBottomRightCellInSelection(selectionLayer);
assertNull(bottomRight);
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.data.DataProviderFixture in project nebula.widgets.nattable by eclipse.
the class SelectionUtilsTest method testGetBottomRightSelectOne.
@Test
public void testGetBottomRightSelectOne() {
DataLayer dataLayer = new DataLayer(new DataProviderFixture(10, 10));
SelectionLayer selectionLayer = new SelectionLayer(dataLayer);
// select one cell
selectionLayer.selectCell(5, 5, false, false);
ILayerCell bottomRight = SelectionUtils.getBottomRightCellInSelection(selectionLayer);
assertEquals(5, bottomRight.getColumnPosition());
assertEquals(5, bottomRight.getRowPosition());
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.data.DataProviderFixture in project nebula.widgets.nattable by eclipse.
the class SelectionUtilsTest method testGetBottomRightSelectAll.
@Test
public void testGetBottomRightSelectAll() {
DataLayer dataLayer = new DataLayer(new DataProviderFixture(10, 10));
SelectionLayer selectionLayer = new SelectionLayer(dataLayer);
// select all cells
selectionLayer.selectAll();
ILayerCell bottomRight = SelectionUtils.getBottomRightCellInSelection(selectionLayer);
assertEquals(9, bottomRight.getColumnPosition());
assertEquals(9, bottomRight.getRowPosition());
}
Aggregations