Class HierarchicalTreePasteDataCommandHandler
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.command.AbstractLayerCommandHandler<PasteDataCommand>
-
- org.eclipse.nebula.widgets.nattable.copy.command.InternalPasteDataCommandHandler
-
- org.eclipse.nebula.widgets.nattable.copy.command.RowSpanningPasteDataCommandHandler
-
- org.eclipse.nebula.widgets.nattable.hierarchical.command.HierarchicalTreePasteDataCommandHandler
-
- All Implemented Interfaces:
ILayerCommandHandler<PasteDataCommand>
public class HierarchicalTreePasteDataCommandHandler extends RowSpanningPasteDataCommandHandler
ILayerCommandHandler
for handlingPasteDataCommand
s using theInternalCellClipboard
on aHierarchicalTreeLayer
. Will treat cells with row spanning as a single cell. Will also not copy cells of collapsed nodes if the labelsHierarchicalTreeLayer.COLLAPSED_CHILD
orHierarchicalTreeLayer.NO_OBJECT_IN_LEVEL
are applied.Note:
To work correctly theHierarchicalTreeCopyDataCommandHandler
should be registered for handling copy operations with theInternalCellClipboard
, or at least theHierarchicalTreeLayer
should be set as copyLayer to ensure the additional information added by theHierarchicalTreeLayer
can be inspected as the cells to copy are collected on that layer and not theSelectionLayer
.- Since:
- 1.6
- See Also:
HierarchicalTreeCopyDataCommandHandler
-
-
Field Summary
-
Fields inherited from class org.eclipse.nebula.widgets.nattable.copy.command.InternalPasteDataCommandHandler
clipboard, selectionLayer
-
-
Constructor Summary
Constructors Constructor Description HierarchicalTreePasteDataCommandHandler(SelectionLayer selectionLayer, InternalCellClipboard clipboard)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
isPasteAllowed(ILayerCell sourceCell, ILayerCell targetCell, IConfigRegistry configRegistry)
Checks if the cell at the target coordinates supports the paste operation or not.-
Methods inherited from class org.eclipse.nebula.widgets.nattable.copy.command.RowSpanningPasteDataCommandHandler
doCommand
-
Methods inherited from class org.eclipse.nebula.widgets.nattable.copy.command.InternalPasteDataCommandHandler
getCommandClass, getPasteLayer, getPasteValue, postInternalPaste, preInternalPaste
-
Methods inherited from class org.eclipse.nebula.widgets.nattable.command.AbstractLayerCommandHandler
doCommand
-
-
-
-
Constructor Detail
-
HierarchicalTreePasteDataCommandHandler
public HierarchicalTreePasteDataCommandHandler(SelectionLayer selectionLayer, InternalCellClipboard clipboard)
- Parameters:
selectionLayer
-SelectionLayer
that is needed to determine the position to paste the values to.clipboard
- TheInternalCellClipboard
that contains the values that should be pasted.
-
-
Method Detail
-
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 classInternalPasteDataCommandHandler
- Parameters:
sourceCell
- TheILayerCell
that is copied and should be pasted to the target cell.targetCell
- TheILayerCell
to which the content of the source cell should be pasted to.configRegistry
- TheIConfigRegistry
needed to access the configuration values.- Returns:
true
if the cell supports the paste operation,false
if not
-
-