Class FillHandlePasteCommandHandler
java.lang.Object
org.eclipse.nebula.widgets.nattable.fillhandle.command.FillHandlePasteCommandHandler
- All Implemented Interfaces:
ILayerCommandHandler<FillHandlePasteCommand>
- Direct Known Subclasses:
FormulaFillHandlePasteCommandHandler
public class FillHandlePasteCommandHandler
extends Object
implements ILayerCommandHandler<FillHandlePasteCommand>
Command handler for the
FillHandlePasteCommand.- Since:
- 1.4
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFillHandlePasteCommandHandler(SelectionLayer selectionLayer, InternalCellClipboard clipboard) Creates aFillHandlePasteCommandHandler -
Method Summary
Modifier and TypeMethodDescriptionprotected BigDecimalprotected BigIntegerprotected BytecalculateByteDiff(ILayerCell c1, ILayerCell c2) protected IntegercalculateDateDiff(ILayerCell c1, ILayerCell c2, IConfigRegistry configRegistry) protected DoublecalculateDoubleDiff(ILayerCell c1, ILayerCell c2) protected FloatcalculateFloatDiff(ILayerCell c1, ILayerCell c2) protected NumbercalculateHorizontalDiff(ILayerCell cell, int toRow, IConfigRegistry configRegistry) protected IntegercalculateIntDiff(ILayerCell c1, ILayerCell c2) protected LongcalculateLongDiff(ILayerCell c1, ILayerCell c2) protected ShortcalculateShortDiff(ILayerCell c1, ILayerCell c2) protected NumbercalculateVerticalDiff(ILayerCell cell, int toColumn, IConfigRegistry configRegistry) booleandoCommand(ILayer targetLayer, FillHandlePasteCommand command) protected NumbergetCastValue(int diff, Class<?> type) protected intgetColumnDiff(ILayerCell currentCell, int toColumn) Calculate the column difference between the cell column index and the column index of the cell to copy to.protected intgetIncrementDateField(ILayerCell cell, IConfigRegistry configRegistry) protected ObjectgetPasteValue(ILayerCell cell, FillHandlePasteCommand command, int toColumn, int toRow) Returns the value from the given cell that should be pasted to the given position.protected intgetRowDiff(ILayerCell currentCell, int toRow) Calculate the row difference between the cell row index and the row index of the cell to copy to.
-
Field Details
-
selectionLayer
-
clipboard
-
-
Constructor Details
-
FillHandlePasteCommandHandler
public FillHandlePasteCommandHandler(SelectionLayer selectionLayer, InternalCellClipboard clipboard) Creates aFillHandlePasteCommandHandler- Parameters:
selectionLayer- TheSelectionLayerneeded to determine the fill handle region and perform the update command.clipboard- The internal clipboard that carries the cells for the copy & paste operation triggered by using the fill handle.
-
-
Method Details
-
doCommand
- Specified by:
doCommandin interfaceILayerCommandHandler<FillHandlePasteCommand>- Parameters:
targetLayer- the target layercommand- the command- Returns:
- true if the command has been handled, false otherwise
-
getPasteValue
protected Object getPasteValue(ILayerCell cell, FillHandlePasteCommand command, int toColumn, int toRow) Returns the value from the given cell that should be pasted to the given position.- Parameters:
cell- The cell that is copied.command- The command that contains the necessary information for the paste operation.toColumn- The column position of the cell to which the value should be pasted.toRow- The row position of the cell to which the value should be pasted.- Returns:
- The value that should be set to the given position.
-
calculateHorizontalDiff
protected Number calculateHorizontalDiff(ILayerCell cell, int toRow, IConfigRegistry configRegistry) -
calculateVerticalDiff
protected Number calculateVerticalDiff(ILayerCell cell, int toColumn, IConfigRegistry configRegistry) -
getRowDiff
Calculate the row difference between the cell row index and the row index of the cell to copy to.- Parameters:
currentCell- The current cell to manage.toRow- The row index of the cell to copy to.- Returns:
- The difference as integer.
-
getColumnDiff
Calculate the column difference between the cell column index and the column index of the cell to copy to.- Parameters:
currentCell- The current cell to manage.toColumn- The column index of the cell to copy to.- Returns:
- The difference as integer.
-
getCastValue
-
calculateByteDiff
-
calculateShortDiff
-
calculateIntDiff
-
calculateLongDiff
-
calculateFloatDiff
-
calculateDoubleDiff
-
calculateBigIntegerDiff
-
calculateBigDecimalDiff
-
calculateDateDiff
-
getIncrementDateField
-
getCommandClass
- Specified by:
getCommandClassin interfaceILayerCommandHandler<FillHandlePasteCommand>
-