SHOW Signed
 

net.rim.blackberry.api.menuitem
Class ApplicationMenuItem

java.lang.Object
  |
  +--net.rim.blackberry.api.menuitem.ApplicationMenuItem

public abstract class ApplicationMenuItem
extends Object

Provides the functionality to add items to application menus.

Developers should extend an instance of this class and register the instance with the ApplicationMenuItemRepository. Register the instance along with an appropriate context ID, which defines when the menu item appears, as defined by the constants in ApplicationMenuItemRepository. To add menu items for the purpose of sending images, the preferred method is to use the the JSR 211 ContentHandler API. Applications registering with ContentHandler.ACTION_SEND and providing an ActionNameMap will have items added to dialogs and/or menus to be invoked as handlers for sending the selected image.

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:
JDE 3.6.0

Constructor Summary
 Category: Signed ApplicationMenuItem(int order)
          Creates a new ApplicationMenuItem instance with provided menu position.
 Category: Signed ApplicationMenuItem(Object context, int order)
          Creates a new ApplicationMenuItem instance with provided context and menu position.
 
Method Summary
 Category: Signed  int hashCode()
          Retrieves a hash code value for this menu item.
 Category: Signed abstract  Object run(Object context)
          Runs the menu item given the context.
 Category: Signed abstract  String toString()
          Retrieves name menu item should use for display in a menu.
 
Methods inherited from class java.lang.Object
equals, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ApplicationMenuItem

public ApplicationMenuItem(int order)
Creates a new ApplicationMenuItem instance with provided menu position.
Parameters:
order - Display order of this item, lower numbers correspond to higher placement in the menu (relative, an entry of 0 won't necessarily result in the top most item).
Since:
JDE 3.6.0
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.

ApplicationMenuItem

public ApplicationMenuItem(Object context,
                           int order)
Creates a new ApplicationMenuItem instance with provided context and menu position.

This constructor builds a new ApplicationMenuItem given the item information and an integer representing the position of the item within the menu.

Developers should override this method to take custom actions on the context parameter.

Parameters:
context - Generic object containing context specific data.
order - Display order of this item, lower numbers correspond to higher placement in the menu (relative, an entry of 0 won't necessarily result in the top most item).
Since:
JDE 3.6.0
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.
Method Detail

hashCode

public int hashCode()
Retrieves a hash code value for this menu item.

Note: this method builds a hash out of this menu item's current position, a hash of its cookie, and a hash of the results of toString().

Overrides:
hashCode in class Object
Returns:
Hash value for this menu item.
Since:
JDE 3.6.0
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.

run

public abstract Object run(Object context)
Runs the menu item given the context.

Developers should override this method and implement specific menu handling.

Parameters:
context - Object containing the context specific information.
Returns:
New context object.
Since:
JDE 3.6.0
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.

toString

public abstract String toString()
Retrieves name menu item should use for display in a menu.

Sub-classes should override this to provide the name the menu item should use for display in a menu.

Overrides:
toString in class Object
Returns:
String describing this menu item; must not be null.
Since:
JDE 3.6.0
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.



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.