use of org.eclipse.nebula.widgets.nattable.copy.command.CopyDataToClipboardCommand in project nebula.widgets.nattable by eclipse.
the class FillHandleSeriesTest method testLongNullCellValueDragDown.
@Test
public void testLongNullCellValueDragDown() {
this.dataProvider.setDataValue(4, 4, Long.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(Long.valueOf("1"), this.selectionLayer.getDataValueByPosition(4, 4));
assertNull(this.selectionLayer.getDataValueByPosition(4, 5));
assertEquals(Long.valueOf("1"), this.selectionLayer.getDataValueByPosition(4, 6));
assertNull(this.selectionLayer.getDataValueByPosition(4, 7));
assertEquals(Long.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 testMultiCellSameDiffDateValueDragDown.
@SuppressWarnings("deprecation")
@Test
public void testMultiCellSameDiffDateValueDragDown() {
this.dataProvider.setDataValue(4, 4, new Date(2015, 9, 2));
this.dataProvider.setDataValue(4, 5, new Date(2015, 9, 5));
this.dataProvider.setDataValue(4, 6, new Date(2015, 9, 8));
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(new Date(2015, 9, 2), this.selectionLayer.getDataValueByPosition(4, 4));
assertEquals(new Date(2015, 9, 5), this.selectionLayer.getDataValueByPosition(4, 5));
assertEquals(new Date(2015, 9, 8), this.selectionLayer.getDataValueByPosition(4, 6));
assertEquals(new Date(2015, 9, 11), this.selectionLayer.getDataValueByPosition(4, 7));
assertEquals(new Date(2015, 9, 14), this.selectionLayer.getDataValueByPosition(4, 8));
assertEquals(new Date(2015, 9, 17), 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 testSingleCellIntegerValueDragDown.
@Test
public void testSingleCellIntegerValueDragDown() {
this.dataProvider.setDataValue(4, 4, Integer.valueOf("1"));
this.selectionLayer.setSelectedCell(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.SERIES, MoveDirectionEnum.DOWN, this.natTable.getConfigRegistry()));
assertEquals(Integer.valueOf("1"), this.selectionLayer.getDataValueByPosition(4, 4));
assertEquals(Integer.valueOf("2"), this.selectionLayer.getDataValueByPosition(4, 5));
assertEquals(Integer.valueOf("3"), this.selectionLayer.getDataValueByPosition(4, 6));
assertEquals(Integer.valueOf("4"), this.selectionLayer.getDataValueByPosition(4, 7));
}
use of org.eclipse.nebula.widgets.nattable.copy.command.CopyDataToClipboardCommand in project nebula.widgets.nattable by eclipse.
the class FillHandleSeriesTest method testSingleCellBigDecimalValueDragDown.
@Test
public void testSingleCellBigDecimalValueDragDown() {
this.dataProvider.setDataValue(4, 4, BigDecimal.valueOf(13.8d));
this.selectionLayer.setSelectedCell(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.SERIES, MoveDirectionEnum.DOWN, this.natTable.getConfigRegistry()));
assertEquals(BigDecimal.valueOf(13.8d), this.selectionLayer.getDataValueByPosition(4, 4));
assertEquals(BigDecimal.valueOf(14.8d), this.selectionLayer.getDataValueByPosition(4, 5));
assertEquals(BigDecimal.valueOf(15.8d), this.selectionLayer.getDataValueByPosition(4, 6));
assertEquals(BigDecimal.valueOf(16.8d), this.selectionLayer.getDataValueByPosition(4, 7));
}
use of org.eclipse.nebula.widgets.nattable.copy.command.CopyDataToClipboardCommand in project nebula.widgets.nattable by eclipse.
the class FillHandleSeriesTest method testSingleCellDateValueDragUp.
@SuppressWarnings("deprecation")
@Test
public void testSingleCellDateValueDragUp() {
this.dataProvider.setDataValue(4, 4, new Date(2015, 9, 2));
this.selectionLayer.setSelectedCell(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, 1, 1, 4));
this.natTable.doCommand(new FillHandlePasteCommand(FillHandleOperation.SERIES, MoveDirectionEnum.UP, this.natTable.getConfigRegistry()));
assertEquals(new Date(2015, 8, 29), this.selectionLayer.getDataValueByPosition(4, 1));
assertEquals(new Date(2015, 8, 30), this.selectionLayer.getDataValueByPosition(4, 2));
assertEquals(new Date(2015, 9, 1), this.selectionLayer.getDataValueByPosition(4, 3));
assertEquals(new Date(2015, 9, 2), this.selectionLayer.getDataValueByPosition(4, 4));
}
Aggregations