Class RowSpanningCopyDataCommandHandler

All Implemented Interfaces:
ILayerCommandHandler<CopyDataToClipboardCommand>
Direct Known Subclasses:
HierarchicalTreeCopyDataCommandHandler

public class RowSpanningCopyDataCommandHandler extends CopyDataCommandHandler
Handler class for copying selected data within the SelectionLayer 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 Details

  • Constructor Details

    • RowSpanningCopyDataCommandHandler

      public RowSpanningCopyDataCommandHandler(SelectionLayer selectionLayer, InternalCellClipboard clipboard)
      Creates an instance that only checks the SelectionLayer for data to add to the clipboard.
      Parameters:
      selectionLayer - The SelectionLayer within the NatTable. Can not be null.
      clipboard - The InternalCellClipboard 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 the SelectionLayer and the column header layer if given for data to add to the clipboard.
      Parameters:
      selectionLayer - The SelectionLayer within the NatTable. Can not be null.
      columnHeaderLayer - The column header layer within the NatTable grid. Can be null.
      clipboard - The InternalCellClipboard that should be used for copy/paste operations within a NatTable instance.
  • Method Details

    • 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 class CopyDataCommandHandler
      Parameters:
      command - The CopyDataToClipboardCommand 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 class CopyDataCommandHandler
      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.