|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Contains the functionality for the BlackBerry-specific implementation of a ContactList.
To retrieve BlackBerryContactGroup objects, invoke any of the items() methods
that take an integer search type argument, and pass a value that is bitwise-ored with the constant
BlackBerryContactList.SEARCH_GROUPS. The standard items() methods defined
in PIMList will only return Contact objects.
For example, invoking
list.items(BlackBerryContactList.SEARCH_GROUPS)where
list is an instance of BlackBerryContactList, will return an
enumeration over all BlackBerryContactGroup objects, but not BlackBerryContact
objects. Another example is invoking
list.items(BlackBerryContactList.SEARCH_GROUPS|BlackBerryContactList.SEARCH_CONTACTS)which will return an enumeration over all
BlackBerryContactGroup objects and all
BlackBerryContact objects.
| Inner Class Summary | ||
|
static interface |
BlackBerryContactList.AddressTypes
Describes the various address types supported by the choose(javax.microedition.pim.Contact, int, boolean) method. |
| Field Summary | ||
|
static int |
SEARCH_CONTACTS
Passed to items to indicate that the returned enumeration should contain
only Contact objects. |
|
static int |
SEARCH_GROUPS
Passed to items to indicate that the returned enumeration should contain
BlackBerryContactGroup objects. |
|
static int |
SORT_ORDER_COMPANY
Returned by itemsSortOrder to indicate that the items in this BlackBerryContactList
are sorted by company name. |
|
static int |
SORT_ORDER_FIRST_NAME
Returned by itemsSortOrder to indicate that the items in this BlackBerryContactList
are sorted by first name. |
|
static int |
SORT_ORDER_LAST_NAME
Returned by itemsSortOrder to indicate that the items in this BlackBerryContactList
are sorted by last name. |
| Fields inherited from interface javax.microedition.pim.PIMList |
UNCATEGORIZED |
| Method Summary | ||
|
void |
addListener(PIMListListener listener,
boolean includeGroups)
Adds a PIM list listener to this PIM list. |
|
PIMItem |
choose()
Launches the address book so that the user can pick an address. |
|
Contact |
choose(Contact previous,
int type,
boolean allowCrossService)
Launches the address book so that the user can pick an address. |
|
int |
getSortOrder()
Returns the expected order of the results of a call to ContactList.items(). |
|
Enumeration |
items(int searchType)
Returns an enumeration of all items of the requested type in this BlackBerryContactList. |
|
Enumeration |
items(String matching,
int searchType)
Returns an enumeration of all items that match the fields contained within a specified string. |
|
Enumeration |
itemsByName(Contact matching)
Returns an enumeration of all items whose name field matches the name field in specified Contact. |
|
Enumeration |
itemsByName(String matching)
Returns an enumeration of all items whose name field matches the specified string. |
|
Enumeration |
itemsByName(String matching,
int searchType)
Returns an enumeration of all items whose name field matches the specified string. |
|
void |
lookup(Contact matching,
RemoteLookupListener listener)
Initiates a remote lookup. |
|
void |
lookup(String matching,
RemoteLookupListener listener)
Initiates a remote lookup. |
| Methods inherited from interface javax.microedition.pim.ContactList |
createContact, importContact, removeContact |
| 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 |
| Methods inherited from interface net.rim.blackberry.api.pdap.BlackBerryPIMList |
addListener, isFieldLabelSettable, removeListener, setFieldLabel |
| Field Detail |
public static final int SEARCH_CONTACTS
items to indicate that the returned enumeration should contain
only Contact objects.
This can be combined with SEARCH_GROUPS using the | operator.public static final int SEARCH_GROUPS
items to indicate that the returned enumeration should contain
BlackBerryContactGroup objects.
This can be combined with SEARCH_CONTACTS using the | operator.public static final int SORT_ORDER_COMPANY
itemsSortOrder to indicate that the items in this BlackBerryContactList
are sorted by company name.public static final int SORT_ORDER_FIRST_NAME
itemsSortOrder to indicate that the items in this BlackBerryContactList
are sorted by first name.public static final int SORT_ORDER_LAST_NAME
itemsSortOrder to indicate that the items in this BlackBerryContactList
are sorted by last name.| Method Detail |
public void addListener(PIMListListener listener, boolean includeGroups)
Note that the listener will remain associated with the native device
database even after the correspoding PIM list has been
deleted. To remove the listener use BlackBerryPIMList.removeListener(net.rim.blackberry.api.pdap.PIMListListener).
method.
listener - PIM list listener to add.public PIMItem choose()
public Contact choose(Contact previous, int type, boolean allowCrossService)
previous - Contact used as the starting point in the address book
(may be null).type - One of the address types defined by the BlackBerryContactList.AddressTypes
interface.allowCrossService - If true, permit selection of addresses that will
use a different service (ie, BWC etc); otherwise, false.public int getSortOrder()
ContactList.items().SORT_ORDER_FIRST_NAME, SORT_ORDER_LAST_NAME
or SORT_ORDER_COMPANY.public Enumeration items(int searchType) throws PIMException
searchType - One or a combination of SEARCH_CONTACTS or SEARCH_GROUPS.PIMException - Thrown if the list is closed.public Enumeration items(String matching, int searchType) throws PIMException
The enumeration will contain items with fields containing the
String argument.
The matching algorithm works as follows:
matching - The string used for matching fields.searchType - One or a combination of SEARCH_CONTACTS or SEARCH_GROUPS.PIMItems.PIMException - Thrown if an error occurs with the list, or if the
list has already been closed.public Enumeration itemsByName(Contact matching) throws PIMException
Contact.NAME field.
For example, the search string "name" will be found
within the field "Contact Name" and "First NAME", but not
within the field "lastname".
matching - The Contact used for matching fields.PIMItems.PIMException - Thrown if an error occurs with the list, or if the
list has already been closed.public Enumeration itemsByName(String matching) throws PIMException
Contact.NAME field.
For example, the search string "name" will be found
within the field "Contact Name" and "First NAME", but not
within the field "lastname".
matching - The string used for the name field.PIMItems.PIMException - Thrown if an error occurs with the list, or if the
list has already been closed.public Enumeration itemsByName(String matching, int searchType) throws PIMException
Contact items,
Name field is matched for BlackBerryContactGroup items.
The matching algorithm works as follows:
Contact.NAME field.
For example, the search string "name" will be found
within the field "Contact Name" and "First NAME", but not
within the field "lastname".
matching - The string used for the name field.searchType - One or a combination of SEARCH_CONTACTS or SEARCH_GROUPS.PIMItems.PIMException - Thrown if an error occurs with the list, or if the
list has already been closed.public void lookup(Contact matching, RemoteLookupListener listener) throws IllegalArgumentException
The results are passed to your provided RemoteLookupListener's
items method.
matching - Contact used for matching fields.listener - Remote lookup listener.IllegalArgumentException - If you provide a bad parameter.public void lookup(String matching, RemoteLookupListener listener) throws IllegalArgumentException
The results are passed to your provided RemoteLookupListener's
items method.
matching - String used for matching fields.listener - Remote lookup listener.IllegalArgumentException - If you provide a bad parameter.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2007 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.