org.eclipse.nebula.widgets.nattable.selection
Class SelectionLayerTest.StubbedMarkerSelectionModel

java.lang.Object
  extended by org.eclipse.nebula.widgets.nattable.selection.SelectionLayerTest.StubbedMarkerSelectionModel
All Implemented Interfaces:
IMarkerSelectionModel, ISelectionModel
Enclosing class:
SelectionLayerTest

public class SelectionLayerTest.StubbedMarkerSelectionModel
extends Object
implements IMarkerSelectionModel


Constructor Summary
SelectionLayerTest.StubbedMarkerSelectionModel()
           
 
Method Summary
 void addSelection(int columnPosition, int rowPosition)
          Selects a specified cell
 void addSelection(org.eclipse.swt.graphics.Rectangle range)
          Selects the cells of a specified area
 void clearSelection()
          Removes all cell selections
 void clearSelection(int columnPosition, int rowPosition)
          Deselects a specified cell
 void clearSelection(org.eclipse.swt.graphics.Rectangle removedSelection)
          Removes the selection of specified cells
 int[] getFullySelectedColumnPositions(int columnHeight)
           
 int[] getFullySelectedRowPositions(int rowWidth)
           
 org.eclipse.swt.graphics.Point getLastSelectedCell()
           
 org.eclipse.swt.graphics.Rectangle getLastSelectedRegion()
           
 int[] getSelectedColumnPositions()
          Retrieves the columns that have any selected cells
 int getSelectedRowCount()
          Retrieves the number of rows that have any selected cell
 Set<Range> getSelectedRowPositions()
          Retrieves the rows with a valid row position that have any selected cells
 org.eclipse.swt.graphics.Point getSelectionAnchor()
           
 List<org.eclipse.swt.graphics.Rectangle> getSelections()
          Retrieves the cells that are selected
 boolean isCellPositionSelected(int columnPosition, int rowPosition)
          Determines whether a specified cell is selected
 boolean isColumnPositionFullySelected(int columnPosition, int columnHeight)
           
 boolean isColumnPositionSelected(int columnPosition)
          Determines whether a specified column contains any selected cell
 boolean isEmpty()
          Determines whether there are any selected cells
 boolean isMultipleSelectionAllowed()
          Determines whether multiple cells can be selected simultaneously
 boolean isRowPositionFullySelected(int rowPosition, int rowWidth)
           
 boolean isRowPositionSelected(int rowPosition)
          Determines whether a specified row contains any selected cell
 void setLastSelectedCell(org.eclipse.swt.graphics.Point lastSelectedCell)
           
 void setLastSelectedRegion(int x, int y, int width, int height)
          Will copy the information of the parameters to the already existing Rectangle object of last selected region.
 void setLastSelectedRegion(org.eclipse.swt.graphics.Rectangle region)
          Will set the Rectangle object of the last selected region to be the same as the parameter object region.
 void setMultipleSelectionAllowed(boolean multipleSelectionAllowed)
          Sets whether multiple cells can be selected simultaneously
 void setSelectionAnchor(org.eclipse.swt.graphics.Point anchor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectionLayerTest.StubbedMarkerSelectionModel

public SelectionLayerTest.StubbedMarkerSelectionModel()
Method Detail

isMultipleSelectionAllowed

public boolean isMultipleSelectionAllowed()
Description copied from interface: ISelectionModel
Determines whether multiple cells can be selected simultaneously

Specified by:
isMultipleSelectionAllowed in interface ISelectionModel
Returns:
whether multiple cells can be selected simultaneously

setMultipleSelectionAllowed

public void setMultipleSelectionAllowed(boolean multipleSelectionAllowed)
Description copied from interface: ISelectionModel
Sets whether multiple cells can be selected simultaneously

Specified by:
setMultipleSelectionAllowed in interface ISelectionModel
Parameters:
multipleSelectionAllowed - whether multiple cells can be selected simultaneously

addSelection

public void addSelection(int columnPosition,
                         int rowPosition)
Description copied from interface: ISelectionModel
Selects a specified cell

Specified by:
addSelection in interface ISelectionModel
Parameters:
columnPosition - column position of the cell to select
rowPosition - row position of the cell to select

addSelection

public void addSelection(org.eclipse.swt.graphics.Rectangle range)
Description copied from interface: ISelectionModel
Selects the cells of a specified area

Specified by:
addSelection in interface ISelectionModel
Parameters:
range - the position based area to select

clearSelection

public void clearSelection()
Description copied from interface: ISelectionModel
Removes all cell selections

Specified by:
clearSelection in interface ISelectionModel

clearSelection

public void clearSelection(int columnPosition,
                           int rowPosition)
Description copied from interface: ISelectionModel
Deselects a specified cell

Specified by:
clearSelection in interface ISelectionModel
Parameters:
columnPosition - column position of the cell to deselect
rowPosition - row position of the cell to deselect

clearSelection

public void clearSelection(org.eclipse.swt.graphics.Rectangle removedSelection)
Description copied from interface: ISelectionModel
Removes the selection of specified cells

Specified by:
clearSelection in interface ISelectionModel
Parameters:
removedSelection - the position based area to deselect

isEmpty

public boolean isEmpty()
Description copied from interface: ISelectionModel
Determines whether there are any selected cells

Specified by:
isEmpty in interface ISelectionModel
Returns:
whether there are any selected cells

getSelections

public List<org.eclipse.swt.graphics.Rectangle> getSelections()
Description copied from interface: ISelectionModel
Retrieves the cells that are selected

Specified by:
getSelections in interface ISelectionModel
Returns:
the cells that are selected, expressed in position coordinates

isCellPositionSelected

public boolean isCellPositionSelected(int columnPosition,
                                      int rowPosition)
Description copied from interface: ISelectionModel
Determines whether a specified cell is selected

Specified by:
isCellPositionSelected in interface ISelectionModel
Parameters:
columnPosition - column position of the cell to inspect
rowPosition - row position of the cell to inspect
Returns:
whether the specified cell is selected

getSelectedColumnPositions

public int[] getSelectedColumnPositions()
Description copied from interface: ISelectionModel
Retrieves the columns that have any selected cells

Specified by:
getSelectedColumnPositions in interface ISelectionModel
Returns:
the column positions that have any selected cells

isColumnPositionSelected

public boolean isColumnPositionSelected(int columnPosition)
Description copied from interface: ISelectionModel
Determines whether a specified column contains any selected cell

Specified by:
isColumnPositionSelected in interface ISelectionModel
Parameters:
columnPosition - column position to inspect
Returns:
whether the specified column contains any selected cell

getFullySelectedColumnPositions

public int[] getFullySelectedColumnPositions(int columnHeight)
Specified by:
getFullySelectedColumnPositions in interface ISelectionModel
Parameters:
columnHeight - the number of rows in a fully selected column

isColumnPositionFullySelected

public boolean isColumnPositionFullySelected(int columnPosition,
                                             int columnHeight)
Specified by:
isColumnPositionFullySelected in interface ISelectionModel
columnHeight - the number of rows in a fully selected column

getSelectedRowCount

public int getSelectedRowCount()
Description copied from interface: ISelectionModel
Retrieves the number of rows that have any selected cell

Specified by:
getSelectedRowCount in interface ISelectionModel
Returns:
the number of rows that have any selected cell

getSelectedRowPositions

public Set<Range> getSelectedRowPositions()
Description copied from interface: ISelectionModel
Retrieves the rows with a valid row position that have any selected cells

Specified by:
getSelectedRowPositions in interface ISelectionModel
Returns:
the row positions with a valid row position that have any selected cells

isRowPositionSelected

public boolean isRowPositionSelected(int rowPosition)
Description copied from interface: ISelectionModel
Determines whether a specified row contains any selected cell

Specified by:
isRowPositionSelected in interface ISelectionModel
Parameters:
rowPosition - row position to inspect
Returns:
whether the specified row contains any selected cell

getFullySelectedRowPositions

public int[] getFullySelectedRowPositions(int rowWidth)
Specified by:
getFullySelectedRowPositions in interface ISelectionModel
Parameters:
rowWidth - the number of columns in a fully selected row

isRowPositionFullySelected

public boolean isRowPositionFullySelected(int rowPosition,
                                          int rowWidth)
Specified by:
isRowPositionFullySelected in interface ISelectionModel

getSelectionAnchor

public org.eclipse.swt.graphics.Point getSelectionAnchor()
Specified by:
getSelectionAnchor in interface IMarkerSelectionModel
Returns:
point of the anchor expressed in position coordinates

getLastSelectedCell

public org.eclipse.swt.graphics.Point getLastSelectedCell()
Specified by:
getLastSelectedCell in interface IMarkerSelectionModel
Returns:
point of the last selected cell expressed in position coordinates

getLastSelectedRegion

public org.eclipse.swt.graphics.Rectangle getLastSelectedRegion()
Specified by:
getLastSelectedRegion in interface IMarkerSelectionModel
Returns:
rectangle of the last selected region expressed in position coordinates

setSelectionAnchor

public void setSelectionAnchor(org.eclipse.swt.graphics.Point anchor)
Specified by:
setSelectionAnchor in interface IMarkerSelectionModel
Parameters:
anchor - coordinate of the anchor

setLastSelectedCell

public void setLastSelectedCell(org.eclipse.swt.graphics.Point lastSelectedCell)
Specified by:
setLastSelectedCell in interface IMarkerSelectionModel
Parameters:
lastSelectedCell - coordinate of the last selected

setLastSelectedRegion

public void setLastSelectedRegion(org.eclipse.swt.graphics.Rectangle region)
Description copied from interface: IMarkerSelectionModel
Will set the Rectangle object of the last selected region to be the same as the parameter object region.

Specified by:
setLastSelectedRegion in interface IMarkerSelectionModel
Parameters:
region - the last selection position region

setLastSelectedRegion

public void setLastSelectedRegion(int x,
                                  int y,
                                  int width,
                                  int height)
Description copied from interface: IMarkerSelectionModel
Will copy the information of the parameters to the already existing Rectangle object of last selected region.

Specified by:
setLastSelectedRegion in interface IMarkerSelectionModel
Parameters:
x - origin of the last selection position region
y - origin of the last selection position region
width - of the last selection position region
height - of the last selection position region


Copyright © 2014. All rights reserved.