Class ContactsModel
java.lang.Object
com.codename1.ui.list.DefaultListModel
com.codename1.contacts.ContactsModel
- All Implemented Interfaces:
ListModel, MultipleSelectionListModel
This Contacts model is responsible for querying Contacts from the device
and to cache the data for faster usage
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the specified item to the end of this list.getItemAt(int index) Returns the item at the given offsetvoidremoveItem(int index) Removes the item at the specified position in this list.voidsetPlaceHolderImage(Image placeHolder) Sets the Contacts place holder image.Methods inherited from class DefaultListModel
addDataChangedListener, addItemAtIndex, addSelectedIndices, addSelectionListener, fireDataChangedEvent, getList, getSelectedIndex, getSelectedIndices, getSize, isMultiSelectionMode, removeAll, removeDataChangedListener, removeSelectedIndices, removeSelectionListener, setItem, setMultiSelectionMode, setSelectedIndex, setSelectedIndices
-
Constructor Details
-
ContactsModel
Constructor with contacts ids
Parameters
ids: the contact ids we would like this model to handle
-
-
Method Details
-
setPlaceHolderImage
Sets the Contacts place holder image.
Parameters
placeHolder: image place holder for the contacts
-
getItemAt
Returns the item at the given offset
Parameters
index: an index into this list
Returns
the item at the specified index
- Specified by:
getItemAtin interfaceListModel- Overrides:
getItemAtin classDefaultListModel
-
addItem
Adds the specified item to the end of this list. An optional operation for mutable lists, it can throw an unsupported operation exception if a list model is not mutable.
Parameters
item: the item to be added
- Specified by:
addItemin interfaceListModel- Overrides:
addItemin classDefaultListModel
-
removeItem
public void removeItem(int index) Removes the item at the specified position in this list.
Parameters
index: the index of the item to removed
- Specified by:
removeItemin interfaceListModel- Overrides:
removeItemin classDefaultListModel
-