Package blackberry.core

Examples of blackberry.core.ScriptField


        initial();
    }

    // Injects fields and methods
    private void initial() {
        addItem( new ScriptField( FIELD_VIEW, new Integer( TaskArgumentsConstructor.VIEW_NEW ), ScriptField.TYPE_INT, false,
                false ) );
    }
View Full Code Here


        initial();
    }

    // Injects fields and methods
    private void initial() {
        addItem( new ScriptField( FIELD_VIEW, new Integer( AddressBookArgumentsConstructor.VIEW_NEW ), ScriptField.TYPE_INT,
                false, false ) );
    }
View Full Code Here

        initial();
    }

    // Injects fields and methods
    private void initial() {
        addItem( new ScriptField( FIELD_VIEW, new Integer( MessageArgumentsConstructor.VIEW_NEW ), ScriptField.TYPE_INT, false,
                false ) );
    }
View Full Code Here

        initial();
    }

    // Injects fields and methods
    private void initial() {
        addItem( new ScriptField( FIELD_DATE, _date, ScriptField.TYPE_DATE, true, false ) );
        addItem( new ScriptField( FIELD_VIEW, new Integer( CalendarArgumentsConstructor.VIEW_NEW ), ScriptField.TYPE_INT, false,
                false ) );
        addItem( new ScriptField( FIELD_APPOINTMENT, _appointment, ScriptField.TYPE_SCRIPTABLE, true, false ) );
    }
View Full Code Here

    /**
     * Constructs a new RecurenceObject
     */
    public RecurrenceObject() {
        addItem( new ScriptField( FIELD_FREQUENCY, new Integer( 0 ), ScriptField.TYPE_INT, false, false ) );
        addItem( new ScriptField( FIELD_COUNT, new Integer( 0 ), ScriptField.TYPE_INT, false, false ) );
        addItem( new ScriptField( FIELD_INTERVAL, new Integer( 0 ), ScriptField.TYPE_INT, false, false ) );
        addItem( new ScriptField( FIELD_END, null, ScriptField.TYPE_DATE, false, false ) );
        addItem( new ScriptField( FIELD_MONTHINYEAR, new Integer( 0 ), ScriptField.TYPE_INT, false, false ) );
        addItem( new ScriptField( FIELD_WEEKINMONTH, new Integer( 0 ), ScriptField.TYPE_INT, false, false ) );
        addItem( new ScriptField( FIELD_DAYINWEEK, new Integer( 0 ), ScriptField.TYPE_INT, false, false ) );
        addItem( new ScriptField( FIELD_DAYINMONTH, new Integer( 0 ), ScriptField.TYPE_INT, false, false ) );
        addItem( new ScriptField( FIELD_DAYINYEAR, new Integer( 0 ), ScriptField.TYPE_INT, false, false ) );
    }
View Full Code Here

    /**
     * Constructs a new ReminderObject
     */
    public ReminderObject() {
        addItem( new ScriptField( FIELD_TYPE, new Integer( 0 ), ScriptField.TYPE_INT, false, false ) );
        addItem( new ScriptField( FIELD_RELATIVE_HOURS, new Double( 0 ), ScriptField.TYPE_DOUBLE, false, false ) );
        addItem( new ScriptField( FIELD_DATE, null, ScriptField.TYPE_DATE, false, false ) );
    }
View Full Code Here

    public AddressObject() {
        initial();
    }

    private void initial() {
        addItem( new ScriptField( FIELD_COUNTRY, BLANK, ScriptField.TYPE_STRING, false, false ) );
        addItem( new ScriptField( FIELD_ADDRESS1, BLANK, ScriptField.TYPE_STRING, false, false ) );
        addItem( new ScriptField( FIELD_ADDRESS2, BLANK, ScriptField.TYPE_STRING, false, false ) );
        addItem( new ScriptField( FIELD_CITY, BLANK, ScriptField.TYPE_STRING, false, false ) );
        addItem( new ScriptField( FIELD_ZIP, BLANK, ScriptField.TYPE_STRING, false, false ) );
        addItem( new ScriptField( FIELD_STATE, BLANK, ScriptField.TYPE_STRING, false, false ) );
    }
