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 theFillHandlePasteCommand
.- Since:
- 1.4
- See Also:
FillHandlePasteCommand
-
-
Field Summary
Fields Modifier and Type Field Description protected InternalCellClipboard
clipboard
protected SelectionLayer
selectionLayer
-
Constructor Summary
Constructors Constructor Description FillHandlePasteCommandHandler(SelectionLayer selectionLayer, InternalCellClipboard clipboard)
Creates aFillHandlePasteCommandHandler
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BigDecimal
calculateBigDecimalDiff(ILayerCell c1, ILayerCell c2)
protected BigInteger
calculateBigIntegerDiff(ILayerCell c1, ILayerCell c2)
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.Class<FillHandlePasteCommand>
getCommandClass()
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 Detail
-
selectionLayer
protected SelectionLayer selectionLayer
-
clipboard
protected InternalCellClipboard clipboard
-
-
Constructor Detail
-
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 Detail
-
doCommand
public boolean doCommand(ILayer targetLayer, FillHandlePasteCommand command)
- 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
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.- Parameters:
currentCell
- The current cell to manage.toRow
- The row index of the cell to copy to.- Returns:
- The difference as integer.
-
getColumnDiff
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.- Parameters:
currentCell
- The current cell to manage.toColumn
- The column index of the cell to copy to.- Returns:
- The difference as integer.
-
calculateByteDiff
protected Byte calculateByteDiff(ILayerCell c1, ILayerCell c2)
-
calculateShortDiff
protected Short calculateShortDiff(ILayerCell c1, ILayerCell c2)
-
calculateIntDiff
protected Integer calculateIntDiff(ILayerCell c1, ILayerCell c2)
-
calculateLongDiff
protected Long calculateLongDiff(ILayerCell c1, ILayerCell c2)
-
calculateFloatDiff
protected Float calculateFloatDiff(ILayerCell c1, ILayerCell c2)
-
calculateDoubleDiff
protected Double calculateDoubleDiff(ILayerCell c1, ILayerCell c2)
-
calculateBigIntegerDiff
protected BigInteger calculateBigIntegerDiff(ILayerCell c1, ILayerCell c2)
-
calculateBigDecimalDiff
protected BigDecimal calculateBigDecimalDiff(ILayerCell c1, ILayerCell c2)
-
calculateDateDiff
protected Integer calculateDateDiff(ILayerCell c1, ILayerCell c2, IConfigRegistry configRegistry)
-
getIncrementDateField
protected int getIncrementDateField(ILayerCell cell, IConfigRegistry configRegistry)
-
getCommandClass
public Class<FillHandlePasteCommand> getCommandClass()
- Specified by:
getCommandClass
in interfaceILayerCommandHandler<FillHandlePasteCommand>
-
-