use of org.eclipse.nebula.widgets.nattable.reorder.command.ColumnReorderCommand in project nebula.widgets.nattable by eclipse.
the class ColumnGroupReorderLayerTest method shouldNotMoveColumnBetweenGroupsIfEitherGroupIsUnbreakable.
@Test
public void shouldNotMoveColumnBetweenGroupsIfEitherGroupIsUnbreakable() {
setGroupUnBreakable(3);
ColumnReorderCommand command = new ColumnReorderCommand(this.layer, 3, 1);
this.layer.doCommand(command);
this.modelFixture.assertUnchanged();
}
use of org.eclipse.nebula.widgets.nattable.reorder.command.ColumnReorderCommand in project nebula.widgets.nattable by eclipse.
the class ColumnGroupReorderLayerTest method shouldDragLeftAndRemoveColumnFromGroup.
@Test
public void shouldDragLeftAndRemoveColumnFromGroup() {
// Drag left out of group
ColumnReorderCommand command = new ColumnReorderCommand(this.layer, 3, 2);
this.layer.doCommand(command);
assertNull(this.modelFixture.getColumnGroupByIndex(3));
assertNull(this.modelFixture.getColumnGroupByIndex(2));
assertEquals(1, getColumnIndexesInGroup(4).size());
}
use of org.eclipse.nebula.widgets.nattable.reorder.command.ColumnReorderCommand in project nebula.widgets.nattable by eclipse.
the class ColumnGroupReorderLayerTest method shouldDragRightAndAddColumnToGroup.
@Test
public void shouldDragRightAndAddColumnToGroup() {
final int fromColumnIndex = 2;
final int toColumnIndex = 4;
// Drag right into group
ColumnReorderCommand command = new ColumnReorderCommand(this.layer, fromColumnIndex, toColumnIndex);
this.layer.doCommand(command);
assertEquals(ColumnGroupModelFixture.TEST_GROUP_2, this.modelFixture.getColumnGroupByIndex(fromColumnIndex).getName());
assertEquals(ColumnGroupModelFixture.TEST_GROUP_2, this.modelFixture.getColumnGroupByIndex(toColumnIndex).getName());
assertEquals(ColumnGroupModelFixture.TEST_GROUP_2, this.modelFixture.getColumnGroupByIndex(4).getName());
assertEquals(3, getColumnIndexesInGroup(fromColumnIndex).size());
}
use of org.eclipse.nebula.widgets.nattable.reorder.command.ColumnReorderCommand in project nebula.widgets.nattable by eclipse.
the class ColumnGroupReorderLayerTest method shouldDragRightAndKeepColumnInGroup.
@Test
public void shouldDragRightAndKeepColumnInGroup() {
// Index in CG: 0,1
// Drag 0 -> 1
assertEquals(2, getColumnIndexesInGroup(0).size());
// Drag right out of group
ColumnReorderCommand command = new ColumnReorderCommand(this.layer, 0, 2);
this.layer.doCommand(command);
assertEquals(2, getColumnIndexesInGroup(1).size());
assertNotNull(this.modelFixture.getColumnGroupByIndex(0));
assertEquals(ColumnGroupModelFixture.TEST_GROUP_1, this.modelFixture.getColumnGroupByIndex(1).getName());
}
use of org.eclipse.nebula.widgets.nattable.reorder.command.ColumnReorderCommand in project nebula.widgets.nattable by eclipse.
the class ColumnGroupReorderLayerTest method shouldReorderEntireColumnGroupAndAddAColumnToCollapsedGroup.
@Test
public void shouldReorderEntireColumnGroupAndAddAColumnToCollapsedGroup() {
collapse(3);
this.layer.reorderColumnGroup(3, 13);
assertEquals(3, this.reorderLayer.getColumnIndexByPosition(11));
assertEquals(4, this.reorderLayer.getColumnIndexByPosition(12));
this.layer.doCommand(new ColumnReorderCommand(this.layer, 16, 12));
assertEquals(3, getColumnIndexesInGroup(3).size());
}
Aggregations