use of org.eclipse.nebula.widgets.nattable.copy.command.CopyDataToClipboardCommand in project nebula.widgets.nattable by eclipse.
the class FillHandlePasteTest method testSingleCellDragMultiUp.
@Test
public void testSingleCellDragMultiUp() {
this.dataProvider.setDataValue(4, 4, "Simpson");
this.selectionLayer.setSelectedCell(4, 4);
testCellStates(new Point(4, 4));
this.natTable.doCommand(new CopyDataToClipboardCommand(// $NON-NLS-1$
"\t", // $NON-NLS-1$
System.getProperty("line.separator"), this.natTable.getConfigRegistry()));
this.selectionLayer.setFillHandleRegion(new Rectangle(4, 0, 1, 5));
this.natTable.doCommand(new FillHandlePasteCommand(FillHandleOperation.COPY, MoveDirectionEnum.UP, this.natTable.getConfigRegistry()));
assertEquals("Simpson", this.selectionLayer.getDataValueByPosition(4, 0));
assertEquals("Simpson", this.selectionLayer.getDataValueByPosition(4, 1));
assertEquals("Simpson", this.selectionLayer.getDataValueByPosition(4, 2));
assertEquals("Simpson", this.selectionLayer.getDataValueByPosition(4, 3));
testCellStates(new Point(4, 4), new Point(4, 0), new Point(4, 1), new Point(4, 2), new Point(4, 3));
}
use of org.eclipse.nebula.widgets.nattable.copy.command.CopyDataToClipboardCommand in project nebula.widgets.nattable by eclipse.
the class FillHandlePasteTest method testMultiVerticalCellDragRight.
@Test
public void testMultiVerticalCellDragRight() {
this.dataProvider.setDataValue(4, 4, "Simpson");
this.dataProvider.setDataValue(4, 5, "Flanders");
this.selectionLayer.selectCell(4, 4, false, true);
this.selectionLayer.selectCell(4, 5, false, true);
testCellStates(new Point(4, 4), new Point(4, 5));
this.natTable.doCommand(new CopyDataToClipboardCommand(// $NON-NLS-1$
"\t", // $NON-NLS-1$
System.getProperty("line.separator"), this.natTable.getConfigRegistry()));
this.selectionLayer.setFillHandleRegion(new Rectangle(4, 4, 3, 2));
this.natTable.doCommand(new FillHandlePasteCommand(FillHandleOperation.COPY, MoveDirectionEnum.RIGHT, this.natTable.getConfigRegistry()));
assertEquals("Simpson", this.selectionLayer.getDataValueByPosition(4, 4));
assertEquals("Flanders", this.selectionLayer.getDataValueByPosition(4, 5));
assertEquals("Simpson", this.selectionLayer.getDataValueByPosition(5, 4));
assertEquals("Flanders", this.selectionLayer.getDataValueByPosition(5, 5));
assertEquals("Simpson", this.selectionLayer.getDataValueByPosition(6, 4));
assertEquals("Flanders", this.selectionLayer.getDataValueByPosition(6, 5));
testCellStates(new Point(4, 4), new Point(4, 5), new Point(5, 4), new Point(5, 5), new Point(6, 4), new Point(6, 5));
}
use of org.eclipse.nebula.widgets.nattable.copy.command.CopyDataToClipboardCommand in project nebula.widgets.nattable by eclipse.
the class FillHandlePasteTest method testSingleCellDragMultipleDown.
@Test
public void testSingleCellDragMultipleDown() {
this.dataProvider.setDataValue(4, 4, "Simpson");
this.selectionLayer.setSelectedCell(4, 4);
testCellStates(new Point(4, 4));
this.natTable.doCommand(new CopyDataToClipboardCommand(// $NON-NLS-1$
"\t", // $NON-NLS-1$
System.getProperty("line.separator"), this.natTable.getConfigRegistry()));
this.selectionLayer.setFillHandleRegion(new Rectangle(4, 4, 1, 4));
this.natTable.doCommand(new FillHandlePasteCommand(FillHandleOperation.COPY, MoveDirectionEnum.DOWN, this.natTable.getConfigRegistry()));
assertEquals("Simpson", this.selectionLayer.getDataValueByPosition(4, 5));
assertEquals("Simpson", this.selectionLayer.getDataValueByPosition(4, 6));
assertEquals("Simpson", this.selectionLayer.getDataValueByPosition(4, 7));
testCellStates(new Point(4, 4), new Point(4, 5), new Point(4, 6), new Point(4, 7));
}
use of org.eclipse.nebula.widgets.nattable.copy.command.CopyDataToClipboardCommand in project nebula.widgets.nattable by eclipse.
the class FillHandlePasteTest method testSingleCellDragOneRight.
@Test
public void testSingleCellDragOneRight() {
this.dataProvider.setDataValue(4, 4, "Simpson");
this.selectionLayer.setSelectedCell(4, 4);
testCellStates(new Point(4, 4));
this.natTable.doCommand(new CopyDataToClipboardCommand(// $NON-NLS-1$
"\t", // $NON-NLS-1$
System.getProperty("line.separator"), this.natTable.getConfigRegistry()));
this.selectionLayer.setFillHandleRegion(new Rectangle(4, 4, 2, 1));
this.natTable.doCommand(new FillHandlePasteCommand(FillHandleOperation.COPY, MoveDirectionEnum.RIGHT, this.natTable.getConfigRegistry()));
assertEquals("Simpson", this.selectionLayer.getDataValueByPosition(5, 4));
testCellStates(new Point(4, 4), new Point(5, 4));
}
use of org.eclipse.nebula.widgets.nattable.copy.command.CopyDataToClipboardCommand in project nebula.widgets.nattable by eclipse.
the class FillHandlePasteTest method testMultiVerticalCellDragUp.
@Test
public void testMultiVerticalCellDragUp() {
this.dataProvider.setDataValue(4, 4, "Simpson");
this.dataProvider.setDataValue(4, 5, "Flanders");
this.selectionLayer.selectCell(4, 4, false, true);
this.selectionLayer.selectCell(4, 5, false, true);
testCellStates(new Point(4, 4), new Point(4, 5));
this.natTable.doCommand(new CopyDataToClipboardCommand(// $NON-NLS-1$
"\t", // $NON-NLS-1$
System.getProperty("line.separator"), this.natTable.getConfigRegistry()));
this.selectionLayer.setFillHandleRegion(new Rectangle(4, 1, 1, 5));
this.natTable.doCommand(new FillHandlePasteCommand(FillHandleOperation.COPY, MoveDirectionEnum.UP, this.natTable.getConfigRegistry()));
assertEquals("Flanders", this.selectionLayer.getDataValueByPosition(4, 1));
assertEquals("Simpson", this.selectionLayer.getDataValueByPosition(4, 2));
assertEquals("Flanders", this.selectionLayer.getDataValueByPosition(4, 3));
assertEquals("Simpson", this.selectionLayer.getDataValueByPosition(4, 4));
assertEquals("Flanders", this.selectionLayer.getDataValueByPosition(4, 5));
testCellStates(new Point(4, 1), new Point(4, 2), new Point(4, 3), new Point(4, 4), new Point(4, 5));
}
Aggregations