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
FieldsModifier and TypeFieldDescriptionprotected InternalCellClipboardprotected SelectionLayer.MoveDirectionEnumprotected org.eclipse.swt.widgets.Menuprotected ILayerCellprotected SelectionLayerprotected org.eclipse.swt.events.MouseEventprotected org.eclipse.swt.graphics.PointFields inherited from class org.eclipse.nebula.widgets.nattable.viewport.action.AutoScrollDragMode
horizontalBorderOffset, verticalBorderOffset -
Constructor Summary
ConstructorsConstructorDescriptionFillHandleDragMode(SelectionLayer selectionLayer, InternalCellClipboard clipboard) -
Method Summary
Modifier and TypeMethodDescriptionprotected intcalculateIncreasedPositiveDiff(int selectedIndex, int relativeIndex) Calculates the difference between the two given values and increases the value by one.voidvoidprotected voidOpens a menu that enables a user to select whether values should simply be copied or if a series should be filled.protected voidperformDragAction(NatTable natTable, int x, int y, SelectionLayer.MoveDirectionEnum horizontal, SelectionLayer.MoveDirectionEnum vertical) protected voidReset theFillHandleDragModestates, the fill handle region in theSelectionLayerand redraw the given NatTable.protected booleanCheck 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- TheSelectionLayerneeded 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:
performDragActionin 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:
mouseUpin interfaceIDragMode- Overrides:
mouseUpin 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:
trueif the menu should be shown,falseif 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 theFillHandleDragModestates, the fill handle region in theSelectionLayerand redraw the given NatTable.- Parameters:
natTable- The NatTable instance on which the operation is performed.
-