|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
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 pe ) {
// 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.
PIMList,
BlackBerryMemo| Field Summary |
| Fields inherited from interface javax.microedition.pim.PIMList |
UNCATEGORIZED |
| Method Summary | ||
|
BlackBerryMemo |
createMemo()
Creates a new BlackBerryMemo instance. |
|
BlackBerryMemo |
getByUID(String uid)
Finds a memo by its UID. |
|
BlackBerryMemo |
importMemo(BlackBerryMemo element)
Imports a BlackBerryMemo into the list using a given, predefined
BlackBerryMemo object. |
|
void |
removeMemo(BlackBerryMemo element)
Removes a BlackBerryMemo from the list. |
| Methods inherited from interface net.rim.blackberry.api.pdap.BlackBerryPIMList |
addListener, isFieldLabelSettable, removeListener, setFieldLabel |
| 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 |
public BlackBerryMemo createMemo()
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.
BlackBerryMemo instance.public BlackBerryMemo getByUID(String uid) throws PIMException
uid - the UID for which to search; may be null, in which case this method
will behave as if the UID was not found.BlackBerryMemo object is returned; otherwise, if not found, returns null.PIMException - if an error occurs searching (eg. list is closed).SecurityException - if the list was opened in a mode that does not allow reading.public BlackBerryMemo importMemo(BlackBerryMemo element)
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.
element - The BlackBerryMemo object to import into the list.BlackBerryMemo instance to add to the list.NullPointerException - if element is null.public void removeMemo(BlackBerryMemo element) throws PIMException
BlackBerryMemo from the list.
element - The BlackBerryMemo to be removed from the list.NullPointerException - if element is null.PIMException - Thrown if an error occurs, or if the BlackBerryMemo
cannot be found in the list.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2009 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.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.