Package javax.microedition.pim

Examples of javax.microedition.pim.EventList


    public synchronized void setSelectionStatus(final Hashtable channelsList, final Programme[] programmes)
            throws PIMException {
        if (!isPIMSupported())
            return;

        final EventList list = getEventList();
        final Enumeration en;
        if (list.maxCategories() != 0) {
            en = list.itemsByCategory("TV");
        } else {
            en = list.items();
        }
        if (en.hasMoreElements()) {
            long[] startTimes = new long[programmes.length];
            for (int i = 0; i < programmes.length; i++) {
                if (!programmes[i].isChannelTitle) {
View Full Code Here


            // 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 {
View Full Code Here

                        isAscending = b.booleanValue();
                    }
                }

                boolean isSorted = orderByField != null && orderByField.length() > 0 ? true : false;
                EventList eventList;
                try {
                    if( serviceName.length() == 0 ) {
                        eventList = (EventList) PIM.getInstance().openPIMList( PIM.EVENT_LIST, PIM.READ_WRITE );
                    } else {
                        eventList = (EventList) PIM.getInstance().openPIMList( PIM.EVENT_LIST, PIM.READ_WRITE, serviceName );
                    }
                } catch( PIMException pime ) {
                    return appointmentsFound;
                }
                Vector found = new Vector();
                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 ) ) {
View Full Code Here

            public Object execute( Object innerThiz, Object[] innerArgs ) throws Exception {
                if( _event == null ) {
                    throw new PIMException( "PIMItem not found." );
                }

                EventList eventList;
                if( _serviceName.length() == 0 ) {
                    eventList = (EventList) BlackBerryPIM.getInstance().openPIMList( BlackBerryPIM.EVENT_LIST,
                            BlackBerryPIM.WRITE_ONLY );
                } else {
                    eventList = (EventList) BlackBerryPIM.getInstance().openPIMList( BlackBerryPIM.EVENT_LIST,
                            BlackBerryPIM.WRITE_ONLY, _serviceName );
                }

                eventList.removeEvent( _event );
                _event = null;

                return UNDEFINED;
            };
        };
View Full Code Here

     * @param record Record to be added or updated
     * @throws DataAccessException
     */
    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();

            // Set the record key
            record.setKey(uid);

            list.close();

        }
        catch (Exception e) {
            StaticDataHelper.log("[DEBUG]Exception in EventDataStore.setRecord(): " + e.toString());
            //e.printStackTrace();
View Full Code Here

     */
    public void deleteRecord(Record record) throws DataAccessException
    {
        try
        {
            EventList list = (EventList)PIM.getInstance()
                                        .openPIMList(PIM.EVENT_LIST, PIM.READ_WRITE);
           
            Event event = getEvent(record.getKey(), list, true);
           
            if(event != null)
                list.removeEvent(event);
           
            list.close();
           
        }
        catch(Exception expn)
        {
            throw new DataAccessException(expn);
View Full Code Here

         * In case of an updated record, this is available
         * in the event database, so that it is not stored to save space
         */
        if (state == RECORD_STATE_DELETED)
        {
            EventList list = (EventList)PIM.getInstance()
                                        .openPIMList(PIM.EVENT_LIST, PIM.READ_WRITE);

            String data = getEventString(list, event);

            list.close();

            value += "|" + data;
        }

        int size = changes.size();//the number of components in this vector
View Full Code Here

        try
        {

            String contanctAsString = null;

            EventList list = (EventList)PIM.getInstance()
                                        .openPIMList(PIM.EVENT_LIST, PIM.READ_WRITE);

            Event event = getEvent(uid, list, true);

            contanctAsString = getEventString(list, event);

            list.close();

            return contanctAsString;
        }
        catch (Throwable e)//Exception
        {
View Full Code Here

     *
     * @see net.rim.device.api.ui.Screen#onSave()
     */
    protected boolean onSave() {
        try {
            final EventList eventList =
                    (EventList) PIM.getInstance().openPIMList(PIM.EVENT_LIST,
                            PIM.WRITE_ONLY);
            _event = eventList.createEvent();

            final String subject = _subject.getText().trim();
            final String location = _location.getText().trim();
            final long startTime = _startTime.getDate();
            final long endTime = _endTime.getDate();
View Full Code Here

TOP

Related Classes of javax.microedition.pim.EventList

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.