Class RowSpanningCopyDataCommandHandler
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.command.AbstractLayerCommandHandler<CopyDataToClipboardCommand>
-
- org.eclipse.nebula.widgets.nattable.copy.command.CopyDataCommandHandler
-
- org.eclipse.nebula.widgets.nattable.copy.command.RowSpanningCopyDataCommandHandler
-
- All Implemented Interfaces:
ILayerCommandHandler<CopyDataToClipboardCommand>
- Direct Known Subclasses:
HierarchicalTreeCopyDataCommandHandler
public class RowSpanningCopyDataCommandHandler extends CopyDataCommandHandler
Handler class for copying selected data within theSelectionLayer
to the clipboard. Will treat cells with row spanning as a single cell and will not create gaps for rows with no cell to copy.- Since:
- 1.6
-
-
Field Summary
Fields Modifier and Type Field Description protected InternalCellClipboard
clipboard
-
Fields inherited from class org.eclipse.nebula.widgets.nattable.copy.command.CopyDataCommandHandler
selectionLayer
-
-
Constructor Summary
Constructors Constructor Description RowSpanningCopyDataCommandHandler(SelectionLayer selectionLayer, InternalCellClipboard clipboard)
Creates an instance that only checks theSelectionLayer
for data to add to the clipboard.RowSpanningCopyDataCommandHandler(SelectionLayer selectionLayer, ILayer columnHeaderLayer, InternalCellClipboard clipboard)
Creates an instance that checks theSelectionLayer
and the column header layer if given for data to add to the clipboard.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ILayerCell[]
assembleBody(int currentRowPosition)
Collects and assembles the selected data per row position that should be copied to the clipboard.protected void
internalDoCommand(CopyDataToClipboardCommand command, ILayerCell[][] assembledCopiedDataStructure)
Internal implementation of the command handling that additionally takes the assembled data structure to copy as parameter to avoid multiple assemble operations.protected void
postInternalCopy()
Perform actions after copying values to the internal clipboard.protected void
preInternalCopy()
Perform actions prior copying values to the internal clipboard.-
Methods inherited from class org.eclipse.nebula.widgets.nattable.copy.command.CopyDataCommandHandler
assembleColumnHeaders, assembleCopiedDataStructure, doCommand, getColumnHeaderLayer, getCommandClass, getCopyLayer, getRowHeaderLayer, getSelectedColumnPositions, isCopyAllowed, isEmpty, setCopyFormattedText, setCopyLayer
-
Methods inherited from class org.eclipse.nebula.widgets.nattable.command.AbstractLayerCommandHandler
doCommand
-
-
-
-
Field Detail
-
clipboard
protected InternalCellClipboard clipboard
-
-
Constructor Detail
-
RowSpanningCopyDataCommandHandler
public RowSpanningCopyDataCommandHandler(SelectionLayer selectionLayer, InternalCellClipboard clipboard)
Creates an instance that only checks theSelectionLayer
for data to add to the clipboard.- Parameters:
selectionLayer
- TheSelectionLayer
within the NatTable. Can not benull
.clipboard
- TheInternalCellClipboard
that should be used for copy/paste operations within a NatTable instance.
-
RowSpanningCopyDataCommandHandler
public RowSpanningCopyDataCommandHandler(SelectionLayer selectionLayer, ILayer columnHeaderLayer, InternalCellClipboard clipboard)
Creates an instance that checks theSelectionLayer
and the column header layer if given for data to add to the clipboard.- Parameters:
selectionLayer
- TheSelectionLayer
within the NatTable. Can not benull
.columnHeaderLayer
- The column header layer within the NatTable grid. Can benull
.clipboard
- TheInternalCellClipboard
that should be used for copy/paste operations within a NatTable instance.
-
-
Method Detail
-
internalDoCommand
protected void internalDoCommand(CopyDataToClipboardCommand command, ILayerCell[][] assembledCopiedDataStructure)
Description copied from class:CopyDataCommandHandler
Internal implementation of the command handling that additionally takes the assembled data structure to copy as parameter to avoid multiple assemble operations.- Overrides:
internalDoCommand
in classCopyDataCommandHandler
- Parameters:
command
- TheCopyDataToClipboardCommand
to handle.assembledCopiedDataStructure
- The assembled data structure to copy.
-
assembleBody
protected ILayerCell[] assembleBody(int currentRowPosition)
Collects and assembles the selected data per row position that should be copied to the clipboard. For cells with row spanning only the origin cell will be tracked.- Overrides:
assembleBody
in classCopyDataCommandHandler
- Parameters:
currentRowPosition
- The row position of which the selected cells should be collected.- Returns:
- An array containing the selected cells that should be copied to the clipboard.
-
preInternalCopy
protected void preInternalCopy()
Perform actions prior copying values to the internal clipboard. E.g. disabling formula evaluation.
-
postInternalCopy
protected void postInternalCopy()
Perform actions after copying values to the internal clipboard. E.g. enabling formula evaluation.
-
-