Class HierarchicalTreeCopyDataCommandHandler

All Implemented Interfaces:
ILayerCommandHandler<CopyDataToClipboardCommand>

public class HierarchicalTreeCopyDataCommandHandler extends RowSpanningCopyDataCommandHandler
Handler class for copying selected data on a HierarchicalTreeLayer 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. Will also not copy cells of collapsed nodes if the labels HierarchicalTreeLayer.COLLAPSED_CHILD or HierarchicalTreeLayer.NO_OBJECT_IN_LEVEL are applied.
Since:
1.6
See Also:
  • Constructor Details

    • HierarchicalTreeCopyDataCommandHandler

      public HierarchicalTreeCopyDataCommandHandler(SelectionLayer selectionLayer, HierarchicalTreeLayer treeLayer, 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.
      treeLayer - The HierarchicalTreeLayer that will be used as copyLayer from which the cells are identified to copy.
      clipboard - The InternalCellClipboard that should be used for copy/paste operations within a NatTable instance.
    • HierarchicalTreeCopyDataCommandHandler

      public HierarchicalTreeCopyDataCommandHandler(SelectionLayer selectionLayer, HierarchicalTreeLayer treeLayer, 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.
      treeLayer - The HierarchicalTreeLayer that will be used as copyLayer from which the cells are identified to copy.
      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

    • isCopyAllowed

      protected boolean isCopyAllowed(ILayerCell cellToCopy)
      Description copied from class: CopyDataCommandHandler
      Checks if the given cell can be copied.
      Overrides:
      isCopyAllowed in class CopyDataCommandHandler
      Parameters:
      cellToCopy - The ILayerCell that should be copied.
      Returns:
      true if the cell can be copied, false if a copy operation for that cell should be avoided.