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 InternalCellClipboardclipboardprotected SelectionLayerselectionLayer
-
Constructor Summary
Constructors Constructor Description InternalPasteDataCommandHandler(SelectionLayer selectionLayer, InternalCellClipboard clipboard)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleandoCommand(PasteDataCommand command)Class<PasteDataCommand>getCommandClass()IUniqueIndexLayergetPasteLayer(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 voidpostInternalPaste()Perform actions after pasting values from the internal clipboard.protected voidpreInternalPaste()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-SelectionLayerthat is needed to determine the position to paste the values to.clipboard- TheInternalCellClipboardthat contains the values that should be pasted.
-
-
Method Detail
-
doCommand
protected boolean doCommand(PasteDataCommand command)
- 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
protected Object getPasteValue(ILayerCell cell, int pasteColumn, int pasteRow)
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
public IUniqueIndexLayer getPasteLayer(ILayerCell[][] copiedCells)
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
public Class<PasteDataCommand> getCommandClass()
-
-