Class HierarchicalTreePasteDataCommandHandler

All Implemented Interfaces:
ILayerCommandHandler<PasteDataCommand>

public class HierarchicalTreePasteDataCommandHandler extends RowSpanningPasteDataCommandHandler
ILayerCommandHandler for handling PasteDataCommands using the InternalCellClipboard on a HierarchicalTreeLayer. Will treat cells with row spanning as a single cell. Will also not copy cells of collapsed nodes if the labels HierarchicalTreeLayer.COLLAPSED_CHILD or HierarchicalTreeLayer.NO_OBJECT_IN_LEVEL are applied.

Note:
To work correctly the HierarchicalTreeCopyDataCommandHandler should be registered for handling copy operations with the InternalCellClipboard, or at least the HierarchicalTreeLayer should be set as copyLayer to ensure the additional information added by the HierarchicalTreeLayer can be inspected as the cells to copy are collected on that layer and not the SelectionLayer.

Since:
1.6
See Also:
  • Constructor Details

    • HierarchicalTreePasteDataCommandHandler

      public HierarchicalTreePasteDataCommandHandler(SelectionLayer selectionLayer, InternalCellClipboard clipboard)
      Parameters:
      selectionLayer - SelectionLayer that is needed to determine the position to paste the values to.
      clipboard - The InternalCellClipboard that contains the values that should be pasted.
  • Method Details

    • isPasteAllowed

      protected boolean isPasteAllowed(ILayerCell sourceCell, ILayerCell targetCell, IConfigRegistry configRegistry)
      Description copied from class: InternalPasteDataCommandHandler
      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.

      Overrides:
      isPasteAllowed in class InternalPasteDataCommandHandler
      Parameters:
      sourceCell - The ILayerCell that is copied and should be pasted to the target cell.
      targetCell - The ILayerCell to which the content of the source cell should be pasted to.
      configRegistry - The IConfigRegistry needed to access the configuration values.
      Returns:
      true if the cell supports the paste operation, false if not