Class ColumnReorderDragMode
java.lang.Object
org.eclipse.nebula.widgets.nattable.viewport.action.AutoScrollDragMode
org.eclipse.nebula.widgets.nattable.reorder.action.ColumnReorderDragMode
- All Implemented Interfaces:
IDragMode
- Direct Known Subclasses:
ColumnGroupHeaderReorderDragMode,ColumnGroupHeaderReorderDragMode,ColumnHeaderReorderDragMode,ColumnHeaderReorderDragMode,GroupByColumnReorderDragMode,HierarchicalTreeColumnReorderDragMode
Default
IDragMode invoked for 'left click + drag' on the column
header. It does the following when invoked:
- Fires a column reorder command, to move columns
- Overlays a black line indicating the new column position
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classIOverlayPainterthat paints the black line on the target destination if valid.Nested classes/interfaces inherited from class org.eclipse.nebula.widgets.nattable.viewport.action.AutoScrollDragMode
AutoScrollDragMode.AutoScrollRunnable -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.eclipse.swt.events.MouseEventprotected intprotected org.eclipse.swt.events.MouseEventprotected NatTableprotected IOverlayPainterFields inherited from class org.eclipse.nebula.widgets.nattable.viewport.action.AutoScrollDragMode
horizontalBorderOffset, verticalBorderOffset -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidfireMoveEndCommand(NatTable natTable, int dragToGridColumnPosition) protected voidfireMoveStartCommand(NatTable natTable, int dragFromGridColumnPosition) protected ILayerCellgetColumnCell(int x) protected intprotected intgetDragToGridColumnPosition(CellEdgeEnum moveDirection, int gridColumnPosition) protected CellEdgeEnumgetMoveDirection(int x) protected booleanisValidTargetColumnPosition(ILayer natLayer, int dragFromGridColumnPosition, int dragToGridColumnPosition) voidvoidvoidMethods inherited from class org.eclipse.nebula.widgets.nattable.viewport.action.AutoScrollDragMode
performDragAction
-
Field Details
-
natTable
-
initialEvent
protected org.eclipse.swt.events.MouseEvent initialEvent -
currentEvent
protected org.eclipse.swt.events.MouseEvent currentEvent -
dragFromGridColumnPosition
protected int dragFromGridColumnPosition -
targetOverlayPainter
-
-
Constructor Details
-
ColumnReorderDragMode
public ColumnReorderDragMode()
-
-
Method Details
-
mouseDown
-
mouseMove
- Specified by:
mouseMovein interfaceIDragMode- Overrides:
mouseMovein classAutoScrollDragMode
-
mouseUp
- Specified by:
mouseUpin interfaceIDragMode- Overrides:
mouseUpin classAutoScrollDragMode
-
getDragFromGridColumnPosition
protected int getDragFromGridColumnPosition() -
getDragToGridColumnPosition
-
getMoveDirection
-
getColumnCell
- Parameters:
x- The x coordinate to determine the column of the NatTable.- Returns:
- The cell at the given x coordinate and the y coordinate of the initial event.
- Since:
- 1.6
-
isValidTargetColumnPosition
protected boolean isValidTargetColumnPosition(ILayer natLayer, int dragFromGridColumnPosition, int dragToGridColumnPosition) -
fireMoveStartCommand
-
fireMoveEndCommand
-