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
public class InternalPasteDataCommandHandler extends AbstractLayerCommandHandler<PasteDataCommand>
- Since:
- 1.4
-
-
Field Summary
Fields Modifier and Type Field Description protected InternalCellClipboard
clipboard
protected SelectionLayer
selectionLayer
-
Constructor Summary
Constructors Constructor Description InternalPasteDataCommandHandler(SelectionLayer selectionLayer, InternalCellClipboard clipboard)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
doCommand(PasteDataCommand command)
Class<PasteDataCommand>
getCommandClass()
IUniqueIndexLayer
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
postInternalPaste()
Perform actions after pasting values from the internal clipboard.protected void
preInternalPaste()
Perform actions prior pasting values from the internal clipboard.-
Methods inherited from class org.eclipse.nebula.widgets.nattable.command.AbstractLayerCommandHandler
doCommand
-
-
-
-
Field Detail
-
selectionLayer
protected SelectionLayer selectionLayer
-
clipboard
protected InternalCellClipboard clipboard
-
-
Constructor Detail
-
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 Detail
-
doCommand
protected boolean doCommand(PasteDataCommand command)
- 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
protected Object getPasteValue(ILayerCell cell, int pasteColumn, int pasteRow)
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
public IUniqueIndexLayer getPasteLayer(ILayerCell[][] copiedCells)
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
public Class<PasteDataCommand> getCommandClass()
-
-