use of org.eclipse.nebula.widgets.nattable.copy.command.CopyDataToClipboardCommand in project nebula.widgets.nattable by eclipse.
the class FillHandleSeriesTest method testMultiCellSameDiffBigIntegerValueDragDown.
@Test
public void testMultiCellSameDiffBigIntegerValueDragDown() {
this.dataProvider.setDataValue(4, 4, BigInteger.valueOf(1));
this.dataProvider.setDataValue(4, 5, BigInteger.valueOf(3));
this.dataProvider.setDataValue(4, 6, BigInteger.valueOf(5));
this.selectionLayer.selectCell(4, 4, false, true);
this.selectionLayer.selectCell(4, 5, false, true);
this.selectionLayer.selectCell(4, 6, false, true);
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, 6));
this.natTable.doCommand(new FillHandlePasteCommand(FillHandleOperation.SERIES, MoveDirectionEnum.DOWN, this.natTable.getConfigRegistry()));
assertEquals(BigInteger.valueOf(1), this.selectionLayer.getDataValueByPosition(4, 4));
assertEquals(BigInteger.valueOf(3), this.selectionLayer.getDataValueByPosition(4, 5));
assertEquals(BigInteger.valueOf(5), this.selectionLayer.getDataValueByPosition(4, 6));
assertEquals(BigInteger.valueOf(7), this.selectionLayer.getDataValueByPosition(4, 7));
assertEquals(BigInteger.valueOf(9), this.selectionLayer.getDataValueByPosition(4, 8));
assertEquals(BigInteger.valueOf(11), this.selectionLayer.getDataValueByPosition(4, 9));
}
use of org.eclipse.nebula.widgets.nattable.copy.command.CopyDataToClipboardCommand in project nebula.widgets.nattable by eclipse.
the class FillHandleSeriesTest method testShortNullCellValueDragDown.
@Test
public void testShortNullCellValueDragDown() {
this.dataProvider.setDataValue(4, 4, Short.valueOf("1"));
this.selectionLayer.selectCell(4, 4, false, true);
this.selectionLayer.selectCell(4, 5, false, true);
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, 6));
this.natTable.doCommand(new FillHandlePasteCommand(FillHandleOperation.SERIES, MoveDirectionEnum.DOWN, this.natTable.getConfigRegistry()));
assertEquals(Short.valueOf("1"), this.selectionLayer.getDataValueByPosition(4, 4));
assertNull(this.selectionLayer.getDataValueByPosition(4, 5));
assertEquals(Short.valueOf("1"), this.selectionLayer.getDataValueByPosition(4, 6));
assertNull(this.selectionLayer.getDataValueByPosition(4, 7));
assertEquals(Short.valueOf("1"), this.selectionLayer.getDataValueByPosition(4, 8));
assertNull(this.selectionLayer.getDataValueByPosition(4, 9));
}
use of org.eclipse.nebula.widgets.nattable.copy.command.CopyDataToClipboardCommand in project nebula.widgets.nattable by eclipse.
the class FillHandleSeriesTest method testMultiCellSameDiffByteValueDragRight.
@Test
public void testMultiCellSameDiffByteValueDragRight() {
this.dataProvider.setDataValue(4, 4, Byte.valueOf("1"));
this.dataProvider.setDataValue(5, 4, Byte.valueOf("3"));
this.dataProvider.setDataValue(6, 4, Byte.valueOf("5"));
this.selectionLayer.selectCell(4, 4, false, true);
this.selectionLayer.selectCell(5, 4, false, true);
this.selectionLayer.selectCell(6, 4, false, true);
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, 6, 1));
this.natTable.doCommand(new FillHandlePasteCommand(FillHandleOperation.SERIES, MoveDirectionEnum.RIGHT, this.natTable.getConfigRegistry()));
assertEquals(Byte.valueOf("1"), this.selectionLayer.getDataValueByPosition(4, 4));
assertEquals(Byte.valueOf("3"), this.selectionLayer.getDataValueByPosition(5, 4));
assertEquals(Byte.valueOf("5"), this.selectionLayer.getDataValueByPosition(6, 4));
assertEquals(Byte.valueOf("7"), this.selectionLayer.getDataValueByPosition(7, 4));
assertEquals(Byte.valueOf("9"), this.selectionLayer.getDataValueByPosition(8, 4));
assertEquals(Byte.valueOf("11"), this.selectionLayer.getDataValueByPosition(9, 4));
}
use of org.eclipse.nebula.widgets.nattable.copy.command.CopyDataToClipboardCommand in project nebula.widgets.nattable by eclipse.
the class FillHandleSeriesTest method testMultiCellSameDiffShortValueDragDown.
@Test
public void testMultiCellSameDiffShortValueDragDown() {
this.dataProvider.setDataValue(4, 4, Short.valueOf("1"));
this.dataProvider.setDataValue(4, 5, Short.valueOf("3"));
this.dataProvider.setDataValue(4, 6, Short.valueOf("5"));
this.selectionLayer.selectCell(4, 4, false, true);
this.selectionLayer.selectCell(4, 5, false, true);
this.selectionLayer.selectCell(4, 6, false, true);
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, 6));
this.natTable.doCommand(new FillHandlePasteCommand(FillHandleOperation.SERIES, MoveDirectionEnum.DOWN, this.natTable.getConfigRegistry()));
assertEquals(Short.valueOf("1"), this.selectionLayer.getDataValueByPosition(4, 4));
assertEquals(Short.valueOf("3"), this.selectionLayer.getDataValueByPosition(4, 5));
assertEquals(Short.valueOf("5"), this.selectionLayer.getDataValueByPosition(4, 6));
assertEquals(Short.valueOf("7"), this.selectionLayer.getDataValueByPosition(4, 7));
assertEquals(Short.valueOf("9"), this.selectionLayer.getDataValueByPosition(4, 8));
assertEquals(Short.valueOf("11"), this.selectionLayer.getDataValueByPosition(4, 9));
}
use of org.eclipse.nebula.widgets.nattable.copy.command.CopyDataToClipboardCommand in project nebula.widgets.nattable by eclipse.
the class FillHandleSeriesTest method testMultiCellSameDiffByteValueDragDown.
@Test
public void testMultiCellSameDiffByteValueDragDown() {
this.dataProvider.setDataValue(4, 4, Byte.valueOf("1"));
this.dataProvider.setDataValue(4, 5, Byte.valueOf("3"));
this.dataProvider.setDataValue(4, 6, Byte.valueOf("5"));
this.selectionLayer.selectCell(4, 4, false, true);
this.selectionLayer.selectCell(4, 5, false, true);
this.selectionLayer.selectCell(4, 6, false, true);
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, 6));
this.natTable.doCommand(new FillHandlePasteCommand(FillHandleOperation.SERIES, MoveDirectionEnum.DOWN, this.natTable.getConfigRegistry()));
assertEquals(Byte.valueOf("1"), this.selectionLayer.getDataValueByPosition(4, 4));
assertEquals(Byte.valueOf("3"), this.selectionLayer.getDataValueByPosition(4, 5));
assertEquals(Byte.valueOf("5"), this.selectionLayer.getDataValueByPosition(4, 6));
assertEquals(Byte.valueOf("7"), this.selectionLayer.getDataValueByPosition(4, 7));
assertEquals(Byte.valueOf("9"), this.selectionLayer.getDataValueByPosition(4, 8));
assertEquals(Byte.valueOf("11"), this.selectionLayer.getDataValueByPosition(4, 9));
}
Aggregations