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
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
theITraversalStrategyconfigured with theMoveSelectionCommandHandleris used and will be asked for the step count - specify steps to move
theITraversalStrategyconfigured with theMoveSelectionCommandHandleris used but modified to return the given step count - specify traversal strategy
the givenITraversalStrategyis used and will be asked for the step count. TheITraversalStrategyconfigured with theMoveSelectionCommandHandlerwill be ignored.
-
Constructor Summary
ConstructorsConstructorDescriptionMoveSelectionCommand(SelectionLayer.MoveDirectionEnum direction, boolean shiftMask, boolean controlMask) Creates aMoveSelectionCommandthat doesn't specify a step count nor anITraversalStrategy.MoveSelectionCommand(SelectionLayer.MoveDirectionEnum direction, Integer stepSize, boolean shiftMask, boolean controlMask) Creates aMoveSelectionCommandthat specifies the number of steps to move directly.MoveSelectionCommand(SelectionLayer.MoveDirectionEnum direction, ITraversalStrategy traversalStrategy, boolean shiftMask, boolean controlMask) -
Method Summary
Modifier and TypeMethodDescriptionMethods inherited from class org.eclipse.nebula.widgets.nattable.selection.command.AbstractSelectionCommand
isControlMask, isShiftMaskMethods inherited from class org.eclipse.nebula.widgets.nattable.command.AbstractContextFreeCommand
cloneCommand, convertToTargetLayer
-
Constructor Details
-
MoveSelectionCommand
public MoveSelectionCommand(SelectionLayer.MoveDirectionEnum direction, boolean shiftMask, boolean controlMask) Creates aMoveSelectionCommandthat doesn't specify a step count nor anITraversalStrategy. Using this constructor will lead to a selection movement that uses theITraversalStrategythat 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 aMoveSelectionCommandthat specifies the number of steps to move directly. Using this constructor will cause the usage of the registeredITraversalStrategyin theMoveSelectionCommandHandlerwhile 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 Details
-
getDirection
- Returns:
- The direction to move to.
-
getStepSize
- Returns:
- The number of steps to move. Can be
null.
-
getTraversalStrategy
- Returns:
- The traversal strategy to use for moving.
-