Java Reference
In-Depth Information
}
}
else if (ev.getSource() == exitButton) {
destroyApp(true); // clean up
notifyDestroyed();
}
else if (ev.getSource() == editButton || ev.getSource() ==
deleteButton) {
int index = list.getSelectedIndex();
if (index == -1)
return;
Contact c = getContact((String) uids.elementAt(index));
if (ev.getSource() == deleteButton) {
contactList.deleteElement(c);
list.remove(index);
uids.removeElementAt(index);
}
else if (contactDialog.edit(c, getLabel(c))) {
list.replaceItem(getLabel(c), index);
}
}
}
public void pauseApp() {
}
public void startApp() {
frame.show();
}
public void destroyApp(boolean uncond) {
contactList.close();
}
}
What Is Missing?
The PimDemo sample application shows basic access to the PIM API, but for a real PIM application, a
lot of functionality is missing. For example, categories are not supported, and the dialog shows only a
fraction of the fields available. Event and to-do entries are not supported at all. Field types other than
string and multityped fields are not supported. The contact list is not sorted, and a search function is
missing. The delete button lacks a confirm dialog.
Use the example as a starting point for your own ideas and extensions, and feel free to reuse the code in
your own applications.
Summary
In this chapter, you learned about the general design of the PIM API that is included in PDAP.
You know about the different kinds of PIMLists and PIMElements . Moreover, you are
familiar with the concept of the vCard and the vCalendar, you are able to create contact cards and
calendar entries and you know how to store them in a list, and how to use the PIM API to create a
PDAP application using this specific API.
 
Search WWH ::




Custom Search