Class Index | File Index

Classes


Class zwt.ui.table.TableSelector


Extends zwt.Object.

A table selector defines the selection behavior in a table. Basically, a user select data in a table by selecting a cell using the keyboard or the mouse. The table relies on a selector to update the selection model based on these user actions.

It also provides a bridge between the view and the model. It actually converts user interaction on the elements in the view to the cells to select and/or deselect in the model.

This default implementation supports standard single and multiple cells selection with standard meta keys behavior. You may want to provide your own implementation to select cells differently.


Defined in: TableSelector.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Construct a table selector.
Field Summary
Field Attributes Field Name and Description
<static>  
zwt.ui.table.TableSelector.MULTIPLE_SELECTION
Indicate a multiple selection mode.
<static>  
zwt.ui.table.TableSelector.SINGLE_SELECTION
Indicate a single selection mode.
Method Summary
Method Attributes Method Name and Description
 
Return the current base column index.
 
Return the current base row index.
 
Return the selection mode of the selector.
 
Return the table associated to the selector.
 
select(int_rowIndex, int_colIndex, boolean_shift, boolean_ctrl)
Update the selection model attached to a table based on the specified row index, column index and set of meta-keys the user may have used.
 
setSelectionMode(int_mode)
Set the selection mode of the selector.
Class Detail
zwt.ui.table.TableSelector()
Construct a table selector.
Author: Jeremy KUHN.
See:
zwt.ui.table.Table
zwt.ui.table.TableSelectionModel
Field Detail
<static> {Integer} zwt.ui.table.TableSelector.MULTIPLE_SELECTION
Indicate a multiple selection mode. Multiple cells can be selected at a time.

<static> {Integer} zwt.ui.table.TableSelector.SINGLE_SELECTION
Indicate a single selection mode. Only one cell can be selected at a time.
Method Detail
{Integer} getBaseColIndex()
Return the current base column index. The base column index represents the index of the last column selected in the Table.

The base index is used as the origin in a group selection (with Shift meta-key).

Returns:
the base column index

{Integer} getBaseRowIndex()
Return the current base row index. The base row index represents the index of the last row selected in the Table.

The base index is used as the origin in a group selection (with Shift meta-key).

Returns:
the base row index

{Integer} getSelectionMode()
Return the selection mode of the selector.

In a zwt.ui.table.TableSelector.SINGLE_SELECTION mode, the selector can only select one cell at time which is the default behavior.

In a zwt.ui.table.TableSelector.MULTI_SELECTION mode, the selector can select multiple cells at time, allowing grouping or non contiguous selections.

Returns:
The selection mode

{zwt.ui.table.Table} getTable()
Return the table associated to the selector.
Returns:
The table

select(int_rowIndex, int_colIndex, boolean_shift, boolean_ctrl)
Update the selection model attached to a table based on the specified row index, column index and set of meta-keys the user may have used. This method is basically called by the table, you should never call it directly.

This method should notify the selection model with the cells to select and/or deselect.

Parameters:
{Integer} int_rowIndex
The index of the row in the view
{Integer} int_colIndex
The index of the column in the view
{Boolean} boolean_shift
true if the Shift meta is active
{Boolean} boolean_ctrl
true if the Ctrl meta is active

setSelectionMode(int_mode)
Set the selection mode of the selector.
Parameters:
{Integer} int_mode
The selection mode to set (one of zwt.ui.table.TableSelector.SINGLE_SELECTION or zwt.ui.table.TableSelector.MULTIPLE_SELECTION)

Documentation generated by JsDoc Toolkit 2.4.0 on Thu Jan 12 2012 02:07:54 GMT+0100 (CET)