|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ListModel
Represents the data structure of the list, thus allowing a list to represent any potential data source by referencing different implementations of this interface. E.g. a list model can be implemented in such a way that it retrieves data directly from storage (although caching would be recommended).
It is the responsibility of the list to notify observers (specifically the view
List
of any changes to its state (items removed/added/changed etc.)
thus the data would get updated on the view.
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 |
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 |
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 |
setSelectedIndex(int index)
Sets the selected list offset can be set to -1 to clear selection |
Method Detail |
---|
java.lang.Object getItemAt(int index)
index
- an index into this list
int getSize()
int getSelectedIndex()
void setSelectedIndex(int index)
index
- an index into this listvoid addDataChangedListener(DataChangedListener l)
l
- a data changed listenervoid removeDataChangedListener(DataChangedListener l)
l
- a data changed listenervoid addSelectionListener(SelectionListener l)
l
- a selection listenervoid removeSelectionListener(SelectionListener l)
l
- a selection listenervoid addItem(java.lang.Object item)
item
- the item to be addedvoid removeItem(int index)
index
- the index of the item to removed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |