use of org.eclipse.nebula.widgets.nattable.copy.command.CopyDataToClipboardCommand in project nebula.widgets.nattable by eclipse.
the class FillHandleSeriesTest method testMultiCellSameDiffDoubleValueDragDown.
@Test
public void testMultiCellSameDiffDoubleValueDragDown() {
this.dataProvider.setDataValue(4, 4, Double.valueOf("1.3"));
this.dataProvider.setDataValue(4, 5, Double.valueOf("2.6"));
this.dataProvider.setDataValue(4, 6, Double.valueOf("3.9"));
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(Double.valueOf("1.3"), this.selectionLayer.getDataValueByPosition(4, 4));
assertEquals(Double.valueOf("2.6"), this.selectionLayer.getDataValueByPosition(4, 5));
assertEquals(Double.valueOf("3.9"), this.selectionLayer.getDataValueByPosition(4, 6));
assertEquals(Double.valueOf("5.2"), this.selectionLayer.getDataValueByPosition(4, 7));
assertEquals(Double.valueOf("6.5"), this.selectionLayer.getDataValueByPosition(4, 8));
assertEquals(Double.valueOf("7.8"), 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 testBigDecimalNullCellValueDragDown.
@Test
public void testBigDecimalNullCellValueDragDown() {
this.dataProvider.setDataValue(4, 4, BigDecimal.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(BigDecimal.valueOf(1), this.selectionLayer.getDataValueByPosition(4, 4));
assertNull(this.selectionLayer.getDataValueByPosition(4, 5));
assertEquals(BigDecimal.valueOf(1), this.selectionLayer.getDataValueByPosition(4, 6));
assertNull(this.selectionLayer.getDataValueByPosition(4, 7));
assertEquals(BigDecimal.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 testSingleCellDoubleValueDragDown.
@Test
public void testSingleCellDoubleValueDragDown() {
this.dataProvider.setDataValue(4, 4, Double.valueOf("1.6"));
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(Double.valueOf("1.6"), this.selectionLayer.getDataValueByPosition(4, 4));
assertEquals(Double.valueOf("2.6"), this.selectionLayer.getDataValueByPosition(4, 5));
assertEquals(Double.valueOf("3.6"), this.selectionLayer.getDataValueByPosition(4, 6));
assertEquals(Double.valueOf("4.6"), 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 testDoubleNullCellValueDragDown.
@Test
public void testDoubleNullCellValueDragDown() {
this.dataProvider.setDataValue(4, 4, Double.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(Double.valueOf("1"), this.selectionLayer.getDataValueByPosition(4, 4));
assertNull(this.selectionLayer.getDataValueByPosition(4, 5));
assertEquals(Double.valueOf("1"), this.selectionLayer.getDataValueByPosition(4, 6));
assertNull(this.selectionLayer.getDataValueByPosition(4, 7));
assertEquals(Double.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 testMultiCellSameDiffFloatValueDragDown.
@Test
public void testMultiCellSameDiffFloatValueDragDown() {
this.dataProvider.setDataValue(4, 4, Float.valueOf("1.3"));
this.dataProvider.setDataValue(4, 5, Float.valueOf("2.6"));
this.dataProvider.setDataValue(4, 6, Float.valueOf("3.9"));
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(Float.valueOf("1.3"), this.selectionLayer.getDataValueByPosition(4, 4));
assertEquals(Float.valueOf("2.6"), this.selectionLayer.getDataValueByPosition(4, 5));
assertEquals(Float.valueOf("3.9"), this.selectionLayer.getDataValueByPosition(4, 6));
assertEquals(Float.valueOf("5.2"), this.selectionLayer.getDataValueByPosition(4, 7));
assertEquals(Float.valueOf("6.5"), this.selectionLayer.getDataValueByPosition(4, 8));
assertEquals(Float.valueOf("7.8"), this.selectionLayer.getDataValueByPosition(4, 9));
}
Aggregations