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
-
Constructor Summary
ConstructorDescriptionFillHandlePasteCommandHandler
(SelectionLayer selectionLayer, InternalCellClipboard clipboard) Creates aFillHandlePasteCommandHandler
-
Method Summary
Modifier and TypeMethodDescriptionprotected BigDecimal
protected BigInteger
protected Byte
calculateByteDiff
(ILayerCell c1, ILayerCell c2) protected Integer
calculateDateDiff
(ILayerCell c1, ILayerCell c2, IConfigRegistry configRegistry) protected Double
calculateDoubleDiff
(ILayerCell c1, ILayerCell c2) protected Float
calculateFloatDiff
(ILayerCell c1, ILayerCell c2) protected Number
calculateHorizontalDiff
(ILayerCell cell, int toRow, IConfigRegistry configRegistry) protected Integer
calculateIntDiff
(ILayerCell c1, ILayerCell c2) protected Long
calculateLongDiff
(ILayerCell c1, ILayerCell c2) protected Short
calculateShortDiff
(ILayerCell c1, ILayerCell c2) protected Number
calculateVerticalDiff
(ILayerCell cell, int toColumn, IConfigRegistry configRegistry) boolean
doCommand
(ILayer targetLayer, FillHandlePasteCommand command) protected Number
getCastValue
(int diff, Class<?> type) protected int
getColumnDiff
(ILayerCell currentCell, int toColumn) Calculate the column difference between the cell column index and the column index of the cell to copy to.protected int
getIncrementDateField
(ILayerCell cell, IConfigRegistry configRegistry) 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.protected int
getRowDiff
(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
- TheSelectionLayer
needed 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:
doCommand
in 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:
getCommandClass
in interfaceILayerCommandHandler<FillHandlePasteCommand>
-