use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.BaseDataLayerFixture in project nebula.widgets.nattable by eclipse.
the class FreezeLayerTest method setup.
@Before
public void setup() {
this.reorderLayer = new ColumnReorderLayer(new BaseDataLayerFixture(10, 10));
this.hideShowLayer = new ColumnHideShowLayer(this.reorderLayer);
this.freezeLayer = new FreezeLayer(this.hideShowLayer);
this.freezeLayer.setTopLeftPosition(1, 0);
this.freezeLayer.setBottomRightPosition(3, 3);
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.BaseDataLayerFixture in project nebula.widgets.nattable by eclipse.
the class ColumnGroupReorderLayerTest method setUp.
@Before
public void setUp() {
this.modelFixture = new ColumnGroupModelFixture();
this.reorderLayer = new ColumnReorderLayer(new BaseDataLayerFixture(24, 20));
this.layer = new ColumnGroupReorderLayer(this.reorderLayer, this.modelFixture);
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.BaseDataLayerFixture in project nebula.widgets.nattable by eclipse.
the class ColumnReorderLayerVisibleChangeTest method returnsCorrectPositionRectangleForMultiColumnReorderLeftCase.
@SuppressWarnings("boxing")
@Test
public /**
* Index 10 11 12 13 ... 20
* --------------------
* Position 0 1 2 3 ... 20
*/
void returnsCorrectPositionRectangleForMultiColumnReorderLeftCase() {
ColumnReorderLayer reorderLayer = new ColumnReorderLayer(new BaseDataLayerFixture(20, 20));
// Build expected cell positions to redraw
final Set<Rectangle> expectedPositions = new HashSet<Rectangle>();
expectedPositions.add(new Rectangle(0, 0, 20, 20));
reorderLayer.addLayerListener(new ILayerListener() {
@Override
public void handleLayerEvent(ILayerEvent event) {
ColumnReorderEvent multiReorder = (ColumnReorderEvent) event;
assertTrue(multiReorder.getChangedPositionRectangles().containsAll(expectedPositions));
}
});
// Reorder to beginning of grid
List<Integer> fromColumnPositions = Arrays.asList(new Integer[] { 10, 11, 12, 13 });
reorderLayer.reorderMultipleColumnPositions(fromColumnPositions, 0);
// Reorder to middle of grid
expectedPositions.clear();
expectedPositions.add(new Rectangle(10, 0, 10, 20));
fromColumnPositions = Arrays.asList(new Integer[] { 19, 18, 17, 16 });
reorderLayer.reorderMultipleColumnPositions(fromColumnPositions, 10);
// Reorder to end of grid
expectedPositions.clear();
expectedPositions.add(new Rectangle(5, 0, 15, 20));
fromColumnPositions = Arrays.asList(new Integer[] { 5, 6, 7, 8 });
reorderLayer.reorderMultipleColumnPositions(fromColumnPositions, 10);
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.BaseDataLayerFixture in project nebula.widgets.nattable by eclipse.
the class ColumnReorderLayerVisibleChangeTest method returnsCorrectPositionRectangleForMultiColumnReorderRightCase.
@SuppressWarnings("boxing")
@Test
public /**
* Index 2 3 0 1 ... 20
* --------------------
* Position 0 1 2 3 ... 20
*/
void returnsCorrectPositionRectangleForMultiColumnReorderRightCase() {
ColumnReorderLayer reorderLayer = new ColumnReorderLayer(new BaseDataLayerFixture(20, 20));
// Build expected cell positions to redraw
final Set<Rectangle> expectedPositions = new HashSet<Rectangle>();
expectedPositions.add(new Rectangle(0, 0, 20, 20));
reorderLayer.addLayerListener(new ILayerListener() {
@Override
public void handleLayerEvent(ILayerEvent event) {
ColumnReorderEvent multiReorder = (ColumnReorderEvent) event;
assertTrue(multiReorder.getChangedPositionRectangles().containsAll(expectedPositions));
}
});
// Reorder from beginning of grid
List<Integer> fromColumnPositions = Arrays.asList(new Integer[] { 0, 1 });
reorderLayer.reorderMultipleColumnPositions(fromColumnPositions, 2);
// Reorder to middle of grid
expectedPositions.clear();
expectedPositions.add(new Rectangle(5, 0, 15, 20));
fromColumnPositions = Arrays.asList(new Integer[] { 5, 6, 7, 8 });
reorderLayer.reorderMultipleColumnPositions(fromColumnPositions, 10);
// Reorder to end of grid
expectedPositions.clear();
expectedPositions.add(new Rectangle(10, 0, 10, 20));
fromColumnPositions = Arrays.asList(new Integer[] { 10, 11, 12, 13 });
reorderLayer.reorderMultipleColumnPositions(fromColumnPositions, 19);
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.BaseDataLayerFixture in project nebula.widgets.nattable by eclipse.
the class RowReorderLayerTest method setUp.
@Before
public void setUp() {
this.underlyingLayer = new BaseDataLayerFixture(4, 4);
this.rowReorderLayer = new RowReorderLayer(this.underlyingLayer);
}
Aggregations