Class FillHandleDragMode

java.lang.Object
org.eclipse.nebula.widgets.nattable.viewport.action.AutoScrollDragMode
org.eclipse.nebula.widgets.nattable.fillhandle.action.FillHandleDragMode
All Implemented Interfaces:
IDragMode
Direct Known Subclasses:
FormulaFillHandleDragMode

public class FillHandleDragMode extends AutoScrollDragMode
The IDragMode that is registered to get triggered for dragging the fill drag handle.
Since:
1.4
  • Field Details

    • startEvent

      protected org.eclipse.swt.events.MouseEvent startEvent
    • startPosition

      protected org.eclipse.swt.graphics.Point startPosition
      Since:
      1.6
    • direction

      protected SelectionLayer.MoveDirectionEnum direction
    • selectionLayer

      protected SelectionLayer selectionLayer
    • selectionCell

      protected ILayerCell selectionCell
    • clipboard

      protected InternalCellClipboard clipboard
  • Constructor Details

    • FillHandleDragMode

      public FillHandleDragMode(SelectionLayer selectionLayer, InternalCellClipboard clipboard)
      Parameters:
      selectionLayer - The SelectionLayer needed to determine the fill handle region and perform the update command.
      clipboard - The internal clipboard that carries the cells for the copy & paste operation triggered by using the fill handle.
  • Method Details

    • mouseDown

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

      protected void performDragAction(NatTable natTable, int x, int y, SelectionLayer.MoveDirectionEnum horizontal, SelectionLayer.MoveDirectionEnum vertical)
      Overrides:
      performDragAction in class AutoScrollDragMode
      Parameters:
      natTable - The NatTable instance the drag operation is currently performed on.
      x - The x coordinate of the mouse pointer on mouse move. Corrected to be inside the NatTable client area.
      y - The y coordinate of the mouse pointer on mouse move. Corrected to be inside the NatTable client area.
      horizontal - The horizontal direction where the auto-scroll should be performed to.
      vertical - The vertical direction where the auto-scroll should be performed to.
    • calculateIncreasedPositiveDiff

      protected int calculateIncreasedPositiveDiff(int selectedIndex, int relativeIndex)
      Calculates the difference between the two given values and increases the value by one.
      Parameters:
      selectedIndex - The first value
      relativeIndex - The second value
      Returns:
      The difference between the two given values increased by one.
    • mouseUp

      public void mouseUp(NatTable natTable, org.eclipse.swt.events.MouseEvent event)
      Specified by:
      mouseUp in interface IDragMode
      Overrides:
      mouseUp in class AutoScrollDragMode
    • showMenu

      protected boolean showMenu(NatTable natTable)
      Check if the menu should be shown for selecting copy or series fill operation.
      Parameters:
      natTable - The NatTable instance on which the operation is performed.
      Returns:
      true if the menu should be shown, false if not.
    • openMenu

      protected void openMenu(NatTable natTable)
      Opens a menu that enables a user to select whether values should simply be copied or if a series should be filled.
      Parameters:
      natTable - The NatTable instance on which the operation is performed.
    • reset

      protected void reset(NatTable natTable)
      Reset the FillHandleDragMode states, the fill handle region in the SelectionLayer and redraw the given NatTable.
      Parameters:
      natTable - The NatTable instance on which the operation is performed.