Class MoveSelectionCommand
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.command.AbstractContextFreeCommand
-
- org.eclipse.nebula.widgets.nattable.selection.command.AbstractSelectionCommand
-
- org.eclipse.nebula.widgets.nattable.selection.command.MoveSelectionCommand
-
- All Implemented Interfaces:
ILayerCommand
public class MoveSelectionCommand extends AbstractSelectionCommand
Command that is used to move a selection into a given direction.Since 1.2.0 it can be created in several ways, to be able to customize the determination of the steps to move. The following lists the different ways and their effects:
- no steps, no strategy
theITraversalStrategy
configured with theMoveSelectionCommandHandler
is used and will be asked for the step count - specify steps to move
theITraversalStrategy
configured with theMoveSelectionCommandHandler
is used but modified to return the given step count - specify traversal strategy
the givenITraversalStrategy
is used and will be asked for the step count. TheITraversalStrategy
configured with theMoveSelectionCommandHandler
will be ignored.
-
-
Constructor Summary
Constructors Constructor Description MoveSelectionCommand(SelectionLayer.MoveDirectionEnum direction, boolean shiftMask, boolean controlMask)
Creates aMoveSelectionCommand
that doesn't specify a step count nor anITraversalStrategy
.MoveSelectionCommand(SelectionLayer.MoveDirectionEnum direction, Integer stepSize, boolean shiftMask, boolean controlMask)
Creates aMoveSelectionCommand
that specifies the number of steps to move directly.MoveSelectionCommand(SelectionLayer.MoveDirectionEnum direction, ITraversalStrategy traversalStrategy, boolean shiftMask, boolean controlMask)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SelectionLayer.MoveDirectionEnum
getDirection()
Integer
getStepSize()
ITraversalStrategy
getTraversalStrategy()
-
Methods inherited from class org.eclipse.nebula.widgets.nattable.selection.command.AbstractSelectionCommand
isControlMask, isShiftMask
-
Methods inherited from class org.eclipse.nebula.widgets.nattable.command.AbstractContextFreeCommand
cloneCommand, convertToTargetLayer
-
-
-
-
Constructor Detail
-
MoveSelectionCommand
public MoveSelectionCommand(SelectionLayer.MoveDirectionEnum direction, boolean shiftMask, boolean controlMask)
Creates aMoveSelectionCommand
that doesn't specify a step count nor anITraversalStrategy
. Using this constructor will lead to a selection movement that uses theITraversalStrategy
that is registered with theMoveSelectionCommandHandler
.- Parameters:
direction
- The direction to move to.shiftMask
- boolean flag to indicate whether the shift key modifier is enabled or notcontrolMask
- boolean flag to indicate whether the control key modifier is enabled or not
-
MoveSelectionCommand
public MoveSelectionCommand(SelectionLayer.MoveDirectionEnum direction, Integer stepSize, boolean shiftMask, boolean controlMask)
Creates aMoveSelectionCommand
that specifies the number of steps to move directly. Using this constructor will cause the usage of the registeredITraversalStrategy
in theMoveSelectionCommandHandler
while using the specified step size.- Parameters:
direction
- The direction to move to.stepSize
- The number of steps to move in the given direction.shiftMask
- boolean flag to indicate whether the shift key modifier is enabled or notcontrolMask
- boolean flag to indicate whether the control key modifier is enabled or not
-
MoveSelectionCommand
public MoveSelectionCommand(SelectionLayer.MoveDirectionEnum direction, ITraversalStrategy traversalStrategy, boolean shiftMask, boolean controlMask)
- Parameters:
direction
- The direction to move to.traversalStrategy
- the traversal strategy to determine the number of steps to move and the behavior on moving over the bordershiftMask
- boolean flag to indicate whether the shift key modifier is enabled or notcontrolMask
- boolean flag to indicate whether the control key modifier is enabled or not
-
-
Method Detail
-
getDirection
public SelectionLayer.MoveDirectionEnum getDirection()
- Returns:
- The direction to move to.
-
getStepSize
public Integer getStepSize()
- Returns:
- The number of steps to move. Can be
null
.
-
getTraversalStrategy
public ITraversalStrategy getTraversalStrategy()
- Returns:
- The traversal strategy to use for moving.
-
-