|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.lwuit.list.DefaultListModel
public class DefaultListModel
Default implementation of the list model based on a vector of elements
Constructor Summary | |
---|---|
DefaultListModel()
Creates a new instance of DefaultListModel |
|
DefaultListModel(java.lang.Object[] items)
Creates a new instance of DefaultListModel |
|
DefaultListModel(java.util.Vector items)
Creates a new instance of DefaultListModel |
Method Summary | |
---|---|
void |
addDataChangedListener(DataChangedListener l)
Invoked to indicate interest in future change events |
void |
addItem(java.lang.Object item)
Adds the specified item to the end of this list. |
void |
addItemAtIndex(java.lang.Object item,
int index)
Adding an item to list at given index |
void |
addSelectionListener(SelectionListener l)
Invoked to indicate interest in future selection events |
java.lang.Object |
getItemAt(int index)
Returns the item at the given offset |
int |
getSelectedIndex()
Returns the selected list offset |
int |
getSize()
Returns the number of items in the list |
void |
removeAll()
Removes all elements from the model |
void |
removeDataChangedListener(DataChangedListener l)
Invoked to indicate no further interest in future change events |
void |
removeItem(int index)
Removes the item at the specified position in this list. |
void |
removeSelectionListener(SelectionListener l)
Invoked to indicate no further interest in future selection events |
void |
setItem(int index,
java.lang.Object item)
Change the item at the given index |
void |
setSelectedIndex(int index)
Sets the selected list offset can be set to -1 to clear selection |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultListModel()
public DefaultListModel(java.util.Vector items)
items
- the items in the modelpublic DefaultListModel(java.lang.Object[] items)
items
- the items in the modelMethod Detail |
---|
public java.lang.Object getItemAt(int index)
ListModel
getItemAt
in interface ListModel
index
- an index into this list
public int getSize()
ListModel
getSize
in interface ListModel
public int getSelectedIndex()
ListModel
getSelectedIndex
in interface ListModel
public void addItem(java.lang.Object item)
ListModel
addItem
in interface ListModel
item
- the item to be addedpublic void setItem(int index, java.lang.Object item)
index
- the offset for the itemitem
- the value to setpublic void addItemAtIndex(java.lang.Object item, int index)
item
- - the item to addindex
- - the index position in the listpublic void removeItem(int index)
ListModel
removeItem
in interface ListModel
index
- the index of the item to removedpublic void removeAll()
public void setSelectedIndex(int index)
ListModel
setSelectedIndex
in interface ListModel
index
- an index into this listpublic void addDataChangedListener(DataChangedListener l)
ListModel
addDataChangedListener
in interface ListModel
l
- a data changed listenerpublic void removeDataChangedListener(DataChangedListener l)
ListModel
removeDataChangedListener
in interface ListModel
l
- a data changed listenerpublic void addSelectionListener(SelectionListener l)
ListModel
addSelectionListener
in interface ListModel
l
- a selection listenerpublic void removeSelectionListener(SelectionListener l)
ListModel
removeSelectionListener
in interface ListModel
l
- a selection listener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |