Package javax.microedition.pim

Examples of javax.microedition.pim.Event


        try {
                if (item instanceof BlackBerryContact) {
         
                } else if (item instanceof BlackBerryEvent) {
                  
                  Event event = (Event) item;
                  AppointmentObject ao = new AppointmentObject(event, null);
                 
                  notifyAptReceived(_serviceName, ao);
           
                } else {
View Full Code Here


          try {
            if (newItem instanceof BlackBerryContact) {
       
            } else if (newItem instanceof BlackBerryEvent) {
              
              Event event = (Event) newItem;
              AppointmentObject ao = new AppointmentObject(event, null);
       
                notifyAptReceived(_serviceName, ao);
           
            } else {
View Full Code Here

       try {
              if (item instanceof BlackBerryContact) {
         
              } else if (item instanceof BlackBerryEvent) {
           
              Event event = (Event) item;
            AppointmentObject ao = new AppointmentObject(event, null);
           
          notifyAptReceived(_serviceName, ao);
         
              } else {
View Full Code Here

                if (!programmes[i].isChannelTitle) {
                    startTimes[i] = TimeProcessorImpl.createDateByMinutes(programmes[i].startMinutes).getTime();
                }
            }
            for (; en.hasMoreElements();) {
                final Event event = (Event) en.nextElement();
                long eventDate = event.getDate(Event.START, Event.ATTR_NONE);
                String eventChannelName = event.getString(Event.LOCATION, Event.ATTR_NONE);
                for (int i = 0; i < programmes.length; i++) {
                    if (programmes[i].isChannelTitle) {
                        continue;
                    }
                    if (eventDate == startTimes[i]) {
View Full Code Here

     * @return new Event object
     * @throws PIMException
     */
    protected Event createEventByProgramme(final EventList events, final String channelTitle, final Programme programme)
            throws PIMException {
        final Event event = events.createEvent();
        if (events.isSupportedField(Event.LOCATION))
            event.addString(Event.LOCATION, Event.ATTR_NONE, channelTitle);
        if (events.isSupportedField(Event.START))
            event.addDate(Event.START, Event.ATTR_NONE, TimeProcessorImpl.createDateByMinutes(programme.startMinutes)
                    .getTime());
        if (events.isSupportedField(Event.END))
            event.addDate(Event.END, Event.ATTR_NONE, TimeProcessorImpl.createDateByMinutes(
                    programme.startMinutes + programme.lengthMinutes).getTime());
        if (programme.title != null && events.isSupportedField(Event.SUMMARY))
            event.addString(Event.SUMMARY, Event.ATTR_NONE, programme.title);
        if (programme.description != null && events.isSupportedField(Event.NOTE))
            event.addString(Event.NOTE, Event.ATTR_NONE, programme.description);
        if (events.isSupportedField(Event.ALARM))
            event.addInt(Event.ALARM, Event.ATTR_NONE, 60);
        if (events.maxCategories() != 0 && events.isCategory("TV"))
            event.addToCategory("TV");

        return event;
    }
View Full Code Here

    public synchronized boolean setProgrammeSelection(final String channelTitle, final Programme programme,
            final boolean selection) throws PIMException {
        if (isPIMSupported()) {
            final EventList list = getEventList();
            if (selection) {
                final Event e = createEventByProgramme(list, channelTitle, programme);
                e.commit();
            } else {
                final Enumeration en;
                if (list.maxCategories() != 0) {
                    en = list.itemsByCategory("TV");
                } else {
                    en = list.items();
                }
                long startTime = TimeProcessorImpl.createDateByMinutes(programme.startMinutes).getTime();
                for (; en.hasMoreElements();) {
                    final Event event = (Event) en.nextElement();
                    if (event.getDate(Event.START, Event.ATTR_NONE) == startTime
                            && channelTitle.equals(event.getString(Event.LOCATION, Event.ATTR_NONE))) {
                        list.removeEvent(event);
                    }
                }
            }
        }
View Full Code Here

                Enumeration e;
                int iElement = 0;
                try {
                    e = eventList.items();
                    while( e.hasMoreElements() ) {
                        Event evt = (Event) e.nextElement();
                        AppointmentObject appointment = new AppointmentObject( evt );
                        if( testable != null ) {
                            if( testable.test( appointment ) ) {
                                FindNamespace.insertElementByOrder( found, appointment, orderByField, isAscending );
                                iElement++;
View Full Code Here

            final AppointmentObject ao = c.getAppointmentObject();
            if( ao != null ) {
                ao.update();
            }

            final Event event = c.getEvent();
            final Calendar calendar = c.getCalendar();

            if( event != null ) {
                args = new CalendarArguments( viewArg, event );
            } else if( calendar != null ) {
View Full Code Here

     * @param PIMItem Item that was removed from, added to or updated in the calendar
     * @return void
     */
    private void storeRecord(PIMItem item, char state)
    {
        Event event = (Event)item;
        String uid = null;

        try
        {
            /**
             * The unique ID field is valid only if
             * the event has been added to an EventList
             * at least once in the past. If the Event
             * has not yet been added to a list,
             * the UID returns null
             */
            uid = event.getString(Event.UID, 0);
           
            /**
             * We're actually passing the UID String,
             * the state char, the PIM List casted to Event
             * (the later to retrieve the UID from the
View Full Code Here

     */
    public Record setRecord(Record record, boolean modify) throws DataAccessException {
        try {
            EventList list = (EventList)PIM.getInstance().openPIMList(PIM.EVENT_LIST, PIM.READ_WRITE);

            Event event = getEvent(record.getKey(), list, modify);

            if (event == null) {
                Dialog.inform("Event is null.");
                return null;
            }

            String content = fixTag(record.getUid());

            EventParser parser = ParserFactory.getParserInstance(list, event, modify);
            parser.parseEvent(content);
            event.commit();

            String uid = event.getString(Event.UID, 0);
           
            // Save the event data in cache
            EventCache cache = new EventCache();
            cache.put(uid, parser.getCacheData());
            cache.save();
View Full Code Here

TOP

Related Classes of javax.microedition.pim.Event

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.