Class InternalPasteDataCommandHandler
java.lang.Object
org.eclipse.nebula.widgets.nattable.command.AbstractLayerCommandHandler<PasteDataCommand>
org.eclipse.nebula.widgets.nattable.copy.command.InternalPasteDataCommandHandler
- All Implemented Interfaces:
ILayerCommandHandler<PasteDataCommand>
- Direct Known Subclasses:
FormulaPasteDataCommandHandler
,RowSpanningPasteDataCommandHandler
- Since:
- 1.4
-
Field Summary
-
Constructor Summary
ConstructorDescriptionInternalPasteDataCommandHandler
(SelectionLayer selectionLayer, InternalCellClipboard clipboard) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
doCommand
(PasteDataCommand command) getPasteLayer
(ILayerCell[][] copiedCells) Identifies theIUniqueIndexLayer
from which the cells are copied.protected Object
getPasteValue
(ILayerCell cell, int pasteColumn, int pasteRow) Returns the value that should be pasted.protected boolean
isPasteAllowed
(ILayerCell sourceCell, ILayerCell targetCell, IConfigRegistry configRegistry) Checks if the cell at the target coordinates supports the paste operation or not.protected void
Perform actions after pasting values from the internal clipboard.protected void
Perform actions prior pasting values from the internal clipboard.Methods inherited from class org.eclipse.nebula.widgets.nattable.command.AbstractLayerCommandHandler
doCommand
-
Field Details
-
selectionLayer
-
clipboard
-
-
Constructor Details
-
InternalPasteDataCommandHandler
public InternalPasteDataCommandHandler(SelectionLayer selectionLayer, InternalCellClipboard clipboard) - Parameters:
selectionLayer
-SelectionLayer
that is needed to determine the position to paste the values to.clipboard
- TheInternalCellClipboard
that contains the values that should be pasted.
-
-
Method Details
-
doCommand
- Specified by:
doCommand
in classAbstractLayerCommandHandler<PasteDataCommand>
-
isPasteAllowed
protected boolean isPasteAllowed(ILayerCell sourceCell, ILayerCell targetCell, IConfigRegistry configRegistry) Checks if the cell at the target coordinates supports the paste operation or not.Note: The coordinates need to be related to the SelectionLayer, otherwise the wrong cell will be used for the check.
- Parameters:
sourceCell
- TheILayerCell
that is copied and should be pasted to the target cell.targetCell
- TheILayerCell
to which the content of the source cell should be pasted to.configRegistry
- TheIConfigRegistry
needed to access the configuration values.- Returns:
true
if the cell supports the paste operation,false
if not- Since:
- 1.6
-
getPasteValue
Returns the value that should be pasted.- Parameters:
cell
- TheILayerCell
from which to retrieve the value to paste from.pasteColumn
- The column position of the cell to paste to.pasteRow
- The row position of the cell to paste to.- Returns:
- The value that should be pasted.
-
getPasteLayer
Identifies theIUniqueIndexLayer
from which the cells are copied.- Parameters:
copiedCells
- The copied cells from the internal clipboard.- Returns:
- The
IUniqueIndexLayer
if the copied cells are collected from a different layer, or the locally configuredSelectionLayer
in case there are no copied cells in the internal cell clipboard. - Since:
- 1.6
-
preInternalPaste
protected void preInternalPaste()Perform actions prior pasting values from the internal clipboard. E.g. disabling formula evaluation. -
postInternalPaste
protected void postInternalPaste()Perform actions after pasting values from the internal clipboard. E.g. enabling formula evaluation. -
getCommandClass
-