Class RowHeaderReorderDragMode
java.lang.Object
org.eclipse.nebula.widgets.nattable.viewport.action.AutoScrollDragMode
org.eclipse.nebula.widgets.nattable.reorder.action.RowReorderDragMode
org.eclipse.nebula.widgets.nattable.group.performance.action.RowHeaderReorderDragMode
- All Implemented Interfaces:
IDragMode
Extends the regular row drag functionality to work with row groups. It does
the following checks:
- Checks that the destination is not part of a Unbreakable row group
- Checks if the destination is between two adjoining row groups
- Since:
- 1.6
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.nebula.widgets.nattable.reorder.action.RowReorderDragMode
RowReorderDragMode.RowReorderOverlayPainterNested 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.RowReorderDragMode
currentEvent, dragFromGridRowPosition, initialEvent, natTable, targetOverlayPainterFields inherited from class org.eclipse.nebula.widgets.nattable.viewport.action.AutoScrollDragMode
horizontalBorderOffset, verticalBorderOffset -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CellEdgeEnumgetMoveDirection(int y) protected ILayerCellgetRowCell(int y) booleanisValidTargetRowPosition(ILayer natLayer, int fromGridRowPosition, int toGridRowPosition) protected booleanisValidTargetRowPosition(ILayer natLayer, int fromGridRowPosition, int toGridRowPosition, int level, int fromPosition, int toPosition) Test if the reorder is valid for the given level.voidMethods inherited from class org.eclipse.nebula.widgets.nattable.reorder.action.RowReorderDragMode
fireMoveEndCommand, fireMoveStartCommand, getDragFromGridRowPosition, getDragToGridRowPosition, mouseMove, mouseUpMethods inherited from class org.eclipse.nebula.widgets.nattable.viewport.action.AutoScrollDragMode
performDragAction
-
Field Details
-
dragFromGridColumnPosition
protected int dragFromGridColumnPosition
-
-
Constructor Details
-
RowHeaderReorderDragMode
- Parameters:
rowGroupHeaderLayer- TheRowGroupHeaderLayerto which this drag mode should be assigned to.
-
-
Method Details
-
mouseDown
- Specified by:
mouseDownin interfaceIDragMode- Overrides:
mouseDownin classRowReorderDragMode
-
isValidTargetRowPosition
public boolean isValidTargetRowPosition(ILayer natLayer, int fromGridRowPosition, int toGridRowPosition) - Overrides:
isValidTargetRowPositionin classRowReorderDragMode- Parameters:
natLayer- The layer the positions are related tofromGridRowPosition- The row position of the row that is draggedtoGridRowPosition- The row position where the row is dropped- Returns:
trueif the drop position is valid,falseif not
-
isValidTargetRowPosition
protected boolean isValidTargetRowPosition(ILayer natLayer, int fromGridRowPosition, int toGridRowPosition, 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.fromGridRowPosition- The from position related to the given natLayer.toGridRowPosition- 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 theRowGroupHeaderLayer.toPosition- The to position related to the positionLayer of theRowGroupHeaderLayer.- Returns:
trueif the reorder would be valid on the specified level,falseif not.
-
getMoveDirection
- Overrides:
getMoveDirectionin classRowReorderDragMode- Parameters:
y- The y coordinate of the drop location- Returns:
- The direction whether the drop should be performed before the the cell at drop position or after
-
getRowCell
- Overrides:
getRowCellin classRowReorderDragMode- Parameters:
y- The y coordinate of the drop location- Returns:
- The
ILayerCellat the drop location
-