Interface ISelectionModel
- All Superinterfaces:
ILayerEventHandler<IStructuralChangeEvent>
- All Known Subinterfaces:
IMarkerSelectionModel,IRowSelectionModel<R>
- All Known Implementing Classes:
MarkerSelectionModelTest.StubbedMarkerSelectionModel,PreserveSelectionModel,RowSelectionModel,SelectionModel,SummaryRowPreserveSelectionModel
Tracks the selections made in the table.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddSelection(int columnPosition, int rowPosition) Selects a specified cellvoidaddSelection(org.eclipse.swt.graphics.Rectangle range) Selects the cells of a specified areavoidRemoves all cell selectionsvoidclearSelection(int columnPosition, int rowPosition) Deselects a specified cellvoidclearSelection(org.eclipse.swt.graphics.Rectangle removedSelection) Removes the selection of specified cellsint[]getFullySelectedColumnPositions(int columnHeight) int[]getFullySelectedRowPositions(int rowWidth) int[]Retrieves the columns that have any selected cellsintRetrieves the number of rows that have any selected cellRetrieves the rows with a valid row position that have any selected cellsList<org.eclipse.swt.graphics.Rectangle>Retrieves the cells that are selectedbooleanisCellPositionSelected(int columnPosition, int rowPosition) Determines whether a specified cell is selectedbooleanisColumnPositionFullySelected(int columnPosition, int columnHeight) booleanisColumnPositionSelected(int columnPosition) Determines whether a specified column contains any selected cellbooleanisEmpty()Determines whether there are any selected cellsbooleanDetermines whether multiple cells can be selected simultaneouslybooleanisRowPositionFullySelected(int rowPosition, int rowWidth) Check if all cells in a row are selected, which means the row is fully selected.booleanisRowPositionSelected(int rowPosition) Determines whether a specified row contains any selected cellvoidsetMultipleSelectionAllowed(boolean multipleSelectionAllowed) Sets whether multiple cells can be selected simultaneouslyMethods inherited from interface org.eclipse.nebula.widgets.nattable.layer.event.ILayerEventHandler
getLayerEventClass, handleLayerEvent
-
Method Details
-
isMultipleSelectionAllowed
boolean isMultipleSelectionAllowed()Determines whether multiple cells can be selected simultaneously- Returns:
- whether multiple cells can be selected simultaneously
-
setMultipleSelectionAllowed
void setMultipleSelectionAllowed(boolean multipleSelectionAllowed) Sets whether multiple cells can be selected simultaneously- Parameters:
multipleSelectionAllowed- whether multiple cells can be selected simultaneously
-
addSelection
void addSelection(int columnPosition, int rowPosition) Selects a specified cell- Parameters:
columnPosition- column position of the cell to selectrowPosition- row position of the cell to select
-
addSelection
void addSelection(org.eclipse.swt.graphics.Rectangle range) Selects the cells of a specified area- Parameters:
range- the position based area to select
-
clearSelection
void clearSelection()Removes all cell selections -
clearSelection
void clearSelection(int columnPosition, int rowPosition) Deselects a specified cell- Parameters:
columnPosition- column position of the cell to deselectrowPosition- row position of the cell to deselect
-
clearSelection
void clearSelection(org.eclipse.swt.graphics.Rectangle removedSelection) Removes the selection of specified cells- Parameters:
removedSelection- the position based area to deselect
-
isEmpty
boolean isEmpty()Determines whether there are any selected cells- Returns:
- whether there are any selected cells
-
getSelections
List<org.eclipse.swt.graphics.Rectangle> getSelections()Retrieves the cells that are selected- Returns:
- the cells that are selected, expressed in position coordinates
-
isCellPositionSelected
boolean isCellPositionSelected(int columnPosition, int rowPosition) Determines whether a specified cell is selected- Parameters:
columnPosition- column position of the cell to inspectrowPosition- row position of the cell to inspect- Returns:
- whether the specified cell is selected
-
getSelectedColumnPositions
int[] getSelectedColumnPositions()Retrieves the columns that have any selected cells- Returns:
- the column positions that have any selected cells
-
isColumnPositionSelected
boolean isColumnPositionSelected(int columnPosition) Determines whether a specified column contains any selected cell- Parameters:
columnPosition- column position to inspect- Returns:
- whether the specified column contains any selected cell
-
getFullySelectedColumnPositions
int[] getFullySelectedColumnPositions(int columnHeight) - Parameters:
columnHeight- the number of rows in a fully selected column
-
isColumnPositionFullySelected
boolean isColumnPositionFullySelected(int columnPosition, int columnHeight) - Parameters:
columnHeight- the number of rows in a fully selected column
-
getSelectedRowCount
int getSelectedRowCount()Retrieves the number of rows that have any selected cell- Returns:
- the number of rows that have any selected cell
-
getSelectedRowPositions
Retrieves the rows with a valid row position that have any selected cells- Returns:
- the row positions with a valid row position that have any selected cells
-
isRowPositionSelected
boolean isRowPositionSelected(int rowPosition) Determines whether a specified row contains any selected cell- Parameters:
rowPosition- row position to inspect- Returns:
- whether the specified row contains any selected cell
-
getFullySelectedRowPositions
int[] getFullySelectedRowPositions(int rowWidth) - Parameters:
rowWidth- the number of columns in a fully selected row
-
isRowPositionFullySelected
boolean isRowPositionFullySelected(int rowPosition, int rowWidth) Check if all cells in a row are selected, which means the row is fully selected.- Parameters:
rowPosition- The row position that should be checked.rowWidth- The number of columns in the row which is needed to determine if the all cells in a row are selected.- Returns:
trueif all cells in a row are selected,falseif not
-