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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInternalPasteDataCommandHandler(SelectionLayer selectionLayer, InternalCellClipboard clipboard) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleandoCommand(PasteDataCommand command) getPasteLayer(ILayerCell[][] copiedCells) Identifies theIUniqueIndexLayerfrom which the cells are copied.protected ObjectgetPasteValue(ILayerCell cell, int pasteColumn, int pasteRow) Returns the value that should be pasted.protected booleanisPasteAllowed(ILayerCell sourceCell, ILayerCell targetCell, IConfigRegistry configRegistry) Checks if the cell at the target coordinates supports the paste operation or not.protected voidPerform actions after pasting values from the internal clipboard.protected voidPerform 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-SelectionLayerthat is needed to determine the position to paste the values to.clipboard- TheInternalCellClipboardthat contains the values that should be pasted.
-
-
Method Details
-
doCommand
- Specified by:
doCommandin 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- TheILayerCellthat is copied and should be pasted to the target cell.targetCell- TheILayerCellto which the content of the source cell should be pasted to.configRegistry- TheIConfigRegistryneeded to access the configuration values.- Returns:
trueif the cell supports the paste operation,falseif not- Since:
- 1.6
-
getPasteValue
Returns the value that should be pasted.- Parameters:
cell- TheILayerCellfrom 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 theIUniqueIndexLayerfrom which the cells are copied.- Parameters:
copiedCells- The copied cells from the internal clipboard.- Returns:
- The
IUniqueIndexLayerif the copied cells are collected from a different layer, or the locally configuredSelectionLayerin 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
-