Class ColumnHeaderReorderDragMode
java.lang.Object
org.eclipse.nebula.widgets.nattable.viewport.action.AutoScrollDragMode
org.eclipse.nebula.widgets.nattable.reorder.action.ColumnReorderDragMode
org.eclipse.nebula.widgets.nattable.group.performance.action.ColumnHeaderReorderDragMode
- All Implemented Interfaces:
IDragMode
- Direct Known Subclasses:
GroupByColumnGroupReorderDragMode
Extends the regular column drag functionality to work with column groups. It
does the following checks:
- Checks that the destination is not part of a Unbreakable column group
- Checks if the destination is between two adjoining column groups
- Since:
- 1.6
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.nebula.widgets.nattable.reorder.action.ColumnReorderDragMode
ColumnReorderDragMode.ColumnReorderOverlayPainter
Nested classes/interfaces inherited from class org.eclipse.nebula.widgets.nattable.viewport.action.AutoScrollDragMode
AutoScrollDragMode.AutoScrollRunnable
-
Field Summary
FieldsFields inherited from class org.eclipse.nebula.widgets.nattable.reorder.action.ColumnReorderDragMode
currentEvent, dragFromGridColumnPosition, initialEvent, natTable, targetOverlayPainter
Fields inherited from class org.eclipse.nebula.widgets.nattable.viewport.action.AutoScrollDragMode
horizontalBorderOffset, verticalBorderOffset
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ILayerCell
getColumnCell
(int x) protected CellEdgeEnum
getMoveDirection
(int x) boolean
isValidTargetColumnPosition
(ILayer natLayer, int fromGridColumnPosition, int toGridColumnPosition) protected boolean
isValidTargetColumnPosition
(ILayer natLayer, int fromGridColumnPosition, int toGridColumnPosition, int level, int fromPosition, int toPosition) Test if the reorder is valid for the given level.void
Methods inherited from class org.eclipse.nebula.widgets.nattable.reorder.action.ColumnReorderDragMode
fireMoveEndCommand, fireMoveStartCommand, getDragFromGridColumnPosition, getDragToGridColumnPosition, mouseMove, mouseUp
Methods inherited from class org.eclipse.nebula.widgets.nattable.viewport.action.AutoScrollDragMode
performDragAction
-
Field Details
-
dragFromGridRowPosition
protected int dragFromGridRowPosition
-
-
Constructor Details
-
ColumnHeaderReorderDragMode
- Parameters:
columnGroupHeaderLayer
- TheColumnGroupHeaderLayer
to which this drag mode should be assigned to.
-
-
Method Details
-
mouseDown
- Specified by:
mouseDown
in interfaceIDragMode
- Overrides:
mouseDown
in classColumnReorderDragMode
-
isValidTargetColumnPosition
public boolean isValidTargetColumnPosition(ILayer natLayer, int fromGridColumnPosition, int toGridColumnPosition) - Overrides:
isValidTargetColumnPosition
in classColumnReorderDragMode
-
isValidTargetColumnPosition
protected boolean isValidTargetColumnPosition(ILayer natLayer, int fromGridColumnPosition, int toGridColumnPosition, int level, int fromPosition, int toPosition) Test if the reorder is valid for the given level.- Parameters:
natLayer
- The layer on which the drag operation is triggered, typically the NatTable instance.fromGridColumnPosition
- The from position related to the given natLayer.toGridColumnPosition
- The to position related to the given natLayer.level
- The grouping level for which the check should be performed.fromPosition
- The from position related to the positionLayer of theColumnGroupHeaderLayer
.toPosition
- The to position related to the positionLayer of theColumnGroupHeaderLayer
.- Returns:
true
if the reorder would be valid on the specified level,false
if not.
-
getMoveDirection
- Overrides:
getMoveDirection
in classColumnReorderDragMode
-
getColumnCell
- Overrides:
getColumnCell
in classColumnReorderDragMode
- 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.
-