|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.content.DefaultContentHandlerRegistry
public class DefaultContentHandlerRegistry
Sets and retrieves default content handlers that have been registered
.
This registry permits two main functions:
setDefaultContentHandler()
and getDefaultContentHandler()
.setApplicationDescriptor()
and
setApplicationDescriptor()
.
This is useful for specifying the icon that is associated with the content handler.
Additionally, the application descriptor can contain localized names of the content
handler application.
Users are affected when you change the default content handlers. Applications should consider prompting the user to configure or accept the defaults being set. Consider prompting the user when:
The bottom line is to keep the user in mind when setting default content handlers.
ContentHandler
Method Summary | ||
---|---|---|
|
void |
clearAllDefaults()
Clears all of the default content handlers that were set. |
|
ApplicationDescriptor |
getApplicationDescriptor(String contentHandlerId)
Returns the application descriptor for the content handler. |
|
ContentHandler |
getDefaultContentHandler(Invocation invocation)
Returns the default handler for the given invocation. |
|
static DefaultContentHandlerRegistry |
getDefaultContentHandlerRegistry(Registry registry)
Returns an instance for the given registry . |
|
void |
setApplicationDescriptor(ApplicationDescriptor appDescriptor,
String contentHandlerId)
Sets the application descriptor for the given content handler. |
|
void |
setDefaultContentHandler(String[] types,
String[] suffixes,
String[] actions,
String contentHandlerId)
Sets the default content handler for the given types, suffixes, and actions. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static DefaultContentHandlerRegistry getDefaultContentHandlerRegistry(Registry registry)
registry
.
The given registry will be used to perform Registry
operations so any security restrictions will be based on the given registry.
registry
- The registry. Must not be null.
registry
.
NullPointerException
- if registry
is null.public ContentHandler getDefaultContentHandler(Invocation invocation) throws IOException, SecurityException
Registry.findHandler
.
invocation
- The ID, type, action, and URL that
are needed to identify one or more content handlers;
must not be null
.
null
if there is no default.
IllegalArgumentException
- if ID, type, action, and URL are all null
IOException
- if the content is accessed via the URL and the URL is invalid
SecurityException
- if access to the content is not permitted
NullPointerException
- if the invocation
is null
public void setDefaultContentHandler(String[] types, String[] suffixes, String[] actions, String contentHandlerId)
types
- An array of content types; if null
it is treated the same as an empty array.suffixes
- An array of suffixes to register; if null
it is treated the same as an empty array.actions
- An array of actions to register; if null
it is treated the same as an empty array.contentHandlerId
- The content handler ID; if null
, any default handler associated
with the types, suffixes, and actions is cleared.
NullPointerException
- if any array element of types
, suffixes
, actions
is null
SecurityException
- if registration is not permitted
IllegalArgumentException
- if the content handler is not registered for the given types, suffixes or actionspublic void setApplicationDescriptor(ApplicationDescriptor appDescriptor, String contentHandlerId)
Registry
.
appDescriptor
- The application descriptor for the content handler.contentHandlerId
- The ID for the content handler.
NullPointerException
- if appDescriptor
or contentHandlerId
is null
IllegalArgumentException
- if contentHandlerId
is not a registered IDpublic ApplicationDescriptor getApplicationDescriptor(String contentHandlerId)
contentHandlerId
- A registered content handler ID.
null
if one does not exist or if contentHandlerId
is null
.
NullPointerException
- if contentHandlerId
is null
.public void clearAllDefaults()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal