com.sybase.uep.bobclient.controls
Class ListControlCallBack

java.lang.Object
  extended by com.sybase.uep.bobclient.controls.ListControlCallBack
All Implemented Interfaces:
net.rim.device.api.ui.component.ListFieldCallback

public class ListControlCallBack
extends java.lang.Object
implements net.rim.device.api.ui.component.ListFieldCallback

List Control Call back class Used by the List Field to update and draw the rows

Author:
tdang

Constructor Summary
ListControlCallBack()
           
 
Method Summary
 void drawListRow(net.rim.device.api.ui.component.ListField listField, net.rim.device.api.ui.Graphics graphics, int index, int y, int width)
          Invoked when a particular row requires painting
 java.lang.Object get(net.rim.device.api.ui.component.ListField listField, int index)
          Retrieves an item from list.
 int getPreferredWidth(net.rim.device.api.ui.component.ListField listField)
          Retrieves this list field's preferred width
 int indexOfList(net.rim.device.api.ui.component.ListField listField, java.lang.String prefix, int start)
          Retrieves first occurence of prefix in list.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListControlCallBack

public ListControlCallBack()
Method Detail

drawListRow

public void drawListRow(net.rim.device.api.ui.component.ListField listField,
                        net.rim.device.api.ui.Graphics graphics,
                        int index,
                        int y,
                        int width)
Invoked when a particular row requires painting

Specified by:
drawListRow in interface net.rim.device.api.ui.component.ListFieldCallback
Parameters:
listField - - List field that requires repainting.
graphics - - Graphics context for the list.
index - - Row index to display.
y - - Distance from the top of the list field at which to start painting.
width - - Width of the field.

get

public java.lang.Object get(net.rim.device.api.ui.component.ListField listField,
                            int index)
Retrieves an item from list.

Specified by:
get in interface net.rim.device.api.ui.component.ListFieldCallback
Parameters:
listField - - List field to search through
index - - Row index containing desired item
Returns:
Object from list.

getPreferredWidth

public int getPreferredWidth(net.rim.device.api.ui.component.ListField listField)
Retrieves this list field's preferred width

Specified by:
getPreferredWidth in interface net.rim.device.api.ui.component.ListFieldCallback
Parameters:
listField - - List field for which to determine preferred width.
Returns:
Preferred width (number of pixels) for the list.

indexOfList

public int indexOfList(net.rim.device.api.ui.component.ListField listField,
                       java.lang.String prefix,
                       int start)
Retrieves first occurence of prefix in list.

Specified by:
indexOfList in interface net.rim.device.api.ui.component.ListFieldCallback
Parameters:
listField - - List field in which to search.
prefix - - Prefix to search for.
start - - List item at which commence the search.
Returns:
Results of the search (see method description).