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 Details

  • Constructor Details

    • SelectRegionCommandHandler

      public SelectRegionCommandHandler(SelectionLayer selectionLayer)
      Parameters:
      selectionLayer - The SelectionLayer on which this handler should operate.
  • Method Details

    • doCommand

      public boolean doCommand(ILayer targetLayer, SelectRegionCommand command)
      Specified by:
      doCommand in interface ILayerCommandHandler<SelectRegionCommand>
      Parameters:
      targetLayer - the target layer
      command - 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 interface ILayerCommandHandler<SelectRegionCommand>