Class RowReorderDragMode

    • Field Detail

      • initialEvent

        protected org.eclipse.swt.events.MouseEvent initialEvent
      • currentEvent

        protected org.eclipse.swt.events.MouseEvent currentEvent
      • dragFromGridRowPosition

        protected int dragFromGridRowPosition
    • Constructor Detail

      • RowReorderDragMode

        public RowReorderDragMode()
    • Method Detail

      • mouseDown

        public void mouseDown​(NatTable natTable,
                              org.eclipse.swt.events.MouseEvent event)
      • getDragFromGridRowPosition

        protected int getDragFromGridRowPosition()
        Returns:
        The row position of the row that is dragged
      • getDragToGridRowPosition

        protected int getDragToGridRowPosition​(CellEdgeEnum moveDirection,
                                               int gridRowPosition)
        Parameters:
        moveDirection - The direction to indicate whether the drop was before or after the given row position
        gridRowPosition - The row position at which the drop was performed
        Returns:
        The row position where the dragged row should be dropped
      • getMoveDirection

        protected CellEdgeEnum getMoveDirection​(int y)
        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
      • getRowCell

        protected ILayerCell getRowCell​(int y)
        Parameters:
        y - The y coordinate of the drop location
        Returns:
        The ILayerCell at the drop location
        Since:
        1.6
      • isValidTargetRowPosition

        protected boolean isValidTargetRowPosition​(ILayer natLayer,
                                                   int dragFromGridRowPosition,
                                                   int dragToGridRowPosition)
        Parameters:
        natLayer - The layer the positions are related to
        dragFromGridRowPosition - The row position of the row that is dragged
        dragToGridRowPosition - The row position where the row is dropped
        Returns:
        true if the drop position is valid, false if not
      • fireMoveStartCommand

        protected void fireMoveStartCommand​(NatTable natTable,
                                            int dragFromGridRowPosition)
        Executes the command to indicate row reorder starting.
        Parameters:
        natTable - The NatTable instance on which the command should be executed
        dragFromGridRowPosition - The row position of the row that is dragged
      • fireMoveEndCommand

        protected void fireMoveEndCommand​(NatTable natTable,
                                          int dragToGridRowPosition)
        Executes the command to indicate row reorder ending.
        Parameters:
        natTable - The NatTable instance on which the command should be executed
        dragToGridRowPosition - The position of the row to which the dragged row should be dropped