Class ContactsModel

java.lang.Object
com.codename1.ui.list.DefaultListModel
com.codename1.contacts.ContactsModel
All Implemented Interfaces:
ListModel, MultipleSelectionListModel

public class ContactsModel extends DefaultListModel
This Contacts model is responsible for querying Contacts from the device and to cache the data for faster usage
  • Constructor Details

    • ContactsModel

      public ContactsModel(String... ids)

      Constructor with contacts ids

      Parameters
      • ids: the contact ids we would like this model to handle
  • Method Details

    • setPlaceHolderImage

      public void setPlaceHolderImage(Image placeHolder)

      Sets the Contacts place holder image.

      Parameters
      • placeHolder: image place holder for the contacts
    • getItemAt

      public Object getItemAt(int index)

      Returns the item at the given offset

      Parameters
      • index: an index into this list
      Returns

      the item at the specified index

      Specified by:
      getItemAt in interface ListModel
      Overrides:
      getItemAt in class DefaultListModel
    • addItem

      public void addItem(Object item)

      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:
      addItem in interface ListModel
      Overrides:
      addItem in class DefaultListModel
    • 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:
      removeItem in interface ListModel
      Overrides:
      removeItem in class DefaultListModel