Class MoveCellSelectionCommandHandler
java.lang.Object
org.eclipse.nebula.widgets.nattable.selection.MoveSelectionCommandHandler<MoveSelectionCommand>
org.eclipse.nebula.widgets.nattable.selection.MoveCellSelectionCommandHandler
- All Implemented Interfaces:
ILayerCommandHandler<MoveSelectionCommand>
- Direct Known Subclasses:
MoveRowSelectionCommandHandler
public class MoveCellSelectionCommandHandler
extends MoveSelectionCommandHandler<MoveSelectionCommand>
Specifies the semantics of moving the selection in the table, based on
selecting the adjoining cell(s).
-
Field Summary
Fields inherited from class org.eclipse.nebula.widgets.nattable.selection.MoveSelectionCommandHandler
horizontalTraversalStrategy, selectionLayer, verticalTraversalStrategy
-
Constructor Summary
ConstructorDescriptionMoveCellSelectionCommandHandler
(SelectionLayer selectionLayer) Create a MoveCellSelectionCommandHandler for the givenSelectionLayer
.MoveCellSelectionCommandHandler
(SelectionLayer selectionLayer, ITraversalStrategy traversalStrategy) Create a MoveCellSelectionCommandHandler for the givenSelectionLayer
.MoveCellSelectionCommandHandler
(SelectionLayer selectionLayer, ITraversalStrategy horizontalTraversalStrategy, ITraversalStrategy verticalTraversalStrategy) Create a MoveCellSelectionCommandHandler for the givenSelectionLayer
. -
Method Summary
Modifier and TypeMethodDescriptionprotected ITraversalStrategy
createIncrementalStrategy
(ITraversalStrategy baseStrategy) Creates aITraversalStrategy
that wraps the given base strategy but returning the step count + 1.protected void
moveLastSelectedDown
(ITraversalStrategy traversalStrategy, boolean withShiftMask, boolean withControlMask) Moves the selection from the current position down.protected void
moveLastSelectedLeft
(ITraversalStrategy traversalStrategy, boolean withShiftMask, boolean withControlMask) Moves the selection from the current position to the left.protected void
moveLastSelectedRight
(ITraversalStrategy traversalStrategy, boolean withShiftMask, boolean withControlMask) Moves the selection from the current position to the right.protected void
moveLastSelectedUp
(ITraversalStrategy traversalStrategy, boolean withShiftMask, boolean withControlMask) Moves the selection from the current position up.protected boolean
Methods inherited from class org.eclipse.nebula.widgets.nattable.selection.MoveSelectionCommandHandler
doCommand, getTraversalStrategy, moveSelection
-
Field Details
-
lastSelectedCellPosition
-
newSelectedColumnPosition
protected int newSelectedColumnPosition -
newSelectedRowPosition
protected int newSelectedRowPosition
-
-
Constructor Details
-
MoveCellSelectionCommandHandler
Create a MoveCellSelectionCommandHandler for the givenSelectionLayer
. Uses theITraversalStrategy.AXIS_TRAVERSAL_STRATEGY
as default strategy for selection movement.- Parameters:
selectionLayer
- TheSelectionLayer
on which the selection should be performed.
-
MoveCellSelectionCommandHandler
public MoveCellSelectionCommandHandler(SelectionLayer selectionLayer, ITraversalStrategy traversalStrategy) Create a MoveCellSelectionCommandHandler for the givenSelectionLayer
.- Parameters:
selectionLayer
- TheSelectionLayer
on which the selection should be performed.traversalStrategy
- The strategy that should be used for selection movements. Can not benull
.
-
MoveCellSelectionCommandHandler
public MoveCellSelectionCommandHandler(SelectionLayer selectionLayer, ITraversalStrategy horizontalTraversalStrategy, ITraversalStrategy verticalTraversalStrategy) Create a MoveCellSelectionCommandHandler for the givenSelectionLayer
.- Parameters:
selectionLayer
- TheSelectionLayer
on which the selection should be performed.horizontalTraversalStrategy
- The strategy that should be used for horizontal selection movements. Can not benull
.verticalTraversalStrategy
- The strategy that should be used for vertical selection movements. Can not benull
.
-
-
Method Details
-
moveLastSelectedLeft
protected void moveLastSelectedLeft(ITraversalStrategy traversalStrategy, boolean withShiftMask, boolean withControlMask) Description copied from class:MoveSelectionCommandHandler
Moves the selection from the current position to the left.- Specified by:
moveLastSelectedLeft
in classMoveSelectionCommandHandler<MoveSelectionCommand>
- Parameters:
traversalStrategy
- the traversal strategy to determine the number of steps to move and the behavior on moving over the borderwithShiftMask
- boolean flag to indicate whether the shift key modifier is enabled or notwithControlMask
- boolean flag to indicate whether the control key modifier is enabled or not
-
moveLastSelectedRight
protected void moveLastSelectedRight(ITraversalStrategy traversalStrategy, boolean withShiftMask, boolean withControlMask) Description copied from class:MoveSelectionCommandHandler
Moves the selection from the current position to the right.- Specified by:
moveLastSelectedRight
in classMoveSelectionCommandHandler<MoveSelectionCommand>
- Parameters:
traversalStrategy
- the traversal strategy to determine the number of steps to move and the behavior on moving over the borderwithShiftMask
- boolean flag to indicate whether the shift key modifier is enabled or notwithControlMask
- boolean flag to indicate whether the control key modifier is enabled or not
-
moveLastSelectedUp
protected void moveLastSelectedUp(ITraversalStrategy traversalStrategy, boolean withShiftMask, boolean withControlMask) Description copied from class:MoveSelectionCommandHandler
Moves the selection from the current position up.- Specified by:
moveLastSelectedUp
in classMoveSelectionCommandHandler<MoveSelectionCommand>
- Parameters:
traversalStrategy
- the traversal strategy to determine the number of steps to move and the behavior on moving over the borderwithShiftMask
- boolean flag to indicate whether the shift key modifier is enabled or notwithControlMask
- boolean flag to indicate whether the control key modifier is enabled or not
-
moveLastSelectedDown
protected void moveLastSelectedDown(ITraversalStrategy traversalStrategy, boolean withShiftMask, boolean withControlMask) Description copied from class:MoveSelectionCommandHandler
Moves the selection from the current position down.- Specified by:
moveLastSelectedDown
in classMoveSelectionCommandHandler<MoveSelectionCommand>
- Parameters:
traversalStrategy
- the traversal strategy to determine the number of steps to move and the behavior on moving over the borderwithShiftMask
- boolean flag to indicate whether the shift key modifier is enabled or notwithControlMask
- boolean flag to indicate whether the control key modifier is enabled or not
-
createIncrementalStrategy
Creates aITraversalStrategy
that wraps the given base strategy but returning the step count + 1. Used to perform incremental movement in case the base strategy specifies logic to determine whether a target cell is a valid move target or not.- Parameters:
baseStrategy
- TheITraversalStrategy
to wrap.- Returns:
- A
ITraversalStrategy
that wraps the given base strategy using the given step count.
-
positionMoved
protected boolean positionMoved()- Returns:
true
if the selection moved in any direction,false
if the selection stays at the same position
-
getCommandClass
-