net.rim.blackberry.api.sendmenu
Interface SendCommandContextFilter


public interface SendCommandContextFilter

Defines a filter on the content context object of a SendCommand object.

The defined filter will be invoked before the SendCommand is executed. A class that implements this interface is registered with a SendCommand by invoking SendCommand.setSendCommandContextFilter(SendCommandContextFilter), and is used to modify the context object of the SendCommand prior to the SendCommand.run() method actually using it. The primary use case for a filter is to provide intelligently shortened strings in the context object with content exceeding a maximum character limit, if one exists for the SendCommand's target application.

For example, suppose an application's message may not exceed 140 characters. A SendCommandContextFilter registered with the application's SendCommand could shorten long URLs using http://tinyurl.com to fit within the 140 character limit.

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 7.0.0

Method Summary
Category: Signed  JSONObject filterContext(SendCommand sendCommand)
          Filters the JSONObject context data of the specified SendCommand object.
 



Method Detail

filterContext

JSONObject filterContext(SendCommand sendCommand)
Filters the JSONObject context data of the specified SendCommand object.

The modified JSONObject context object is to be returned by this method. The parameter SendCommand object is to be executed with the returned JSONObject.

Parameters:
sendCommand - The SendCommand whose JSONObject context object is to be filtered/modified prior to the SendCommand.run() method actually using it. If the parameter sendCommand is null, then behaviour is undefined.
Returns:
The filtered data context. null may be returned. If a non-null JSONObject context object is returned, then (a copy of) it will be used by the caller instead of the JSONObject context object of the specified SendCommand. If null is returned, then (a copy of) the JSONObject context object of the specified SendCommand will be used by the caller.
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 7.0.0





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