示例#1
0
 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);
 }
示例#2
0
 private void doUpdate() {
   showBusy(
       new Interruptable() {
         public void interrupted() {
           Engine.getEngine().interruptContactsReading();
           refresh();
         }
       });
   Engine.getEngine().updateContacts(this);
 }
示例#3
0
  public ContactsScreen(String id, Resoursable resoursable) {
    super(id, resoursable);
    contacts = new List(getLocalizedText(LocaleUI.CONTACTS_COMMAND_TITLE), List.IMPLICIT);
    selectCommand =
        new Command(getLocalizedText(LocaleUI.CONTACTS_COMMAND_SELECT), Command.SCREEN, 0);
    updateCommand =
        new Command(getLocalizedText(LocaleUI.CONTACTS_COMMAND_UPDATE), Command.SCREEN, 1);
    backCommand = new Command(getLocalizedText(LocaleUI.CONTACTS_COMMAND_BACK), Command.BACK, 0);

    ContactsBean bean = (ContactsBean) Engine.getEngine().getBean(getId());
    if (bean == null) {
      Engine.getEngine().putBean(id, new ContactsBean());
    }
    contacts.addCommand(updateCommand);
    contacts.addCommand(backCommand);
    contacts.setCommandListener(this);
    contacts.setTicker(new Ticker(getLocalizedText(LocaleUI.CONTACTS_TICKER_TEXT)));
    //		addConsole(this.form);
  }
示例#4
0
  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);
  }