use of org.eclipse.nebula.widgets.nattable.reorder.command.ColumnReorderCommand in project nebula.widgets.nattable by eclipse.
the class HierarchicalTreeLayerTest method testReorderInLevelWithoutLevelHeader.
@Test
public void testReorderInLevelWithoutLevelHeader() {
this.treeLayer.setShowTreeLevelHeader(false);
this.treeLayer.doCommand(new ColumnReorderCommand(this.treeLayer, 0, 2));
assertEquals(1, this.treeLayer.getColumnIndexByPosition(0));
assertEquals(0, this.treeLayer.getColumnIndexByPosition(1));
}
use of org.eclipse.nebula.widgets.nattable.reorder.command.ColumnReorderCommand in project nebula.widgets.nattable by eclipse.
the class HierarchicalTreeLayerTest method testLevelHeaderCanNotBeReordered.
@Test
public void testLevelHeaderCanNotBeReordered() {
this.treeLayer.doCommand(new ColumnReorderCommand(this.treeLayer, 0, 2));
assertEquals(-1, this.treeLayer.getColumnIndexByPosition(0));
assertEquals(0, this.treeLayer.getColumnIndexByPosition(1));
assertEquals(1, this.treeLayer.getColumnIndexByPosition(2));
assertEquals(-1, this.treeLayer.getColumnIndexByPosition(3));
}
use of org.eclipse.nebula.widgets.nattable.reorder.command.ColumnReorderCommand in project nebula.widgets.nattable by eclipse.
the class HierarchicalTreeLayerTest method testNoReorderBetweenLevelsWithoutLevelHeader.
@Test
public void testNoReorderBetweenLevelsWithoutLevelHeader() {
this.treeLayer.setShowTreeLevelHeader(false);
this.treeLayer.doCommand(new ColumnReorderCommand(this.treeLayer, 1, 3));
// nothing should have changed because that reorder is not allowed
assertEquals(0, this.treeLayer.getColumnIndexByPosition(0));
assertEquals(1, this.treeLayer.getColumnIndexByPosition(1));
}
use of org.eclipse.nebula.widgets.nattable.reorder.command.ColumnReorderCommand in project nebula.widgets.nattable by eclipse.
the class HierarchicalTreeLayerTest method testNoReorderBetweenLevels.
@Test
public void testNoReorderBetweenLevels() {
this.treeLayer.doCommand(new ColumnReorderCommand(this.treeLayer, 2, 5));
// nothing should have changed because that reorder is not allowed
assertEquals(0, this.treeLayer.getColumnIndexByPosition(1));
assertEquals(1, this.treeLayer.getColumnIndexByPosition(2));
}
use of org.eclipse.nebula.widgets.nattable.reorder.command.ColumnReorderCommand in project nebula.widgets.nattable by eclipse.
the class FreezeLayerTest method testReorderingRightBottomCornerOutOfFrozenArea.
@Test
public void testReorderingRightBottomCornerOutOfFrozenArea() {
this.hideShowLayer.doCommand(new ColumnReorderCommand(this.hideShowLayer, 3, 5));
Assert.assertEquals(2, this.freezeLayer.getColumnCount());
Assert.assertEquals(2, this.freezeLayer.getBottomRightPosition().columnPosition);
Assert.assertEquals(1, this.freezeLayer.getColumnIndexByPosition(0));
Assert.assertEquals(2, this.freezeLayer.getColumnIndexByPosition(1));
}
Aggregations