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, setSelectedIndicesModifier and TypeMethodDescriptionvoidInvoked to indicate interest in future change eventsvoidaddItemAtIndex(Object item, int index) Adding an item to list at given indexvoidaddSelectedIndices(int... indices) Adds indices to set of selected indices.voidInvoked to indicate interest in future selection eventsprotected voidfireDataChangedEvent(int status, int index) Broadcast a change event to all listenersgetList()Returns the internal list of items which makes traversal using iterators easier.intReturns the selected list offsetint[]Gets the selected indices in this model.intgetSize()Returns the number of items in the listbooleanChecks to see if this list model is in multi-selection mode.voidRemoves all elements from the modelvoidInvoked to indicate no further interest in future change eventsvoidremoveSelectedIndices(int... indices) Removes indices from the set of selected indices.voidInvoked to indicate no further interest in future selection eventsvoidChange the item at the given indexvoidsetMultiSelectionMode(boolean multiSelectionMode) Enables or disables multi-selection mode.voidsetSelectedIndex(int index) Sets the selected list offset can be set to -1 to clear selectionvoidsetSelectedIndices(int... indices) For use with multi-selection mode.Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()booleanIndicates whether some other object is "equal to" this one.final ClassgetClass()Returns the runtime class of an object.inthashCode()Returns a hash code value for the object.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.toString()Returns a string representation of the object.final voidwait()Causes current thread to wait until another thread invokes the method or the method for this object.final voidwait(long timeout) Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.final voidwait(long timeout, int nanos) Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
-
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
-