Class SelectRegionCommandHandler
java.lang.Object
org.eclipse.nebula.widgets.nattable.selection.SelectRegionCommandHandler
- All Implemented Interfaces:
ILayerCommandHandler<SelectRegionCommand>
public class SelectRegionCommandHandler
extends Object
implements ILayerCommandHandler<SelectRegionCommand>
Command handler for the
SelectRegionCommand
.- Since:
- 1.6
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
doCommand
(ILayer targetLayer, SelectRegionCommand command) protected void
selectRegion
(org.eclipse.swt.graphics.Rectangle region, boolean withShiftMask, boolean withControlMask, int anchorColumn, int anchorRow) protected Range
selectRegionWithCtrlKey
(org.eclipse.swt.graphics.Rectangle region, int anchorColumn, int anchorRow) Selects a region with CTRL modifier enabled.protected Range
selectRegionWithShiftKey
(org.eclipse.swt.graphics.Rectangle region, int anchorColumn, int anchorRow) Selects a region with SHIFT modifier enabled.
-
Field Details
-
selectionLayer
-
-
Constructor Details
-
SelectRegionCommandHandler
- Parameters:
selectionLayer
- TheSelectionLayer
on which this handler should operate.
-
-
Method Details
-
doCommand
- Specified by:
doCommand
in interfaceILayerCommandHandler<SelectRegionCommand>
- Parameters:
targetLayer
- the target layercommand
- the command- Returns:
- true if the command has been handled, false otherwise
-
selectRegion
protected void selectRegion(org.eclipse.swt.graphics.Rectangle region, boolean withShiftMask, boolean withControlMask, int anchorColumn, int anchorRow) -
selectRegionWithShiftKey
protected Range selectRegionWithShiftKey(org.eclipse.swt.graphics.Rectangle region, int anchorColumn, int anchorRow) Selects a region with SHIFT modifier enabled. That means the selection range is calculated based on the current selection anchor and the corner of the given region that is most away from the anchor.- Parameters:
region
- The region to be selected.anchorColumn
- The column position to which the selection anchor should be moved to or -1 if the calculated anchor column position should be used.anchorRow
- The row position to which the selection anchor should be moved to or -1 if the calculated anchor row position should be used.- Returns:
- The row positions that have gained selection.
-
selectRegionWithCtrlKey
protected Range selectRegionWithCtrlKey(org.eclipse.swt.graphics.Rectangle region, int anchorColumn, int anchorRow) Selects a region with CTRL modifier enabled. That means the current selection is extended by the given region.- Parameters:
region
- The region to be selected.anchorColumn
- The column position to which the selection anchor should be moved to or -1 if the calculated anchor column position should be used.anchorRow
- The row position to which the selection anchor should be moved to or -1 if the calculated anchor row position should be used.- Returns:
- The row positions that have gained selection.
-
getCommandClass
- Specified by:
getCommandClass
in interfaceILayerCommandHandler<SelectRegionCommand>
-