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 theSelectRegionCommand
.- Since:
- 1.6
-
-
Field Summary
Fields Modifier and Type Field Description protected SelectionLayer
selectionLayer
-
Constructor Summary
Constructors Constructor Description SelectRegionCommandHandler(SelectionLayer selectionLayer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
doCommand(ILayer targetLayer, SelectRegionCommand command)
Class<SelectRegionCommand>
getCommandClass()
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 Detail
-
selectionLayer
protected final SelectionLayer selectionLayer
-
-
Constructor Detail
-
SelectRegionCommandHandler
public SelectRegionCommandHandler(SelectionLayer selectionLayer)
- Parameters:
selectionLayer
- TheSelectionLayer
on which this handler should operate.
-
-
Method Detail
-
doCommand
public boolean doCommand(ILayer targetLayer, SelectRegionCommand command)
- 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
public Class<SelectRegionCommand> getCommandClass()
- Specified by:
getCommandClass
in interfaceILayerCommandHandler<SelectRegionCommand>
-
-