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
The
IDragMode
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
Modifier and TypeFieldDescriptionprotected InternalCellClipboard
protected SelectionLayer.MoveDirectionEnum
protected org.eclipse.swt.widgets.Menu
protected ILayerCell
protected SelectionLayer
protected org.eclipse.swt.events.MouseEvent
protected org.eclipse.swt.graphics.Point
Fields inherited from class org.eclipse.nebula.widgets.nattable.viewport.action.AutoScrollDragMode
horizontalBorderOffset, verticalBorderOffset
-
Constructor Summary
ConstructorDescriptionFillHandleDragMode
(SelectionLayer selectionLayer, InternalCellClipboard clipboard) -
Method Summary
Modifier and TypeMethodDescriptionprotected int
calculateIncreasedPositiveDiff
(int selectedIndex, int relativeIndex) Calculates the difference between the two given values and increases the value by one.void
void
protected void
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 theFillHandleDragMode
states, the fill handle region in theSelectionLayer
and redraw the given NatTable.protected boolean
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 Details
-
startEvent
protected org.eclipse.swt.events.MouseEvent startEvent -
startPosition
protected org.eclipse.swt.graphics.Point startPosition- Since:
- 1.6
-
direction
-
selectionLayer
-
selectionCell
-
clipboard
-
-
Constructor Details
-
FillHandleDragMode
- 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 Details
-
mouseDown
-
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
- Specified by:
mouseUp
in interfaceIDragMode
- Overrides:
mouseUp
in classAutoScrollDragMode
-
showMenu
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
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
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.
-