Class Index | File Index

Classes


Class zwt.ui.ListModel


Extends zwt.ui.Object.

A list model holds the elements displayed in a list.

Basically the model is queried by the list to get the elements to display.

This implementation uses an array to store the list elements objects.


Defined in: ListModel.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Construct a list box.
Method Summary
Method Attributes Method Name and Description
 
addElements(array_elements)
Add the specified elements at the end of to the model.
 
getElementAt(int_index)
Return the element at the specified location.
 
Return the number of elements in the model.
 
Return the elements in the model.
 
Return the list model event manager attached to the model.
 
insertElements(array_elements, int_index)
Insert the specified elements at the specified location in the model.
 
onEvent(zwt_ui_ListModelEvent_event)
Dispatch the specified list model event to the appropriate event manager.
 
removeElementsAt(int_index, int_length)
Remove elements from the model starting at the specified location.
 
setElementAt(object_element, int_index)
Set the element at the specified location.
 
setElements(array_elements)
Change the elements in the model to be the specified array of elements.
Class Detail
zwt.ui.ListModel()
Construct a list box.
Author: Jeremy KUHN.
See:
zwt.ui.ListBox
Method Detail
addElements(array_elements)
Add the specified elements at the end of to the model.
Parameters:
{Array} array_elements
The element to add

{Object} getElementAt(int_index)
Return the element at the specified location.
Parameters:
{Integer} int_index
The location of the element to return
Returns:
The element object

{Integer} getElementCount()
Return the number of elements in the model.
Returns:
The length of the model

{Object[]} getElements()
Return the elements in the model.

The return array should never be modified directly as it is managed by the model.

Returns:
An array of elements

{zwt.ui.list.ListModelEventManager} getListModelEventManager()
Return the list model event manager attached to the model.
Returns:
The list model event manager

insertElements(array_elements, int_index)
Insert the specified elements at the specified location in the model.
Parameters:
{Array} array_elements
The elements to insert
{Integer} int_index
The location where to insert the elements

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

removeElementsAt(int_index, int_length)
Remove elements from the model starting at the specified location.
Parameters:
{Integer} int_index
The location where to start removing elements
{Integer} int_length
The number of elements to remove

setElementAt(object_element, int_index)
Set the element at the specified location.
Parameters:
{Object} object_element
The element to set
{Integer} int_index
The location of the element to set

setElements(array_elements)
Change the elements in the model to be the specified array of elements.
Parameters:
{Object[]} array_elements
The elements to set

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Nov 09 2011 19:29:08 GMT+0100 (CET)