private void doAction() { int index = contacts.getSelectedIndex(); ContactsBean bean = (ContactsBean) Engine.getEngine().getBean(getId()); Vector contacts = Engine.getEngine().getContacts(); Contact contact = (Contact) contacts.elementAt(index); bean.setContacts(contact); // Debug.println("Index=" + index + " " + contact.toString()); // TODO: show SMS UIManager.getInstance().show(UIManager.SCREEN_SMS); }
public void show() { contacts.deleteAll(); // contacts.removeCommand(selectCommand); Vector contactslist = Engine.getEngine().getContacts(); if (contactslist.size() > 0) { // contacts.addCommand(selectCommand); contacts.setSelectCommand(selectCommand); } for (Enumeration e = contactslist.elements(); e.hasMoreElements(); ) { Contact c = (Contact) e.nextElement(); contacts.append(c.getContact(), null); } ContactsBean bean = (ContactsBean) Engine.getEngine().getBean(getId()); if (bean.getContact() != null) { int index = contactslist.indexOf(bean.getContact()); if (index > 0) { contacts.setSelectedIndex(index, true); } } getDisplay().setCurrent(contacts); }