/* public PIMBrowser getPimToDo() { if (pimToDo == null) { // write pre-init user code here pimToDo = new PIMBrowser(getDisplay(), PIM.TODO_LIST); pimToDo.setTitle("To Do List"); pimToDo.addCommand(PIMBrowser.SELECT_PIM_ITEM); pimToDo.addCommand(getBackCommand5()); pimToDo.setCommandListener(this); // write post-init user code here } return pimToDo; } */ public Form fullgetToDoList() { Form f = new Form("To Do List"); if (frmToDoList == null) { f.setLayout(new BoxLayout(BoxLayout.Y_AXIS)); toDoList = new List(); pim = PIM.getInstance(); f.addComponent(toDoList); final TextArea searchField = TextField.create(); f.addComponent(searchField); Button searchButton = new Button("Search"); searchButton.setPreferredW(f.getWidth() / 2 - 5); searchButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent evt) { populateToDoList(searchField.getText()); } }); Button clearButton = new Button("Clear"); clearButton.setPreferredW(f.getWidth() / 2 - 5); clearButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent evt) { searchField.setText(""); populateToDoList(""); } }); Container buttonContainer = new Container(); buttonContainer.setLayout(new BorderLayout()); buttonContainer.addComponent(BorderLayout.WEST, searchButton); buttonContainer.addComponent(BorderLayout.EAST, clearButton); f.addComponent(buttonContainer); populateToDoList(searchField.getText()); f.addCommand(mBackCommand); f.addCommandListener(this); // Use setCommandListener() with LWUIT 1.3 or earlier. f.setTransitionInAnimator(Transition3D.createCube(300, false)); f.setTransitionOutAnimator(Transition3D.createCube(300, true)); } return f; }
static int openContacts() { // #ifdef api.pim s_contacts = new JSContact[s_nbContacts + 64]; s_nbContacts = 0; try { s_PIMList = PIM.getInstance().openPIMList(PIM.CONTACT_LIST, PIM.READ_WRITE); Enumeration itemEnum = s_PIMList.items(); while (itemEnum.hasMoreElements()) { try { addContact(s_PIMList, (Contact) itemEnum.nextElement()); } catch (Exception e) { Logger.println("Exception while opening contacts: " + e); } } } catch (Exception e) { Logger.println("Exception while opening list: " + e); } // #endif return s_nbContacts; }
public void run(Banner b) { try { long unDia = 24 * 60 * 60 * 1000; long start = Long.parseLong(b.getFecha()); Date d = new Date(start + unDia); Calendar c = Calendar.getInstance(); c.setTime(d); EventList el = (EventList) PIM.getInstance().openPIMList(PIM.EVENT_LIST, PIM.READ_WRITE); Event e = el.createEvent(); e.addString(Event.SUMMARY, 0, b.getNombre()); e.addString(Event.LOCATION, 0, b.getDireccion()); e.addDate(Event.START, 0, start); if (el.isSupportedField(Event.ALARM)) e.addInt(Event.ALARM, PIMItem.ATTR_NONE, (int) (start - 60000)); Dialog.inform(Strings.AGENDAR_OK + b.getNombre()); } catch (Throwable e) { Dialog.inform(Strings.AGENDAR_ERROR); } }