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.
Constructor Attributes | Constructor Name and Description |
---|---|
Construct a list selection model.
|
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.
|
Author: Jeremy KUHN.
- See:
- zwt.ui.ListBox
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
If this represents a change to the current selection then an event is emitted to notify the change.
- Returns:
- The list selection model event manager
- Returns:
- The selected elements as an array of indices
- Parameters:
- {Integer} int_index
- The index of the element in the data model
- Returns:
- true if the element is selected, false otherwise.
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
- Parameters:
- {zwt.ui.ListSelectionModelEvent} zwt_ui_ListSelectionModelEvent_event
- The list selection model event to dispatch
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
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
- 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