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
TheIDragMode
that is registered to get triggered for dragging the fill drag handle.- Since:
- 1.4
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.nebula.widgets.nattable.viewport.action.AutoScrollDragMode
AutoScrollDragMode.AutoScrollRunnable
-
-
Field Summary
Fields Modifier and Type Field Description protected InternalCellClipboard
clipboard
protected SelectionLayer.MoveDirectionEnum
direction
protected org.eclipse.swt.widgets.Menu
menu
protected ILayerCell
selectionCell
protected SelectionLayer
selectionLayer
protected org.eclipse.swt.events.MouseEvent
startEvent
protected org.eclipse.swt.graphics.Point
startPosition
-
Fields inherited from class org.eclipse.nebula.widgets.nattable.viewport.action.AutoScrollDragMode
horizontalBorderOffset, verticalBorderOffset
-
-
Constructor Summary
Constructors Constructor Description FillHandleDragMode(SelectionLayer selectionLayer, InternalCellClipboard clipboard)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
calculateIncreasedPositiveDiff(int selectedIndex, int relativeIndex)
Calculates the difference between the two given values and increases the value by one.void
mouseDown(NatTable natTable, org.eclipse.swt.events.MouseEvent event)
void
mouseUp(NatTable natTable, org.eclipse.swt.events.MouseEvent event)
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.protected void
performDragAction(NatTable natTable, int x, int y, SelectionLayer.MoveDirectionEnum horizontal, SelectionLayer.MoveDirectionEnum vertical)
protected void
reset(NatTable natTable)
Reset theFillHandleDragMode
states, the fill handle region in theSelectionLayer
and redraw the given NatTable.protected boolean
showMenu(NatTable natTable)
Check if the menu should be shown for selecting copy or series fill operation.-
Methods inherited from class org.eclipse.nebula.widgets.nattable.viewport.action.AutoScrollDragMode
mouseMove
-
-
-
-
Field Detail
-
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
-
menu
protected org.eclipse.swt.widgets.Menu menu
-
-
Constructor Detail
-
FillHandleDragMode
public FillHandleDragMode(SelectionLayer selectionLayer, InternalCellClipboard clipboard)
- Parameters:
selectionLayer
- TheSelectionLayer
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 Detail
-
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 classAutoScrollDragMode
- 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 valuerelativeIndex
- 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 interfaceIDragMode
- Overrides:
mouseUp
in classAutoScrollDragMode
-
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 theFillHandleDragMode
states, the fill handle region in theSelectionLayer
and redraw the given NatTable.- Parameters:
natTable
- The NatTable instance on which the operation is performed.
-
-