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
public class RowHeaderReorderDragMode extends RowReorderDragMode
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.RowReorderOverlayPainter
-
Nested classes/interfaces inherited from class org.eclipse.nebula.widgets.nattable.viewport.action.AutoScrollDragMode
AutoScrollDragMode.AutoScrollRunnable
-
-
Field Summary
Fields Modifier and Type Field Description protected int
dragFromGridColumnPosition
-
Fields inherited from class org.eclipse.nebula.widgets.nattable.reorder.action.RowReorderDragMode
currentEvent, dragFromGridRowPosition, initialEvent, natTable, targetOverlayPainter
-
Fields inherited from class org.eclipse.nebula.widgets.nattable.viewport.action.AutoScrollDragMode
horizontalBorderOffset, verticalBorderOffset
-
-
Constructor Summary
Constructors Constructor Description RowHeaderReorderDragMode(RowGroupHeaderLayer rowGroupHeaderLayer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CellEdgeEnum
getMoveDirection(int y)
protected ILayerCell
getRowCell(int y)
boolean
isValidTargetRowPosition(ILayer natLayer, int fromGridRowPosition, int toGridRowPosition)
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.void
mouseDown(NatTable natTable, org.eclipse.swt.events.MouseEvent event)
-
Methods inherited from class org.eclipse.nebula.widgets.nattable.reorder.action.RowReorderDragMode
fireMoveEndCommand, fireMoveStartCommand, getDragFromGridRowPosition, getDragToGridRowPosition, mouseMove, mouseUp
-
Methods inherited from class org.eclipse.nebula.widgets.nattable.viewport.action.AutoScrollDragMode
performDragAction
-
-
-
-
Constructor Detail
-
RowHeaderReorderDragMode
public RowHeaderReorderDragMode(RowGroupHeaderLayer rowGroupHeaderLayer)
- Parameters:
rowGroupHeaderLayer
- TheRowGroupHeaderLayer
to which this drag mode should be assigned to.
-
-
Method Detail
-
mouseDown
public void mouseDown(NatTable natTable, org.eclipse.swt.events.MouseEvent event)
- Specified by:
mouseDown
in interfaceIDragMode
- Overrides:
mouseDown
in classRowReorderDragMode
-
isValidTargetRowPosition
public boolean isValidTargetRowPosition(ILayer natLayer, int fromGridRowPosition, int toGridRowPosition)
- Overrides:
isValidTargetRowPosition
in 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:
true
if the drop position is valid,false
if 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:
true
if the reorder would be valid on the specified level,false
if not.
-
getMoveDirection
protected CellEdgeEnum getMoveDirection(int y)
- Overrides:
getMoveDirection
in 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
protected ILayerCell getRowCell(int y)
- Overrides:
getRowCell
in classRowReorderDragMode
- Parameters:
y
- The y coordinate of the drop location- Returns:
- The
ILayerCell
at the drop location
-
-