Class
caplin.grid

GridRowSelectionModel

The row selection model provides programmatic access to the row selections performed by the user. It is also the mechanism by which the default user interface (via the caplin.grid.decorator.SelectionDecorator decorator) allows user row selection in the first place. An alternative row selection paradigm could be achieved by replacing this decorator with some other decorator.

The methods within this class are cumulative rather than definitive. For example, if you invoke #selectRowRange twice for two distinct row ranges, then both row ranges will be selected. The #deselectAllRows method can be used prior to some other method to create a single definitive selection.

Constructor Summary

Attributes Name and Description
caplin.grid.GridRowSelectionModel(caplin.grid.GridView oGridView)

Constructs a new GridRowSelectionModel with the specified arguments.

Method Summary

Attributes Name and Description
void addRowSelectionListener(caplin.grid.GridRowSelectionModelListener oListener)

Adds a listener to the row selection model, to be communicated of all row selection events.

void deselectAllRows()

Deselect all rows.

void deselectRow(String sSubject)

Deselect the given row.

void deselectRowRange(String sFromSubject, String sToSubject)

Deselect a given row range.

Array getSelectedRows()

Retrieve a list of the currently selected rows.

boolean hasSelectedRows()

Specifies whether there are any rows selected or not.

boolean isSelectedRow(String sSubject)

Determines whether a given row is selected or not.

void removeRowSelectionListener(caplin.grid.GridRowSelectionModelListener oListener)

Remove a previously registered row selection listener.

void selectAllRows()

Select all rows within the entire grid.

void selectRow(String sSubject)

Select the given row.

void selectRowRange(String sFromSubject, String sToSubject)

Select a given row range.

Methods implemented from class caplin.grid.GridDataProviderSnapshotListener:
onGridSnapshotAvailable, onSnapshotAvailable
Methods implemented from class caplin.grid.GridRowModelListener:
onAllDataReceived, onRowContentsChanged, onRowDataReceived, onRowDataRequested, onRowDataUnavailable, onRowModelStateChanged, onRowStructureChanged, onSizeChanged, onStartIndexChanged

Constructor Detail

caplin.grid.GridRowSelectionModel(caplin.grid.GridView oGridView)

Constructs a new GridRowSelectionModel with the specified arguments.

Parameters
caplin.grid.GridView oGridView The grid to which the row selections will apply.

Method Detail

void addRowSelectionListener(caplin.grid.GridRowSelectionModelListener oListener)

Adds a listener to the row selection model, to be communicated of all row selection events.

Parameters
caplin.grid.GridRowSelectionModelListener oListener The object nominating to receive row selection call-backs.

void deselectAllRows()

Deselect all rows.

void deselectRow(String sSubject)

Deselect the given row.

Parameters
String sSubject The subject identifier of the row to be deselected.

void deselectRowRange(String sFromSubject, String sToSubject)

Deselect a given row range.

Parameters
String sFromSubject The subject identifier of the first row to be deselected.
String sToSubject The subject identifier of the last row to be deselected.

Array getSelectedRows()

Retrieve a list of the currently selected rows.

Returns
An array of the subject identifiers for the currently selected rows.

boolean hasSelectedRows()

Specifies whether there are any rows selected or not.

Returns
true if there are no rows selected, and false otherwise.

boolean isSelectedRow(String sSubject)

Determines whether a given row is selected or not.

Parameters
String sSubject The subject identifier of the row in question.
Returns
true if the row is selected, and false otherwise.

void removeRowSelectionListener(caplin.grid.GridRowSelectionModelListener oListener)

Remove a previously registered row selection listener.

Parameters
caplin.grid.GridRowSelectionModelListener oListener The row selection listener to be removed.

void selectAllRows()

Select all rows within the entire grid.

void selectRow(String sSubject)

Select the given row.

Parameters
String sSubject The subject identifier of the row to be selected.

void selectRowRange(String sFromSubject, String sToSubject)

Select a given row range.

Parameters
String sFromSubject The subject identifier of the first row to be selected.
String sToSubject The subject identifier of the last row to be selected.