Class
zebkit.ui.BaseList
mixed with <zebkit.util.Position.Metric> <zebkit.ui.HostDecorativeViews> extends <zebkit.ui.Panel> |
<zebkit.ui> |
Base UI list component class that has to be extended with a concrete list component implementation. The list component visualizes list data model (zebkit.data.ListModel).
zebkit.ui.BaseList
([m], [b]
)
Parameters:
-
[m]
<zebkit.data.ListModel | Array>a list model that should be passed as an instance of zebkit.data.ListModel or as an array.
-
[b]
<Boolean>true if the list navigation has to be triggered by pointer cursor moving
protected
|
void | $pointerMoved (x, y) |
protected
|
void | $select (o) |
protected
|
<Integer> | calcMaxItemSize ( ) |
protected
|
void | drawView (g, id, x, y, w, h) |
protected
|
void | drawViewAt (g, id, index) |
protected
|
<Integer> | findSelectable (off, d) |
protected
|
void | fireSelected (prev) |
public | <Integer> | getItemIdxAt (x, y) |
public | <Object> | getItemLocation (i) |
public | <Object> | getItemSize (i) |
public | <Object> | getSelected ( ) |
public | <Object> | getValue ( ) |
public | <Boolean> | isItemSelectable (i) |
public | <Boolean> | isSelected (i) |
public | void | keyTyped (e) |
protected
|
<Integer> | lookupItem (ch) |
public | void | makeItemVisible (index) |
protected
|
<Integer> | pageSize (d) |
protected
|
void | repaintByOffsets (p, n) |
public | void | select (index) |
public | void | setModel (m) |
public | void | setPosition (c) |
public | <Integer> | setValue (v) |
public | void | setViewProvider (v) |
public | void | setViews (views) |
protected
void
$pointerMoved (x, y )
Called when a pointer (pointer or finger on touch screen) is moved to a new location Parameters:
|
protected
void
$select (o )
Select the given list item. The method is called when an item selection is triggered by a user interaction: key board, or pointer Parameters:
|
protected
<Integer>
calcMaxItemSize ( )
Calculate maximal width and maximal height the items in the list have
Returns:
<Integer>
a max items size |
protected
void
drawView (g, id, x, y, w, h )
Draw the given list view element identified by the given id at the specified location. Parameters:
|
protected
void
drawViewAt (g, id, index )
Draw the given list view element identified by the given id on the given list item. Parameters:
|
protected
<Integer>
findSelectable (off, d )
Find a next selectable list item starting from the given offset with the specified direction Parameters:
Returns:
<Integer>
a next selectable item index |
protected
void
fireSelected (prev )
Fire selected event Parameters:
|
public
<Integer>
getItemIdxAt (x, y )
Detect an item by the specified location Parameters:
Returns:
<Integer>
a list item that is located at the given position. -1 if no any list item can be found. |
public
void
keyTyped (e )
Define key typed events handler Parameters:
|
protected
<Integer>
lookupItem (ch )
Lookup a list item buy the given first character Parameters:
Returns:
<Integer>
a position of found list item in the list or -1 if no item is found. |
public
chainable
makeItemVisible (index )
Scroll if necessary the given item to make it visible Parameters:
|
protected
<Integer>
pageSize (d )
The method returns the page size that has to be scroll up or down Parameters:
Returns:
<Integer>
a number of list items to be scrolled |
protected
void
repaintByOffsets (p, n )
Force repainting of the given list items Parameters:
|
public
void
select (index )
Select the given list item Parameters:
|
public
chainable
setModel (m )
Set the list model to be rendered with the list component Parameters:
|
public
chainable
setPosition (c )
Set the given position controller. List component uses position to track virtual cursor. Parameters:
|
public
<Integer>
setValue (v )
Select the specified list item. Parameters:
Returns:
<Integer>
an index of a selected item |
public
chainable
setViewProvider (v )
Set the list items view provider. Defining a view provider allows developers to customize list item rendering. Parameters: |
@Override
zebkit.ui.HostDecorativeViews
public void setViews (views )
Sets the views for the list visual elements. The following elements are supported:
Parameters:
|












public
![]() model
List model |
public
![]() selectedIndex
Currently selected list item index |
selected
Fire when a list item has been selected:
Parameters:
|