Class RowHeaderReorderDragMode

  • All Implemented Interfaces:
    IDragMode

    public class RowHeaderReorderDragMode
    extends RowReorderDragMode
    Extends the regular row drag functionality to work with row groups. It does the following checks:
    1. Checks that the destination is not part of a Unbreakable row group
    2. Checks if the destination is between two adjoining row groups
    Since:
    1.6
    • Field Detail

      • dragFromGridColumnPosition

        protected int dragFromGridColumnPosition
    • Constructor Detail

      • RowHeaderReorderDragMode

        public RowHeaderReorderDragMode​(RowGroupHeaderLayer rowGroupHeaderLayer)
        Parameters:
        rowGroupHeaderLayer - The RowGroupHeaderLayer to which this drag mode should be assigned to.
    • Method Detail

      • isValidTargetRowPosition

        public boolean isValidTargetRowPosition​(ILayer natLayer,
                                                int fromGridRowPosition,
                                                int toGridRowPosition)
        Overrides:
        isValidTargetRowPosition in class RowReorderDragMode
        Parameters:
        natLayer - The layer the positions are related to
        fromGridRowPosition - The row position of the row that is dragged
        toGridRowPosition - The row position where the row is dropped
        Returns:
        true if the drop position is valid, false if not
      • isValidTargetRowPosition

        protected boolean isValidTargetRowPosition​(ILayer natLayer,
                                                   int fromGridRowPosition,
                                                   int toGridRowPosition,
                                                   int level,
                                                   int fromPosition,
                                                   int toPosition)
        Test if the reorder is valid for the given level.
        Parameters:
        natLayer - The layer on which the drag operation is triggered, typically the NatTable instance.
        fromGridRowPosition - The from position related to the given natLayer.
        toGridRowPosition - The to position related to the given natLayer.
        level - The grouping level for which the check should be performed.
        fromPosition - The from position related to the positionLayer of the RowGroupHeaderLayer.
        toPosition - The to position related to the positionLayer of the RowGroupHeaderLayer.
        Returns:
        true if the reorder would be valid on the specified level, false if not.
      • getMoveDirection

        protected CellEdgeEnum getMoveDirection​(int y)
        Overrides:
        getMoveDirection in class RowReorderDragMode
        Parameters:
        y - The y coordinate of the drop location
        Returns:
        The direction whether the drop should be performed before the the cell at drop position or after