Class Index | File Index

Classes


Class zwt.ui.ListSelectionModel


Extends zwt.Object.

A list selection model represents the current state of the selection for a list.

Every methods that modify the selection use an array of indices in the data model. In the context of the list selection model, elements are identified by their indices in the data model.


Defined in: ListSelectionModel.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Construct a list selection model.
Method Summary
Method Attributes Method Name and Description
 
addSelection(array_elements, boolean_exclusive)
Add the set of elements in the specified array of elements to the selection.
 
Change the selection to the empty set.
 
Return the list selection model event manager attached to the model.
 
Return the selected elements.
 
isElementSelected(int_index)
Determine whether the specified element is selected.
 
isSelectable(int_index)
Determine whether the specified cell is selectable.
 
onEvent(zwt_ui_ListSelectionModelEvent_event)
Dispatch the specified list selection model event to the appropriate event manager.
 
removeSelection(array_elements)
Remove the set of elements in the specified array of elements from the selection.
 
setSelection(array_elements, boolean_exclusive)
Change the selection to be the set of elements in the specified array of elements.
 
shiftElements(array_elements, boolean_remove)
Shift the element indices of current selection.
Class Detail
zwt.ui.ListSelectionModel()
Construct a list selection model.
Author: Jeremy KUHN.
See:
zwt.ui.ListBox
Method Detail
addSelection(array_elements, boolean_exclusive)
Add the set of elements in the specified array of elements to the selection.

If this selection is exclusive, then the intersection of the current selection and the new elements in the array of elements is removed from the selection.

If this represents a change to the current selection then an event is emitted to notify the change.

Parameters:
{Integer[]} array_elements
An array of elements
{Boolean} boolean_exclusive
If true, the selection is exclusive

clearSelection()
Change the selection to the empty set.

If this represents a change to the current selection then an event is emitted to notify the change.


{zwt.ui.ListSelectionModelEventManager} getListSelectionModelEventManager()
Return the list selection model event manager attached to the model.
Returns:
The list selection model event manager

{Integer[]} getSelectedElements()
Return the selected elements.
Returns:
The selected elements as an array of indices

{Boolean} isElementSelected(int_index)
Determine whether the specified element is selected.
Parameters:
{Integer} int_index
The index of the element in the data model
Returns:
true if the element is selected, false otherwise.

{Boolean} isSelectable(int_index)
Determine whether the specified cell is selectable.

This method always returns true by default. You may override this method to make element unselectable.

Parameters:
{Integer} int_index
The index of the element in the data model
Returns:
true if the element is selectable, false otherwise

onEvent(zwt_ui_ListSelectionModelEvent_event)
Dispatch the specified list selection model event to the appropriate event manager.
Parameters:
{zwt.ui.ListSelectionModelEvent} zwt_ui_ListSelectionModelEvent_event
The list selection model event to dispatch

removeSelection(array_elements)
Remove the set of elements in the specified array of elements from the selection.

If this represents a change to the current selection then an event is emitted to notify the change.

Parameters:
{Integer[]} array_elements
An array of elements

setSelection(array_elements, boolean_exclusive)
Change the selection to be the set of elements in the specified array of elements.

If this selection is exclusive, then the intersection of the current selection and the new elements is removed from the selection.

If this represents a change to the current selection then an event is emitted to notify the change.

Parameters:
{Integer[]} array_elements
An array of elements
{Boolean} boolean_exclusive
If true, the selection is exclusive

shiftElements(array_elements, boolean_remove)
Shift the element indices of current selection. This is called to sync the selection model with a corresponding change in the data model.
Parameters:
{Integer[]} array_elements
the list of elements to consider for the shift
{Boolean} boolean_remove
If true, remove from the element indices, otherwise add to the element indices

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