net.rim.blackberry.api.pdap
Interface BlackBerryMemoList

All Superinterfaces:
PIMList, BlackBerryPIMList

public interface BlackBerryMemoList
extends BlackBerryPIMList

Represents the default RIM BlackBerryMemo database.

The PIMList.isSupportedField(int) method is invoked to determine if a field (as specified by the integer argument) is supported by a BlackBerryMemoList. Similarly, the PIMList.getSupportedFields() method is invoked to return an integer array representing all fields supported by the list.

A BlackBerryMemoList accepts only objects that implement the BlackBerryMemo interface as a parameter to the PIMList.items(PIMItem) method. An IllegalArgumentException will be thrown if the input parameter does not implement the BlackBerryMemo interface.

Working with the BlackBerryMemoList object

The following examples demonstrate how to use the BlackBerryMemoList object.

Below, the memo list is retrieved in read/write mode.

         PIM p = PIM.getInstance();
         BlackBerryMemoList memoList;
         try {
             memoList = (BlackBerryMemoList) p.openPIMList( BlackBerryPIM.MEMO_LIST, BlackBerryPIM.READ_WRITE );
         } catch ( PIMException e ) {
             // BlackBerryMemoList could not be opened...
         }
 

Adding BlackBerryMemos to the BlackBerryMemoList

The following example shows how to create a new, empty BlackBerryMemo that is associated with the BlackBerryMemoList.

         BlackBerryMemo memo = memoList.createMemo();
 

This next example demonstrates how to import data from a BlackBerryMemo into a new BlackBerryMemo that is associated with the BlackBerryMemoList.

         BlackBerryMemo memo = memoList.importMemo( inputMemo );
 

In both of the above examples, the newly-created memo has not been saved to the BlackBerryMemoList. In order to save the memo, the PIMItem.commit() method must be invoked.

Removing BlackBerryMemos from the BlackBerryMemoList

The following example shows how to remove a BlackBerryMemo from the BlackBerryMemoList.

         try {
             memoList.removeMemo( memo );
         } catch ( PIMException e ) {
             // memo couldn't be found in the list
         }
 

Retrieving BlackBerryMemos from the BlackBerryMemoList

Methods are provided for retrieving a complete listing of the BlackBerryMemos in the list, or retrieving only those BlackBerryMemos that meet certain criteria. The following examples demonstrate how to use them.

To retrieve all BlackBerryMemos from the list, invoke the PIMList.items() method.

         try {
             Enumeration memos = memoList.items();
         } catch ( PIMException e ) {
             // list has already been closed
         }
 

To retrieve all BlackBerryMemos that match the data of another BlackBerryMemo, invoke the PIMList.items(PIMItem) method. Note that the argument must be an object that implements the BlackBerryMemo interface.

         try {
             Enumeration memos = memoList.items( memo );
         } catch ( PIMException e ) {
             // list has already been closed
         }
 

Finally, to retrieve all BlackBerryMemos that match the contents of a String, invoke the PIMList.items(String) method.

         try {
             Enumeration memos = memoList.items( "Company Policy" );
         } catch ( PIMException e ) {
             // list has already been closed
         }
 

Accessing the MemoPad database

This interface allows developers to manipulate the "memos" database: the database used by the BlackBerry MemoPad application. Use an implementation of this interface to add, remove, or update memos in an application. Modifications to the memo database are visible through the MemoPad application. Listeners can be registered to notify an application when the memo database is modified. Changes to the MemoPad database through this interface are synchronized wirelessly with the client’s Outlook/Notes server.

For more information about the personal information management (PIM) API, refer to The PDA Profile specification (JSR-000075) for the J2ME(TM) Platform.

See Also:
PIMList, BlackBerryMemo
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.2.0

Field Summary
 
Fields inherited from interface javax.microedition.pim.PIMList
UNCATEGORIZED
 
Method Summary
Category: Signed  BlackBerryMemo createMemo()
          Creates a new BlackBerryMemo instance.
Category: Signed  BlackBerryMemo getByUID(String uid)
          Finds a memo by its UID.
Category: Signed  BlackBerryMemo importMemo(BlackBerryMemo element)
          Imports a BlackBerryMemo into the list using a given, predefined BlackBerryMemo object.
Category: Signed  void removeMemo(BlackBerryMemo element)
          Removes a BlackBerryMemo from the list.
 
Methods inherited from interface net.rim.blackberry.api.pdap.BlackBerryPIMList
addListener, getPIMListUID, isFieldLabelSettable, isWirelessSyncCapable, isWirelessSyncEnabled, removeListener, setFieldLabel, size
 
Methods inherited from interface javax.microedition.pim.PIMList
addCategory, close, deleteCategory, getArrayElementLabel, getAttributeLabel, getCategories, getFieldDataType, getFieldLabel, getName, getSupportedArrayElements, getSupportedAttributes, getSupportedFields, isCategory, isSupportedArrayElement, isSupportedAttribute, isSupportedField, items, items, items, itemsByCategory, maxCategories, maxValues, renameCategory, stringArraySize
 



Method Detail

createMemo

BlackBerryMemo createMemo()
Creates a new BlackBerryMemo instance.

The new BlackBerryMemo object is created initially empty and contains empty fields for all attributes that are supported by the list.

The BlackBerryMemo object is not added to the BlackBerryMemoList upon creation. The method PIMItem.commit() must be invoked in order to add the BlackBerryMemo to the list.

Returns:
A new BlackBerryMemo instance.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.2.0

importMemo

BlackBerryMemo importMemo(BlackBerryMemo element)
Imports a BlackBerryMemo into the list using a given, predefined BlackBerryMemo object.

The BlackBerryMemo is created using as much of the existing information as possible. If a field in the existing BlackBerryMemo object is not supported by the BlackBerryMemoList, the field is not included in the BlackBerryMemo. If the specified BlackBerryMemo is already in the list, a new BlackBerryMemo is created with similar information.

The BlackBerryMemo object is not added to the BlackBerryMemoList upon creation. The method PIMItem.commit() must be invoked in order to add the BlackBerryMemo to the list.

Parameters:
element - The BlackBerryMemo object to import into the list.
Returns:
The BlackBerryMemo instance to add to the list.
Throws:
NullPointerException - if element is null.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.2.0

removeMemo

void removeMemo(BlackBerryMemo element)
                throws PIMException
Removes a BlackBerryMemo from the list.

Parameters:
element - The BlackBerryMemo to be removed from the list.
Throws:
NullPointerException - if element is null.
PIMException - Thrown if an error occurs, or if the BlackBerryMemo cannot be found in the list.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.2.0

getByUID

BlackBerryMemo getByUID(String uid)
                        throws PIMException
Finds a memo by its UID.

Parameters:
uid - the UID for which to search; may be null, in which case this method will behave as if the UID was not found.
Returns:
If a memo with the specified UID is found in this list then its BlackBerryMemo object is returned; otherwise, if not found, returns null.
Throws:
PIMException - if an error occurs searching (eg. list is closed).
SecurityException - if the list was opened in a mode that does not allow reading.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.6.0





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.