Examples of RepeatRule


Examples of javax.microedition.pim.RepeatRule

                addItem( new ScriptField( FIELD_UID, "", ScriptField.TYPE_STRING, true, false ) );
            }

            // recurrence
            BlackBerryToDo bbTodo = (BlackBerryToDo) _todo;
            RepeatRule repeat = bbTodo.getRepeat();
            if( repeat != null ) {
                RecurrenceObject recurObject = new RecurrenceObject();

                int count = PIMUtils.getRepeatRuleInt( repeat, RepeatRule.COUNT );
                recurObject.getItem( RecurrenceObject.FIELD_COUNT ).setValue( new Integer( count ) );
View Full Code Here

Examples of javax.microedition.pim.RepeatRule

            // recurrence
            RecurrenceObject recurObject = (RecurrenceObject) _outer.getItem( TaskObject.FIELD_RECURRENCE ).getValue();
            if( recurObject != null ) {
                BlackBerryToDo bbTodo = (BlackBerryToDo) _todo;
                RepeatRule repeat = new RepeatRule();

                // count
                i = (Integer) recurObject.getItem( RecurrenceObject.FIELD_COUNT ).getValue();
                int count = i.intValue();
                if( count >= 0 ) {
                    repeat.setInt( RepeatRule.COUNT, count );
                }

                // frequency
                i = (Integer) recurObject.getItem( RecurrenceObject.FIELD_FREQUENCY ).getValue();
                int freq = i.intValue();
                repeat.setInt( RepeatRule.FREQUENCY, RecurrenceObject.frequencyToRepeatRule( freq ) );

                // interval
                i = (Integer) recurObject.getItem( RecurrenceObject.FIELD_INTERVAL ).getValue();
                int interval = i.intValue();
                if( interval > 0 ) {
                    repeat.setInt( RepeatRule.INTERVAL, interval );
                }

                // end
                d = (Date) recurObject.getItem( RecurrenceObject.FIELD_END ).getValue();
                if( d != null ) {
                    long endTime = d.getTime();
                    repeat.setDate( RepeatRule.END, endTime );
                }

                // monthInYear
                i = (Integer) recurObject.getItem( RecurrenceObject.FIELD_MONTHINYEAR ).getValue();
                int monthInYear = i.intValue();
                if( monthInYear > 0 ) {
                    repeat.setInt( RepeatRule.MONTH_IN_YEAR, monthInYear );
                }

                // weekInMonth
                i = (Integer) recurObject.getItem( RecurrenceObject.FIELD_WEEKINMONTH ).getValue();
                int weekInMonth = i.intValue();
                if( weekInMonth > 0 ) {
                    repeat.setInt( RepeatRule.WEEK_IN_MONTH, weekInMonth );
                }

                // dayInWeek
                i = (Integer) recurObject.getItem( RecurrenceObject.FIELD_DAYINWEEK ).getValue();
                int dayInWeek = i.intValue();
                if( dayInWeek > 0 ) {
                    repeat.setInt( RepeatRule.DAY_IN_WEEK, dayInWeek );
                }

                // dayInMonth
                i = (Integer) recurObject.getItem( RecurrenceObject.FIELD_DAYINMONTH ).getValue();
                int dayInMonth = i.intValue();
                if( dayInMonth > 0 ) {
                    repeat.setInt( RepeatRule.DAY_IN_MONTH, dayInMonth );
                }

                // dayInYear
                i = (Integer) recurObject.getItem( RecurrenceObject.FIELD_DAYINYEAR ).getValue();
                int dayInYear = i.intValue();
                if( dayInYear > 0 ) {
                    repeat.setInt( RepeatRule.DAY_IN_YEAR, dayInYear );
                }

                bbTodo.setRepeat( repeat );
            }
View Full Code Here

Examples of javax.microedition.pim.RepeatRule

            // End
            Date end = _that.getEnd();

            // Recurrence
            RecurrenceObject recurrenceObj = _that.getRecurrence();
            RepeatRule repeatRule = null;

            if( recurrenceObj != null ) {
                repeatRule = new RepeatRule();
                Integer i;
                Date d;

                // count
                i = (Integer) recurrenceObj.getItem( RecurrenceObject.FIELD_COUNT ).getValue();
                int count = i.intValue();
                if( count >= 0 ) {
                    repeatRule.setInt( RepeatRule.COUNT, count );
                }

                // frequency
                i = (Integer) recurrenceObj.getItem( RecurrenceObject.FIELD_FREQUENCY ).getValue();
                int freq = i.intValue();
                repeatRule.setInt( RepeatRule.FREQUENCY, RecurrenceObject.frequencyToRepeatRule( freq ) );

                // interval
                i = (Integer) recurrenceObj.getItem( RecurrenceObject.FIELD_INTERVAL ).getValue();
                int interval = i.intValue();
                if( interval > 0 ) {
                    repeatRule.setInt( RepeatRule.INTERVAL, interval );
                }

                // end
                d = (Date) recurrenceObj.getItem( RecurrenceObject.FIELD_END ).getValue();
                if( d != null ) {
                    long endTime = d.getTime();
                    repeatRule.setDate( RepeatRule.END, endTime );
                }

                // monthInYear
                i = (Integer) recurrenceObj.getItem( RecurrenceObject.FIELD_MONTHINYEAR ).getValue();
                int monthInYear = i.intValue();
                if( monthInYear > 0 ) {
                    repeatRule.setInt( RepeatRule.MONTH_IN_YEAR, monthInYear );
                }

                // weekInMonth
                i = (Integer) recurrenceObj.getItem( RecurrenceObject.FIELD_WEEKINMONTH ).getValue();
                int weekInMonth = i.intValue();
                if( weekInMonth > 0 ) {
                    repeatRule.setInt( RepeatRule.WEEK_IN_MONTH, weekInMonth );
                }

                // dayInWeek
                i = (Integer) recurrenceObj.getItem( RecurrenceObject.FIELD_DAYINWEEK ).getValue();
                int dayInWeek = i.intValue();
                if( dayInWeek > 0 ) {
                    repeatRule.setInt( RepeatRule.DAY_IN_WEEK, dayInWeek );
                }

                // dayInMonth
                i = (Integer) recurrenceObj.getItem( RecurrenceObject.FIELD_DAYINMONTH ).getValue();
                int dayInMonth = i.intValue();
                if( dayInMonth > 0 ) {
                    repeatRule.setInt( RepeatRule.DAY_IN_MONTH, dayInMonth );
                }

                // dayInYear
                i = (Integer) recurrenceObj.getItem( RecurrenceObject.FIELD_DAYINYEAR ).getValue();
                int dayInYear = i.intValue();
                if( dayInYear > 0 ) {
                    repeatRule.setInt( RepeatRule.DAY_IN_YEAR, dayInYear );
                }
            }

            // Reminder
            ReminderObject reminderObj = _that.getReminder();

            // Attendees
            AttendeeObject[] attendees = _that.getAttendees();

            // FreeBusy
            int freeBusy = _that.getFreeBusy();

            // AllDay
            boolean allday = _that.isAllDay();

            // Create a new appointment

            EventList eventList;

            if( _serviceName.length() > 0 ) {
                eventList = (EventList) PIM.getInstance().openPIMList( PIM.EVENT_LIST, PIM.READ_WRITE, _serviceName );
            } else {
                eventList = (EventList) PIM.getInstance().openPIMList( PIM.EVENT_LIST, PIM.READ_WRITE );
            }

            if( _event == null )
                _event = eventList.createEvent();

            if( _event.countValues( Event.LOCATION ) > 0 ) {
                if( location.length() > 0 ) {
                    _event.setString( Event.LOCATION, 0, Event.ATTR_NONE, location );
                } else {
                    _event.removeValue( Event.LOCATION, 0 );
                }
            } else {
                if( location.length() > 0 ) {
                    _event.addString( Event.LOCATION, Event.ATTR_NONE, location );
                }
            }

            if( _event.countValues( Event.SUMMARY ) > 0 ) {
                if( summary.length() > 0 ) {
                    _event.setString( Event.SUMMARY, 0, Event.ATTR_NONE, summary );
                } else {
                    _event.removeValue( Event.SUMMARY, 0 );
                }
            } else {
                if( summary.length() > 0 ) {
                    _event.addString( Event.SUMMARY, Event.ATTR_NONE, summary );
                }
            }

            if( _event.countValues( Event.NOTE ) > 0 ) {
                if( note.length() > 0 ) {
                    _event.setString( Event.NOTE, 0, Event.ATTR_NONE, note );
                } else {
                    _event.removeValue( Event.NOTE, 0 );
                }
            } else {
                if( note.length() > 0 ) {
                    _event.addString( Event.NOTE, Event.ATTR_NONE, note );
                }
            }

            // patch for compensating the one day offset in the calendar for all 6.0 simulator bundles, for all-day events and
            // WEEKLY and MONTHLY appointments
            String softwareVersion = DeviceInfo.getSoftwareVersion();
            if( softwareVersion.startsWith( SOFTWARE_VERSION_SIX ) ) {
                if( allday ) {
                    adjustDates( start, end );
                } else if( repeatRule != null ) {
                    int frequency = repeatRule.getInt( RepeatRule.FREQUENCY );
                    if( frequency == RepeatRule.WEEKLY || frequency == RepeatRule.MONTHLY ) {
                        adjustDates( start, end );
                    }
                }
            } // this temporary patch should be removed when the one-day offset bug gets fixed in the Java APIs
View Full Code Here

Examples of javax.microedition.pim.RepeatRule

    private void appendRecurrenceInformation(StringBuffer eventBuffer) {

        int noEnd = 1;//so 'true' is <NoEndDate>1</NoEndDate>
        int r = 0;//value for the <IsRecurring> SIF-E element
       
        RepeatRule rule = event.getRepeat();
       
        if (rule == null) {
           
            /*
             * if there isn't any RepeatRule object
             * no recurrence is set:
             * <IsRecurring>0</IsRecurring>
             */
            r = 0;
            eventBuffer.append("<" + IS_RECURRING + ">" +
                               r +
                               "</" + IS_RECURRING + ">");
        } else {
           
            /*
             * if a RepeatRule object exists,
             * then we have to build the appropriate
             * SIF-E element (<IsRecurring>1</IsRecurring>)
             * and to extract all available recurrence
             * information from that object
             */
            r = 1;//appointment is recurring
            eventBuffer.append("<" + IS_RECURRING + ">" +
                               r +
                               "</" + IS_RECURRING + ">");
           
            int[] fieldsArray = rule.getFields();
           
           
            //DEBUG
            StaticDataHelper.log("[DEBUG]Fields in RepeatRule object:");
            for (int i = 0; i < fieldsArray.length; i++) {
                StaticDataHelper.log(i + " -> " + fieldsArray[i]);
            }
           
           
            for (int i = 0; i < fieldsArray.length; i++) {
               
                StaticDataHelper.log("[DEBUG]" + i + " --> " + fieldsArray[i]);
                switch (fieldsArray[i]) {
                   
                    //<RecurrenceType>
                    case RepeatRule.FREQUENCY://0
                    StaticDataHelper.log("[DEBUG]Found FREQUENCY (" + fieldsArray[i] + ")");
                   
                        int type = 0;
                       
                        //OlRecurrenceType
                        switch (rule.getInt(RepeatRule.FREQUENCY)) {
                            case RepeatRule.DAILY:
                                type = 0;//olRecursDaily
                                break;
                            case RepeatRule.WEEKLY:
                                type = 1;//olRecursWeekly
                                break;
                            case RepeatRule.MONTHLY:
                                try {
                                    rule.getInt(RepeatRule.WEEK_IN_MONTH);
                                } catch (FieldEmptyException f) {
                                    type = 2;//olRecursMonthly
                                    break;
                                }
                                type = 3;//olRecursMonthlyNth
                                break;
                            case RepeatRule.YEARLY:
                                try {
                                    rule.getInt(RepeatRule.WEEK_IN_MONTH);
                                } catch (FieldEmptyException f) {
                                    type = 5;//olRecursYearly
                                    break;
                                }
                                type = 6;//olRecursYearlyNth
                                break;
                        }
                        eventBuffer.append("<" + RECURRENCE_TYPE + ">" +
                                           type +
                                           "</" + RECURRENCE_TYPE + ">");
                        break;
                   
                    //<Interval>
                    case RepeatRule.INTERVAL://128
                    StaticDataHelper.log("[DEBUG]Found INTERVAL (" + fieldsArray[i] + ")");
                   
                        int interval = rule.getInt(RepeatRule.INTERVAL);
                        eventBuffer.append("<" + INTERVAL + ">" +
                                           interval +
                                           "</" + INTERVAL + ">");
                        break;
                   
                    //<PatternEndDate>
                    case RepeatRule.END://64
                    StaticDataHelper.log("[DEBUG]Found END (" + fieldsArray[i] + ")");
                   
                        long endDate = rule.getDate(RepeatRule.END);

                        SimpleDateFormat formatter = new SimpleDateFormat(DATETIME_FORMAT_UTC);
                        String formattedDate = formatter.formatLocal(endDate);
                       
                        //e.g. <PatternEndDate>20080504T150000Z</PatternEndDate>
                        eventBuffer.append("<" + PATTERN_END_DATE + ">" +
                                           formattedDate +
                                           "</" + PATTERN_END_DATE + ">");
                                          
                        //<NoEndDate>0</NoEndDate>
                        noEnd = 0;
                                          
                        break;
                   
                   
                    /*
                     * Something like <PatternStartDate>
                     * isn't supported by the RIM's API
                     */
                   
                   
                    //<DayOfWeekMask>   
                    case RepeatRule.DAY_IN_WEEK://2
                    StaticDataHelper.log("[DEBUG]Found DAY_IN_WEEK (" + fieldsArray[i] + ")");
                   
                        //OlDaysOfWeek
                        int valueFromDevice = rule.getInt(RepeatRule.DAY_IN_WEEK);
                        int mask = 0;
                       
                        //olSunday 1
                        if ((valueFromDevice & RepeatRule.SUNDAY) == RepeatRule.SUNDAY) {
                            mask = mask + 1;
                        }
                       
                        //olMonday 2
                        if ((valueFromDevice & RepeatRule.MONDAY) == RepeatRule.MONDAY) {
                            mask = mask + 2;
                        }
                       
                        //olTuesday 4
                        if ((valueFromDevice & RepeatRule.TUESDAY) == RepeatRule.TUESDAY) {
                            mask = mask + 4;
                        }
                       
                        //olWednesday 8
                        if ((valueFromDevice & RepeatRule.WEDNESDAY) == RepeatRule.WEDNESDAY) {
                            mask = mask + 8;
                        }
                       
                        //olThursday 16
                        if ((valueFromDevice & RepeatRule.THURSDAY) == RepeatRule.THURSDAY) {
                            mask = mask + 16;
                        }
                       
                        //olFriday 32
                        if ((valueFromDevice & RepeatRule.FRIDAY) == RepeatRule.FRIDAY) {
                            mask = mask + 32;
                        }
                       
                        //olSaturday 64
                        if ((valueFromDevice & RepeatRule.SATURDAY) == RepeatRule.SATURDAY) {
                            mask = mask + 64;
                        }
                       
                        /*
                         * the Outlook plug-in doesn't accept
                         * an appointment in SIF-E format where
                         * the <DayOfWeekMask> element is given
                         * for events different from 'daily',
                         * 'weekly' or 'yearly'
                         */
                        if (rule.getInt(RepeatRule.FREQUENCY) == RepeatRule.DAILY ||
                            rule.getInt(RepeatRule.FREQUENCY) == RepeatRule.WEEKLY ||
                            rule.getInt(RepeatRule.FREQUENCY) == RepeatRule.YEARLY) {
                               
                            eventBuffer.append("<" + DAY_OF_WEEK_MASK + ">" +
                                               mask +
                                               "</" + DAY_OF_WEEK_MASK + ">");
                        } else {
                           
                            /*
                             * in case of a monthly event,
                             * Outlook seems to require that
                             * the element is present but with
                             * value set to '0'
                             */
                            eventBuffer.append("<" + DAY_OF_WEEK_MASK + ">" +
                                               0 +
                                               "</" + DAY_OF_WEEK_MASK + ">");
                        }
                       
                        break;
                   
                       
                    //<Occurrences>
                    case RepeatRule.COUNT://32
                    StaticDataHelper.log("[DEBUG]Found COUNT (" + fieldsArray[i] + ")");
                   
                        int count = rule.getInt(RepeatRule.COUNT);
                        eventBuffer.append("<" + OCCURRENCES + ">" +
                                           count +
                                           "</" + OCCURRENCES + ">");
                        break;
                   
                   
                    //<DayOfMonth>
                    case RepeatRule.DAY_IN_MONTH://1
                    StaticDataHelper.log("[DEBUG]Found DAY_IN_MONTH (" + fieldsArray[i] + ")");
                   
                        //1-31
                        int dayInMonth = rule.getInt(RepeatRule.DAY_IN_MONTH);
                        eventBuffer.append("<" + DAY_OF_MONTH + ">" +
                                           dayInMonth +
                                           "</" + DAY_OF_MONTH + ">");
                        break;
                   
                   
                    //<Instance> (limited to 1-5 due to SIF-E limitations)
                    case RepeatRule.WEEK_IN_MONTH:
                    StaticDataHelper.log("[DEBUG]Found WEEK_IN_MONTH (" + fieldsArray[i] + ")");
                       
                        int week = 0;
                       
                        switch (rule.getInt(RepeatRule.WEEK_IN_MONTH)) {
                            case RepeatRule.FIRST://1
                                week = 1;
                                break;
                           
                            case RepeatRule.SECOND://2
                                week = 2;
                                break;
                           
                            case RepeatRule.THIRD://4
                                week = 3;
                                break;
                           
                            case RepeatRule.FOURTH://8
                                week = 4;
                                break;
                           
                            /*
                             * in Outlook 2003: 'last'
                             * in the BlackBerry: 'last'
                             */
                            case RepeatRule.FIFTH://16
                                week = 5;
                                break;
                               
                           
                            /*
                             * these values of the Sun Java API
                             * are not supported by the BlackBerry
                             * and the Outlook plug-ins
                             *
                            case RepeatRule.LAST://32
                                week = 32;
                                break;
                               
                            case RepeatRule.SECONDLAST://64
                                week = 64;
                                break;
                               
                            case RepeatRule.THIRDLAST://128
                                week = 128;
                                break;
                           
                            case RepeatRule.FOURTHLAST://256
                                week = 256;
                                break;
                               
                            case RepeatRule.FIFTHLAST://512
                                week = 512;
                                break;
                            */
                        }
                       
                        eventBuffer.append("<" + INSTANCE + ">" +
                                           week +
                                           "</" + INSTANCE + ">");
                       
                        break;
                   
                    //<MonthOfYear> 1-12
                    case RepeatRule.MONTH_IN_YEAR:
                    StaticDataHelper.log("[DEBUG]Found MONTH_IN_YEAR (" + fieldsArray[i] + ")");
                   
                        int month = 0;
                        int monthOfYear = rule.getInt(RepeatRule.MONTH_IN_YEAR);
                       
                        switch (monthOfYear) {
                            case RepeatRule.JANUARY:
                                month = 1;
                            break;
View Full Code Here

Examples of javax.microedition.pim.RepeatRule

     * on the value of the {@code modify}
     * variable
     *
     */
    private void parseRecurrence(Hashtable eventMap) {
        RepeatRule rule = null;
       
        if (modify) {
            rule = event.getRepeat();
        } else {
            rule = new RepeatRule();
        }
           
        //<RecurrenceType>
        String recurrenceType = getValue(eventMap, RECURRENCE_TYPE);//1-6
        int type = 0;
       
        if (!"".equals(recurrenceType)) {
            switch (Integer.parseInt(recurrenceType)) {
                case 0://olRecursDaily
                    type = RepeatRule.DAILY;
                break;
               
                case 1://olRecursWeekly
                    type = RepeatRule.WEEKLY;
                break;
               
                case 2://olRecursMonthly
                    type = RepeatRule.MONTHLY;
                break;
               
                case 3://olRecursMonthlyNth
                    type = RepeatRule.MONTHLY;
                break;
               
                case 5://olRecursYearly
                    type = RepeatRule.YEARLY;
                break;
               
                case 6://olRecursYearlyNth
                    type = RepeatRule.YEARLY;
                    return; //not supported
                //break;   
            }
            rule.setInt(RepeatRule.FREQUENCY, type);
        }
       
       
       
        //<Interval>
        String interval = getValue(eventMap, INTERVAL);//e.g. 2
        if ((!"".equals(interval)) && (!"0".equals(interval))) {
            rule.setInt(RepeatRule.INTERVAL,
                    Integer.parseInt(interval));
        }
       
       
        //<MonthOfYear>
        String monthOfYear = getValue(eventMap, MONTH_OF_YEAR);//1-12
        int month = 0;
       
        if (!"".equals(monthOfYear)) {
            switch (Integer.parseInt(monthOfYear)) {
                case 1:
                month = RepeatRule.JANUARY;
                break;
               
                case 2:
                month = RepeatRule.FEBRUARY;
                break;
               
                case 3:
                month = RepeatRule.MARCH;
                break;
               
                case 4:
                month = RepeatRule.APRIL;
                break;
               
                case 5:
                month = RepeatRule.MAY;
                break;
               
                case 6:
                month = RepeatRule.JUNE;
                break;
               
                case 7:
                month = RepeatRule.JULY;
                break;
               
                case 8:
                month = RepeatRule.AUGUST;
                break;
               
                case 9:
                month = RepeatRule.SEPTEMBER;
                break;
               
                case 10:
                month = RepeatRule.OCTOBER;
                break;
               
                case 11:
                month = RepeatRule.NOVEMBER;
                break;
               
                case 12:
                month = RepeatRule.DECEMBER;
                break;
            }
        }

        /*
         * the Outlook plug-in generates
         * sometimes an element like this:
         * <MonthOfYear>0</MonthOfYear>. '0'
         * can't be added to the rule object
         * of the BlackBerry
         */
        if (month != 0) {
            rule.setInt(RepeatRule.MONTH_IN_YEAR, month);
        }
       
       
        //<DayOfMonth> 1-31
        String dayOfMonth = getValue(eventMap, DAY_OF_MONTH);//e.g. 7
        if ((!"".equals(dayOfMonth)) && (Integer.parseInt(dayOfMonth) != 0)) {
            rule.setInt(RepeatRule.DAY_IN_MONTH,
                        Integer.parseInt(dayOfMonth));
        }
       
       
        // <DayOfWeekMask> start
        String dayOfWeekMaskAsString = getValue(eventMap, DAY_OF_WEEK_MASK);//1-64
       
        if (!"".equals(dayOfWeekMaskAsString)) {
           
            int dayOfWeekMask = Integer.parseInt(dayOfWeekMaskAsString);           
            int mask = 0;
           
            if ((dayOfWeekMask & olMonday) == olMonday) {
                mask = mask + RepeatRule.MONDAY;
            }
            if ((dayOfWeekMask & olTuesday) == olTuesday) {
                mask = mask + RepeatRule.TUESDAY;
            }
            if ((dayOfWeekMask & olWednesday) == olWednesday) {
                mask = mask + RepeatRule.WEDNESDAY;
            }
            if ((dayOfWeekMask & olThursday) == olThursday) {
                mask = mask + RepeatRule.THURSDAY;
            }
            if ((dayOfWeekMask & olFriday) == olFriday) {
                mask = mask + RepeatRule.FRIDAY;
            }
            if ((dayOfWeekMask & olSaturday) == olSaturday) {
                mask = mask + RepeatRule.SATURDAY;
            }
            if ((dayOfWeekMask & olSunday) == olSunday) {
                mask = mask + RepeatRule.SUNDAY;
            }
            rule.setInt(RepeatRule.DAY_IN_WEEK, mask);
        }// <DayOfWeekMask> end
           
       
        //<Instance> start
        String instance = getValue(eventMap, INSTANCE);//e.g. 2
        int week = 0;
        if (!"".equals(instance)) {
           
            switch (Integer.parseInt(instance)) {
                case 1:
                    week = RepeatRule.FIRST;
                    break;
                case 2:
                    week = RepeatRule.SECOND;
                    break;
                case 3:
                    week = RepeatRule.THIRD;
                    break;
                case 4:
                    week = RepeatRule.FOURTH;
                    break;
                case 5:
                    week = RepeatRule.FIFTH;
                    break;
            }
            rule.setInt(RepeatRule.WEEK_IN_MONTH, week);
        }//<Instance> end   
           
           
        //<PatternStartDate>
        String patternStartDate = getValue(eventMap, PATTERN_START_DATE);//e.g. 20060706T220000Z
            //This is currently not supported by the RIM API
       
       
        //<NoEndDate>
        String noEndDate = getValue(eventMap, NO_END_DATE);//e.g. 0 (false)
            //This is not managed in input
       
       
        //<Occurences>
        String occurrences = getValue(eventMap, OCCURRENCES);//e.g. 33
        if (!"".equals(occurrences)) {
            rule.setInt(RepeatRule.COUNT,
                        Integer.parseInt(occurrences));
        }
       
       
        //<PatternEndDate>
        String patternEndDate = getValue(eventMap, PATTERN_END_DATE);//e.g. 20111106T230000Z
        //The field value is currently limited to RepeatRule.END (RIM API)
        if (!"".equals(patternEndDate)) {
            rule.setDate(RepeatRule.END, getDate(patternEndDate));
        } else {
            rule.setDate(RepeatRule.END, 0l);
        }
       
       
        /*
         * though we're modifying an already
View Full Code Here

Examples of javax.microedition.pim.RepeatRule

            _event.addString(Event.LOCATION, PIMItem.ATTR_NONE, location);
            _event.addDate(Event.START, PIMItem.ATTR_NONE, startTime);
            _event.addDate(Event.END, PIMItem.ATTR_NONE, endTime);
            _event.addString(Event.NOTE, PIMItem.ATTR_NONE, description);

            RepeatRule rule = new RepeatRule();

            // Set RepeatRule field and value based on user selection. See
            // javadocs for
            // additional fields and values.
            switch (_recur.getSelectedIndex()) {
            case 1:
                rule.setInt(RepeatRule.FREQUENCY, RepeatRule.DAILY);
                break;

            case 2:
                rule.setInt(RepeatRule.FREQUENCY, RepeatRule.WEEKLY);
                break;

            case 3:
                rule.setInt(RepeatRule.FREQUENCY, RepeatRule.MONTHLY);
                break;

            case 4:
                rule.setInt(RepeatRule.FREQUENCY, RepeatRule.YEARLY);
                break;

            default:
                rule = null;
                break;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.