View Full Code Here

    /**
     * Constructs a new AttendeeObject
     */
    public AttendeeObject() {
        addItem( new ScriptField( FIELD_ADDRESS, EMPTY_ADDRESS, ScriptField.TYPE_STRING, false, false ) );
        addItem( new ScriptField( FIELD_TYPE, UNDEFINED, ScriptField.TYPE_SCRIPTABLE, false, false ) );
    }
View Full Code Here

    /**
     * Constructs a CategoryNamespace
     */
    public CategoryNamespace() {
        addItem( new ScriptField( AddCategoryFunction.NAME, new AddCategoryFunction(), ScriptField.TYPE_SCRIPTABLE, true, true ) );
        addItem( new ScriptField( DeleteCategoryFunction.NAME, new DeleteCategoryFunction(), ScriptField.TYPE_SCRIPTABLE, true,
                true ) );
        addItem( new ScriptField( GetCategoriesFunction.NAME, new GetCategoriesFunction(), ScriptField.TYPE_SCRIPTABLE, true,
                true ) );
    }
View Full Code Here

        init();
    }

    private void init() {
        // Methods
        addItem( new ScriptField( METHOD_SAVE, createSaveMethod(), ScriptField.TYPE_SCRIPTABLE, true, true ) );
        addItem( new ScriptField( METHOD_REMOVE, createRemoveMethod(), ScriptField.TYPE_SCRIPTABLE, true, true ) );

        String location = "";
        String summary = "";
        String note = "";
        String uid = "";
        Date start = null;
        Date end = null;
        ReminderObject reminder = null;

        boolean allDay = false;
        AttendeeObject[] attendeeObjects = null;
        int freeBusy = AppointmentConstructor.CONST_VAL_BUSY.intValue();

        RepeatRule repeatRule = null;

        if( _event != null ) {
            if( _event.countValues( Event.LOCATION ) > 0 ) {
                location = _event.getString( Event.LOCATION, Event.ATTR_NONE );
            }
            if( _event.countValues( Event.SUMMARY ) > 0 ) {
                summary = _event.getString( Event.SUMMARY, Event.ATTR_NONE );
            }
            if( _event.countValues( Event.NOTE ) > 0 ) {
                note = _event.getString( Event.NOTE, Event.ATTR_NONE );
            }
            if( _event.countValues( Event.UID ) > 0 ) {
                uid = _event.getString( Event.UID, Event.ATTR_NONE );
            }
            if( _event.countValues( Event.START ) > 0 ) {
                start = new Date( _event.getDate( Event.START, Event.ATTR_NONE ) );
            }
            if( _event.countValues( Event.END ) > 0 ) {
                end = new Date( _event.getDate( Event.END, Event.ATTR_NONE ) );
            }
            if( _event.countValues( Event.ALARM ) > 0 ) {
                int relativeTime = _event.getInt( Event.ALARM, Event.ATTR_NONE );
                Double d = new Double( (double) relativeTime / 3600 );

                reminder = new ReminderObject();
                reminder.getItem( ReminderObject.FIELD_TYPE ).setValue( new Integer( ReminderConstructor.TYPE_RELATIVE ) );
                reminder.getItem( ReminderObject.FIELD_RELATIVE_HOURS ).setValue( d );
            }
            if( _event.countValues( BlackBerryEvent.ALLDAY ) > 0 ) {
                allDay = _event.getBoolean( BlackBerryEvent.ALLDAY, Event.ATTR_NONE );
            }
            int countAttendees = _event.countValues( BlackBerryEvent.ATTENDEES );
            attendeeObjects = new AttendeeObject[ countAttendees ];
            for( int i = 0; i < countAttendees; i++ ) {
                AttendeeObject attendeeObject = new AttendeeObject();
                String attendeeAddress = _event.getString( BlackBerryEvent.ATTENDEES, i );
                attendeeObject.getItem( AttendeeObject.FIELD_ADDRESS ).setValue( attendeeAddress );
                attendeeObjects[ i ] = attendeeObject;
            }

            if( _event.countValues( BlackBerryEvent.FREE_BUSY ) > 0 ) {
                freeBusy = _event.getInt( BlackBerryEvent.FREE_BUSY, BlackBerryEvent.ATTR_NONE );
            }
            repeatRule = _event.getRepeat();
        }

        // Properties
        addItem( new ScriptField( FIELD_LOCATION, location, ScriptField.TYPE_STRING, false, false ) );
        addItem( new ScriptField( FIELD_NOTE, note, ScriptField.TYPE_STRING, false, false ) );
        addItem( new ScriptField( FIELD_SUMMARY, summary, ScriptField.TYPE_STRING, false, false ) );
        addItem( new ScriptField( FIELD_UID, uid, ScriptField.TYPE_STRING, true, false ) );

        addItem( new ScriptField( FIELD_START, start, ScriptField.TYPE_DATE, false, false ) );
        addItem( new ScriptField( FIELD_END, end, ScriptField.TYPE_DATE, false, false ) );

        addItem( new ScriptField( FIELD_REMINDER, reminder, ScriptField.TYPE_SCRIPTABLE, false, false ) );

        addItem( new ScriptField( FIELD_ALLDAY, new Boolean( allDay ), ScriptField.TYPE_BOOLEAN, false, false ) );
        addItem( new ScriptField( FIELD_FREEBUSY, new Integer( freeBusy ), ScriptField.TYPE_INT, false, false ) );

        addItem( new ScriptField( FIELD_ATTENDEES, attendeeObjects, ScriptField.TYPE_SCRIPTABLE, false, false ) );

        if( repeatRule != null ) {
            RecurrenceObject recurObject = new RecurrenceObject();

            int count = PIMUtils.getRepeatRuleInt( repeatRule, RepeatRule.COUNT );
            recurObject.getItem( RecurrenceObject.FIELD_COUNT ).setValue( new Integer( count ) );

            int freq = PIMUtils.getRepeatRuleInt( repeatRule, RepeatRule.FREQUENCY );
            recurObject.getItem( RecurrenceObject.FIELD_FREQUENCY ).setValue(
                    new Integer( RecurrenceObject.repeatRuleToFrequency( freq ) ) );

            int interval = PIMUtils.getRepeatRuleInt( repeatRule, RepeatRule.INTERVAL );
            recurObject.getItem( RecurrenceObject.FIELD_INTERVAL ).setValue( new Integer( interval ) );

            long endTime = PIMUtils.getRepeatRuleDate( repeatRule, RepeatRule.END );
            recurObject.getItem( RecurrenceObject.FIELD_END ).setValue( new Date( endTime ) );

            int monthInYear = PIMUtils.getRepeatRuleInt( repeatRule, RepeatRule.MONTH_IN_YEAR );
            recurObject.getItem( RecurrenceObject.FIELD_MONTHINYEAR ).setValue( new Integer( monthInYear ) );

            int weekInMonth = PIMUtils.getRepeatRuleInt( repeatRule, RepeatRule.WEEK_IN_MONTH );
            recurObject.getItem( RecurrenceObject.FIELD_WEEKINMONTH ).setValue( new Integer( weekInMonth ) );

            int dayInWeek = PIMUtils.getRepeatRuleInt( repeatRule, RepeatRule.DAY_IN_WEEK );
            recurObject.getItem( RecurrenceObject.FIELD_DAYINWEEK ).setValue( new Integer( dayInWeek ) );

            int dayInMonth = PIMUtils.getRepeatRuleInt( repeatRule, RepeatRule.DAY_IN_MONTH );
            recurObject.getItem( RecurrenceObject.FIELD_DAYINMONTH ).setValue( new Integer( dayInMonth ) );

            int dayInYear = PIMUtils.getRepeatRuleInt( repeatRule, RepeatRule.DAY_IN_YEAR );
            recurObject.getItem( RecurrenceObject.FIELD_DAYINYEAR ).setValue( new Integer( dayInYear ) );

            addItem( new ScriptField( FIELD_RECURRENCE, recurObject, ScriptField.TYPE_SCRIPTABLE, false, false ) );
        } else {
            addItem( new ScriptField( FIELD_RECURRENCE, null, ScriptField.TYPE_SCRIPTABLE, false, false ) );
        }
    }
View Full Code Here

TOP

Related Classes of blackberry.core.ScriptField

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.