|
jMobileCore toolkit | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jmobilecore.ui.core.Component
com.jmobilecore.ui.core.Label
com.jmobilecore.ui.core.List
public class List
The List
component presents the user with a scrolling list of items.
Field Summary | |
---|---|
EventListener |
eventListener
The event listener to receive events from this list. |
protected java.util.Vector |
items
A vector created to contain items which will become part of the List. |
protected SoftKey |
leftKey
The left soft key for the list screen |
ListScreen |
listScreen
This screen displays list of values for the current List. |
protected SoftKey |
rightKey
The right soft key for the list screen |
protected int |
selected
The index of selected item. |
protected Label |
title
The title for the list screen |
Fields inherited from class com.jmobilecore.ui.core.Label |
---|
text |
Fields inherited from class com.jmobilecore.ui.core.Component |
---|
alignment, background, CENTER, focusable, focusedBackground, focusedForeground, font, foreground, height, isCompletelyVisible, isFocused, isVisible, LEFT, parentScreen, RIGHT, screenY, valid, width |
Constructor Summary | |
---|---|
List()
Creates a new scrolling list. |
|
List(java.lang.String label)
Creates a new scrolling list with the specified description |
Method Summary | |
---|---|
void |
add(ListComponent item)
Adds the specified item to the end of scrolling list. |
void |
add(ListComponent item,
int index)
Adds the specified string as ListLabel to the the scrolling list
at the position indicated by the index. |
void |
add(java.lang.String text)
Adds the specified string as ListLabel to the end of scrolling list. |
void |
add(java.lang.String text,
int index)
Adds the specified string as ListLabel to the the scrolling list
at the position indicated by the index. |
ListScreen |
createListScreen()
Creates new screen cantaining the list of list values. |
void |
deselect(int index)
Deselects the item at the specified index. |
void |
destructor()
Default destructor. |
ListComponent |
getComponent(int index)
Gets the item associated with the specified index. |
java.lang.String |
getItem(int index)
Gets the textual representation of an item associated with the specified index. |
int |
getItemCount()
Gets the number of items in the list. |
ListComponent |
getSelectedComponent()
Gets the selected item on this scrolling list. |
int |
getSelectedIndex()
Gets the index of the selected item on the list, |
java.lang.String |
getSelectedItem()
Gets the selected item on this scrolling list. |
boolean |
isIndexSelected(int index)
Determines if the specified item in this scrolling list is selected. |
protected boolean |
keyPressed(int keyCode)
Responds to key presses when the list has focus. |
void |
remove(int index)
Remove the item at the specified position from this scrolling list. |
void |
remove(ListComponent item)
Removes the first occurrence of an item from the list. |
void |
removeAll()
Removes all items from this list. |
void |
replaceItem(java.lang.String newValue,
int index)
Replaces the item at the specified index in the scrolling list with the new string. |
void |
select(int index)
Selects the item at the specified index in the scrolling list. |
void |
setListScreen(Label title,
SoftKey leftKey,
SoftKey rightKey)
|
void |
setListScreen(java.lang.String titleText,
java.lang.String backKeyText,
java.lang.String selectKeyText)
|
Methods inherited from class com.jmobilecore.ui.core.Label |
---|
createTitleLabel, getText, paint, setText |
Methods inherited from class com.jmobilecore.ui.core.Component |
---|
getBackground, getFont, getForeground, getHeight, getWidth, invalidate, isFocusOwner, keyReleased, keyRepeated, paintBackground, pointerDragged, pointerPressed, pointerReleased, prepareForeground, releaseFocus, requestFocus, setFont, setHeight |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public EventListener eventListener
protected java.util.Vector items
protected SoftKey leftKey
SoftKey
,
ListScreen
public ListScreen listScreen
protected SoftKey rightKey
SoftKey
,
ListScreen
protected int selected
-1
then no items is selected
protected Label title
ListScreen
Constructor Detail |
---|
public List()
public List(java.lang.String label)
Label.setText(java.lang.String)
,
Label.getText()
Method Detail |
---|
public void add(ListComponent item)
item
- the item to be addedpublic void add(ListComponent item, int index)
ListLabel
to the the scrolling list
at the position indicated by the index. The index is zero-based.
item
- the item to be addedindex
- the position at which to add the itempublic void add(java.lang.String text)
ListLabel
to the end of scrolling list.
text
- the string to be addedpublic void add(java.lang.String text, int index)
ListLabel
to the the scrolling list
at the position indicated by the index. The index is zero-based.
text
- the string to be addedindex
- the position at which to add the itempublic ListScreen createListScreen()
public void deselect(int index)
index
- the position of the item to deselectpublic void destructor()
destructor
in class Component
public ListComponent getComponent(int index)
index
- the position of the item
public java.lang.String getItem(int index)
index
- the position of the item
public int getItemCount()
public ListComponent getSelectedComponent()
null
if no item is selectedselect(int)
,
deselect(int)
,
isIndexSelected(int)
public int getSelectedIndex()
select(int)
,
deselect(int)
,
isIndexSelected(int)
public java.lang.String getSelectedItem()
null
if no item is selectedselect(int)
,
deselect(int)
,
isIndexSelected(int)
public boolean isIndexSelected(int index)
index
- the item to be checked
true
if the specified item has been
selected; false
otherwiseselect(int)
,
deselect(int)
protected boolean keyPressed(int keyCode)
PlatformCanvas.KEY_ENTER
button is pressed creates new screen
that displays the list of list values
keyPressed
in class Component
keyCode
- The pressed key.public void remove(int index)
index
- the index of the item to deletepublic void remove(ListComponent item)
item
- the item to remove from the listpublic void removeAll()
public void replaceItem(java.lang.String newValue, int index)
newValue
- a new string to replace an existing itemindex
- the position of the item to replacepublic void select(int index)
index
- the position of the item to selectgetSelectedItem()
,
deselect(int)
,
isIndexSelected(int)
public void setListScreen(Label title, SoftKey leftKey, SoftKey rightKey)
public void setListScreen(java.lang.String titleText, java.lang.String backKeyText, java.lang.String selectKeyText)
|
jMobileCore toolkit | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |