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 class
IOverlayPainter
that 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.MouseEvent
protected int
protected org.eclipse.swt.events.MouseEvent
protected NatTable
protected IOverlayPainter
Fields inherited from class org.eclipse.nebula.widgets.nattable.viewport.action.AutoScrollDragMode
horizontalBorderOffset, verticalBorderOffset
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
fireMoveEndCommand
(NatTable natTable, int dragToGridColumnPosition) protected void
fireMoveStartCommand
(NatTable natTable, int dragFromGridColumnPosition) protected ILayerCell
getColumnCell
(int x) protected int
protected int
getDragToGridColumnPosition
(CellEdgeEnum moveDirection, int gridColumnPosition) protected CellEdgeEnum
getMoveDirection
(int x) protected boolean
isValidTargetColumnPosition
(ILayer natLayer, int dragFromGridColumnPosition, int dragToGridColumnPosition) void
void
void
Methods 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:
mouseMove
in interfaceIDragMode
- Overrides:
mouseMove
in classAutoScrollDragMode
-
mouseUp
- Specified by:
mouseUp
in interfaceIDragMode
- Overrides:
mouseUp
in 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
-