|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ListFieldCallback
Classes implement this interface to provide callback functionality to handle ListField drawing. A ListField uses a class that implements the ListFieldCallback interface to perform drawing tasks. A ListField must register a class that implements the ListFieldCallback interface using the setCallback method before the class can be used. After registration, When a ListField must display a particular item in its list, it invokes the appropriate methods of the registered callback class.
Method Summary | ||
---|---|---|
void |
drawListRow(ListField listField,
Graphics graphics,
int index,
int y,
int width)
Invoked when a particular row requires painting. |
|
Object |
get(ListField listField,
int index)
Retrieves an item from list. |
|
int |
getPreferredWidth(ListField listField)
Retrieves this list field's preferred width. |
|
int |
indexOfList(ListField listField,
String prefix,
int start)
Retrieves first occurrence of prefix in list. |
Method Detail |
---|
void drawListRow(ListField listField, Graphics graphics, int index, int y, int width)
The graphics context passed to this method represents the entire list, not just the row for repainting. Accordingly, the y parameter indicates how far down in the list the repaint should occur.
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.int getPreferredWidth(ListField listField)
Returns the list field's preferred width for layout purposes. Typically, this width is the same as the width of the widest item in the contained list.
listField
- List field for which to determine preferred width.
Object get(ListField listField, int index)
Provided a list field and a row index, this method returns the object contained in that row.
listField
- List field to search through.index
- Row index containing desired item.
int indexOfList(ListField listField, String prefix, int start)
Provided a list, a string prefix, and a start index, this method
returns the index of the first item that matches against the string
prefix (that is, a string prefix of foo
matches a list item
of foobar
).
If a match can be found between the start index and the end of the list, this method should return the index of that matching item.
If a match can not be found between the start index and the end of
the list, this method should return ListField.getSelectedIndex()
.
If this type of search is not applicable to the list, this method should return -1.
listField
- List field in which to search.prefix
- Prefix to search for.start
- List item at which commence the search.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.