net.rim.blackberry.api.menuitem
Class ApplicationMenuItemRepository

java.lang.Object
  extended by net.rim.blackberry.api.menuitem.ApplicationMenuItemRepository

public final class ApplicationMenuItemRepository
extends Object

Contains the functionality necessary for registering ApplicationMenuItem instances.

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 3.6.0

Field Summary
Category: Signed static long MENUITEM_ADDRESSBOOK_LIST
          ApplicationMenuItem instances registered with this ID appear when the address book is open in list mode.
Category: Signed static long MENUITEM_ADDRESSCARD_EDIT
          ApplicationMenuItem instances registered with this ID appear when an address card is open in edit mode.
Category: Signed static long MENUITEM_ADDRESSCARD_VIEW
          ApplicationMenuItem instances registered with this ID appear when an address card is open in view mode.
Category: Signed static long MENUITEM_ALARM
          Deprecated. use ApplicationMenuItemRepository.MENUITEM_CLOCK instead
Category: Signed static long MENUITEM_BROWSER
          ApplicationMenuItem instances registered with this ID appear when the browser application is running.
Category: Signed static long MENUITEM_CALENDAR
          ApplicationMenuItem instances registered with this ID appear when the calendar is open in view mode.
Category: Signed static long MENUITEM_CALENDAR_EVENT
          ApplicationMenuItem instances registered with this ID appear when a calendar event is open in view/edit mode.
Category: Signed static long MENUITEM_CAMERA_PREVIEW
          ApplicationMenuItem instances registered with this ID appear when using the camera preview screen.
Category: Signed static long MENUITEM_CLOCK
          ApplicationMenuItem instances registered with this ID appear when the clock application is running.
Category: Signed static long MENUITEM_EMAIL_EDIT
          ApplicationMenuItem instances registered with this ID appear when the email application is open in edit mode.
Category: Signed static long MENUITEM_EMAIL_VIEW
          ApplicationMenuItem instances registered with this ID appear when the email application is open in view mode.
Category: Signed static long MENUITEM_FILE_EXPLORER
          ApplicationMenuItem instances registered with this ID appear when the File Explorer application is running.
Category: Signed static long MENUITEM_FILE_EXPLORER_BROWSE
          ApplicationMenuItem instances registered with this ID appear when a user uses the File Explorer application to browse files and folders.
Category: Signed static long MENUITEM_FILE_EXPLORER_ITEM
          ApplicationMenuItem instances registered with this ID appear when a user uses the File Explorer application to open a file.
Category: Signed static long MENUITEM_GROUPADDRESS_EDIT
          ApplicationMenuItem instances registered with this ID appear when a group address entry is opened for edit.
Category: Signed static long MENUITEM_GROUPADDRESS_VIEW
          ApplicationMenuItem instances registered with this ID appear when a group address entry is opened for viewing.
Category: Signed static long MENUITEM_MAPS
          ApplicationMenuItem instances registered with this ID appear when the maps application is running.
Category: Signed static long MENUITEM_MEMO_EDIT
          ApplicationMenuItem instances registered with this ID appear when a memo is opened for editing.
Category: Signed static long MENUITEM_MEMO_LIST
          ApplicationMenuItem instances registered with this ID appear when the memo list is displayed.
Category: Signed static long MENUITEM_MEMO_VIEW
          Deprecated. use ApplicationMenuItemRepository.MENUITEM_MEMO_EDIT instead
Category: Signed static long MENUITEM_MESSAGE_LIST
          ApplicationMenuItem instances registered with this ID appear when the message list is displayed.
Category: Signed static long MENUITEM_MMS_EDIT
          ApplicationMenuItem instances registered with this ID appear when the MMS application is open in edit mode.
Category: Signed static long MENUITEM_MMS_VIEW
          ApplicationMenuItem instances registered with this ID appear when the MMS application is open in view mode.
Category: Signed static long MENUITEM_MUSIC_SERVICE_ITEM
          ApplicationMenuItem instances registered with this ID appear in the services section in the Music domain of the Media application.
Category: Signed static long MENUITEM_PHONE
          ApplicationMenuItem instances registered with this ID appear when the phone application is running.
Category: Signed static long MENUITEM_PHONELOG_VIEW
          ApplicationMenuItem instances registered with this ID appear when a call log is opened for viewing.
Category: Signed static long MENUITEM_SEARCH
          ApplicationMenuItem instances registered with this ID appear when the message search window is open.
Category: Signed static long MENUITEM_SMS_EDIT
          ApplicationMenuItem instances registered with this ID appear when the SMS application is open in edit mode.
Category: Signed static long MENUITEM_SMS_VIEW
          ApplicationMenuItem instances registered with this ID appear when the SMS application is open in view mode.
Category: Signed static long MENUITEM_SYSTEM
          ApplicationMenuItem instances registered with this ID appear on most application menus (a system wide setting).
Category: Signed static long MENUITEM_TASK_EDIT
          ApplicationMenuItem instances registered with this ID appear when a task is opened in view/edit mode.
Category: Signed static long MENUITEM_TASK_LIST
          ApplicationMenuItem instances registered with this ID appear when the task list is displayed.
Category: Signed static long MENUITEM_VIDEO_RECORDER
          ApplicationMenuItem instances registered with this ID appear when using the video recorder screen.
Category: Signed static long MENUITEM_VIDEO_SERVICE_ITEM
          ApplicationMenuItem instances registered with this ID appear in the services section in the Video domain of the Media application.
 
Method Summary
Category: Signed  void addMenuItem(long id, ApplicationMenuItem item)
          Adds a menu item to the application menu.
Category: Signed  void addMenuItem(long id, ApplicationMenuItem item, ApplicationDescriptor application)
          Adds a menu item to the application menu.
Category: Signed  void addMenuItem(long id, ApplicationMenuItem item, ApplicationDescriptor application, Object context)
          Adds a menu item to the application menu.
Category: Signed static ApplicationMenuItemRepository getInstance()
          Retrieves a handle to the systems application menu item repository.
Category: Signed  boolean removeMenuItem(long id, ApplicationMenuItem item)
          Removes a given item from a menu.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Field Detail

MENUITEM_EMAIL_VIEW

public static final long MENUITEM_EMAIL_VIEW

ApplicationMenuItem instances registered with this ID appear when the email application is open in view mode.

The ApplicationMenuItem.run(Object) method is passed a Message instance when an application menu item is invoked in this context.

See Also:
Constant Field Values
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 3.6.0

MENUITEM_EMAIL_EDIT

public static final long MENUITEM_EMAIL_EDIT
ApplicationMenuItem instances registered with this ID appear when the email application is open in edit mode.

The ApplicationMenuItem.run(Object) method is passed a Message instance when an application menu item is invoked in this context.

See Also:
Constant Field Values
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 3.6.0

MENUITEM_SMS_VIEW

public static final long MENUITEM_SMS_VIEW

ApplicationMenuItem instances registered with this ID appear when the SMS application is open in view mode.

The ApplicationMenuItem.run(Object) method is passed a TextMessage instance when an application menu item is invoked in this context.

See Also:
Constant Field Values
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 4.2.1

MENUITEM_SMS_EDIT

public static final long MENUITEM_SMS_EDIT
ApplicationMenuItem instances registered with this ID appear when the SMS application is open in edit mode.

The ApplicationMenuItem.run(Object) method is passed a TextMessage instance when an application menu item is invoked in this context.

See Also:
Constant Field Values
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 4.2.1

MENUITEM_MMS_VIEW

public static final long MENUITEM_MMS_VIEW

ApplicationMenuItem instances registered with this ID appear when the MMS application is open in view mode.

The ApplicationMenuItem.run(Object) method is passed a MultipartMessage instance when an application menu item is invoked in this context.

See Also:
Constant Field Values
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 4.3.0

MENUITEM_MMS_EDIT

public static final long MENUITEM_MMS_EDIT
ApplicationMenuItem instances registered with this ID appear when the MMS application is open in edit mode.

The ApplicationMenuItem.run(Object) method is passed a MultipartMessage instance when an application menu item is invoked in this context.

See Also:
Constant Field Values
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 4.3.0

MENUITEM_ADDRESSBOOK_LIST

public static final long MENUITEM_ADDRESSBOOK_LIST
ApplicationMenuItem instances registered with this ID appear when the address book is open in list mode.

The ApplicationMenuItem.run(Object) method is passed a Contact instance when an application menu item is invoked in this context.

See Also:
Constant Field Values
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 3.6.0

MENUITEM_ADDRESSCARD_EDIT

public static final long MENUITEM_ADDRESSCARD_EDIT
ApplicationMenuItem instances registered with this ID appear when an address card is open in edit mode.

The ApplicationMenuItem.run(Object) method is passed a Contact instance when an application menu item is invoked in this context.

See Also:
Constant Field Values
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 3.6.0

MENUITEM_ADDRESSCARD_VIEW

public static final long MENUITEM_ADDRESSCARD_VIEW
ApplicationMenuItem instances registered with this ID appear when an address card is open in view mode.

The ApplicationMenuItem.run(Object) method is passed a Contact instance when an application menu item is invoked in this context.

See Also:
Constant Field Values
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 3.6.0

MENUITEM_CALENDAR

public static final long MENUITEM_CALENDAR
ApplicationMenuItem instances registered with this ID appear when the calendar is open in view mode.

The ApplicationMenuItem.run(Object) method is passed a Event instance when an application menu item is invoked in this context.

See Also:
Constant Field Values
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 3.6.0

MENUITEM_CALENDAR_EVENT

public static final long MENUITEM_CALENDAR_EVENT
ApplicationMenuItem instances registered with this ID appear when a calendar event is open in view/edit mode.

The ApplicationMenuItem.run(Object) method is passed a Event instance when an application menu item is invoked in this context.

See Also:
Constant Field Values
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 4.0.0

MENUITEM_CAMERA_PREVIEW

public static final long MENUITEM_CAMERA_PREVIEW
ApplicationMenuItem instances registered with this ID appear when using the camera preview screen. An ApplicationDescriptor is required for this ID in addMenuItem() method.

The ApplicationMenuItem.run(Object) method is passed a String representing the image file location when an application menu item is invoked in this context. A typical string would have this format: "file:///-path-.-filename-". The file can be opened by creating a FileConnection using Connector.open(String).

See Also:
Constant Field Values
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 4.7.0

MENUITEM_MESSAGE_LIST

public static final long MENUITEM_MESSAGE_LIST
ApplicationMenuItem instances registered with this ID appear when the message list is displayed.

The ApplicationMenuItem.run(Object) method is passed a Message instance or a TextMessage instance when an application menu item is invoked in this context. If the selected message is a MMS message, a MultipartMessage instance will be passed instead.

See Also:
Constant Field Values
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 3.6.0

MENUITEM_TASK_LIST

public static final long MENUITEM_TASK_LIST
ApplicationMenuItem instances registered with this ID appear when the task list is displayed.

The ApplicationMenuItem.run(Object) method is passed a ToDo instance when an application menu item is invoked in this context.

See Also:
Constant Field Values
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 4.0.0

MENUITEM_TASK_EDIT

public static final long MENUITEM_TASK_EDIT
ApplicationMenuItem instances registered with this ID appear when a task is opened in view/edit mode.

The ApplicationMenuItem.run(Object) method is passed a ToDo instance when an application menu item is invoked in this context.

See Also:
Constant Field Values
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 4.0.0

MENUITEM_MEMO_LIST

public static final long MENUITEM_MEMO_LIST
ApplicationMenuItem instances registered with this ID appear when the memo list is displayed.

The ApplicationMenuItem.run(Object) method is passed a BlackBerryMemo instance when an application menu item is invoked in this context.

See Also:
Constant Field Values
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 4.0.0

MENUITEM_MEMO_EDIT

public static final long MENUITEM_MEMO_EDIT
ApplicationMenuItem instances registered with this ID appear when a memo is opened for editing.

The ApplicationMenuItem.run(Object) method is passed a BlackBerryMemo instance when an application menu item is invoked in this context.

See Also:
Constant Field Values
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 4.0.0

MENUITEM_MEMO_VIEW

public static final long MENUITEM_MEMO_VIEW
Deprecated. use ApplicationMenuItemRepository.MENUITEM_MEMO_EDIT instead
ApplicationMenuItem instances registered with this ID appear when a memo is opened for viewing.

The ApplicationMenuItem.run(Object) method is passed a BlackBerryMemo instance when an application menu item is invoked in this context.

See Also:
Constant Field Values
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 4.0.0

MENUITEM_PHONELOG_VIEW

public static final long MENUITEM_PHONELOG_VIEW
ApplicationMenuItem instances registered with this ID appear when a call log is opened for viewing.

The ApplicationMenuItem.run(Object) method is passed a net.rim.blackberry.api.phone.phonelogs.PhoneLog instance when an application menu item is invoked in this context.

See Also:
Constant Field Values
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 4.0.0

MENUITEM_PHONE

public static final long MENUITEM_PHONE
ApplicationMenuItem instances registered with this ID appear when the phone application is running.

See Also:
Constant Field Values
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 4.0.0

MENUITEM_ALARM

public static final long MENUITEM_ALARM
Deprecated. use ApplicationMenuItemRepository.MENUITEM_CLOCK instead
ApplicationMenuItem instances registered with this ID appear when the alarm application is running.

See Also:
Constant Field Values
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 4.0.0

MENUITEM_CLOCK

public static final long MENUITEM_CLOCK
ApplicationMenuItem instances registered with this ID appear when the clock application is running.

See Also:
Constant Field Values
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 6.0.0

MENUITEM_SEARCH

public static final long MENUITEM_SEARCH
ApplicationMenuItem instances registered with this ID appear when the message search window is open.

Note that application menu item will be present on the dialog to lookup messages only. It will not appear in other search applications, such as Universal Search, Search Notes, Search Tasks, etc.

See Also:
Constant Field Values
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 4.0.0

MENUITEM_GROUPADDRESS_EDIT

public static final long MENUITEM_GROUPADDRESS_EDIT
ApplicationMenuItem instances registered with this ID appear when a group address entry is opened for edit.

See Also:
Constant Field Values
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 4.0.0

MENUITEM_GROUPADDRESS_VIEW

public static final long MENUITEM_GROUPADDRESS_VIEW
ApplicationMenuItem instances registered with this ID appear when a group address entry is opened for viewing.

See Also:
Constant Field Values
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 4.0.0

MENUITEM_BROWSER

public static final long MENUITEM_BROWSER
ApplicationMenuItem instances registered with this ID appear when the browser application is running.

See Also:
Constant Field Values
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 4.0.0

MENUITEM_FILE_EXPLORER

public static final long MENUITEM_FILE_EXPLORER
ApplicationMenuItem instances registered with this ID appear when the File Explorer application is running. Registering an instance using this ID has the same effect as registering two otherwise identical instances using MENUITEM_FILE_EXPLORER_BROWSE and MENUITEM_FILE_EXPLORER_ITEM. If you use this ID, you must also provide an ApplicationDescriptor that describes your application. Your application will be started to run the code in the ApplicationMenuItem.run() method. You may also register a mime type String with your menu item as the context parameter. If you do, your menu item will only appear when a file matching the registered mime type is in focus or being viewed.

The ApplicationMenuItem.run(Object) method is passed a String instance (the path to the file), when an application menu item is invoked in this context.

See Also:
Constant Field Values
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 4.2.1

MENUITEM_FILE_EXPLORER_BROWSE

public static final long MENUITEM_FILE_EXPLORER_BROWSE
ApplicationMenuItem instances registered with this ID appear when a user uses the File Explorer application to browse files and folders. If you use this ID, you must also provide an ApplicationDescriptor that describes your application. When an application starts, the application invokes the ApplicationMenuItem.run() method. You may also register a mime type String with your menu item as the context parameter. If you do, your menu item will only appear when a file matching the registered mime type is in focus.

The ApplicationMenuItem.run(Object) method is passed a String instance (the path to the file), when an application menu item is invoked in this context.

See Also:
Constant Field Values
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 4.2.1

MENUITEM_FILE_EXPLORER_ITEM

public static final long MENUITEM_FILE_EXPLORER_ITEM
ApplicationMenuItem instances registered with this ID appear when a user uses the File Explorer application to open a file. If you use this ID, you must also provide an ApplicationDescriptor that describes your application. When an application starts, the application invokes the ApplicationMenuItem.run() method. You may also register a mime type String with your menu item as the context parameter. If you do, your menu item will only appear when a file matching the registered mime type is being viewed.

The ApplicationMenuItem.run(Object) method is passed a String instance (the path to the file), when an application menu item is invoked in this context.

See Also:
Constant Field Values
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 4.2.1

MENUITEM_MUSIC_SERVICE_ITEM

public static final long MENUITEM_MUSIC_SERVICE_ITEM
ApplicationMenuItem instances registered with this ID appear in the services section in the Music domain of the Media application.

The ApplicationMenuItem.run(Object) method is invoked to launch the service or application.

Menu item registered for this type may display an icon in the Media application. Refer to the ApplicationMenuItem.setIcon(net.rim.device.api.ui.image.Image) method to set the menu item icon.

See Also:
Constant Field Values
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 4.6.0

MENUITEM_VIDEO_SERVICE_ITEM

public static final long MENUITEM_VIDEO_SERVICE_ITEM
ApplicationMenuItem instances registered with this ID appear in the services section in the Video domain of the Media application.

The ApplicationMenuItem.run(Object) method is invoked to launch the service or application.

Menu item registered for this type may display icon in the Media application. Refer to the ApplicationMenuItem.setIcon(net.rim.device.api.ui.image.Image) method to set the menu item icon.

See Also:
Constant Field Values
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 4.6.0

MENUITEM_MAPS

public static final long MENUITEM_MAPS
ApplicationMenuItem instances registered with this ID appear when the maps application is running. An ApplicationDescriptor is required for this ID in addMenuItem() method.

The ApplicationMenuItem.run(Object) method is passed a MapView instance when an application menu item is invoked in this context.

See Also:
Constant Field Values
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 4.2.1

MENUITEM_SYSTEM

public static final long MENUITEM_SYSTEM
ApplicationMenuItem instances registered with this ID appear on most application menus (a system wide setting).

The ApplicationMenuItem.run(Object) method is passed a context object that is appropriate to the application from which the application menu item is invoked. For example, if it is invoked in the mail application, the context object is a Message instance.

See Also:
Constant Field Values
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 3.6.0

MENUITEM_VIDEO_RECORDER

public static final long MENUITEM_VIDEO_RECORDER
ApplicationMenuItem instances registered with this ID appear when using the video recorder screen. An ApplicationDescriptor is required for this ID in addMenuItem() method.

The ApplicationMenuItem.run(Object) method is passed a String representing the video image file location when an application menu item is invoked in this context. A typical string would have this format: "file:///-path-.-filename-". The file can be opened by creating a FileConnection using Connector.open(String).

See Also:
Constant Field Values
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 4.7.0


Method Detail

getInstance

public static ApplicationMenuItemRepository getInstance()
Retrieves a handle to the systems application menu item repository.

Returns:
Handle to the system's repository.
Throws:
ControlledAccessException - if interprocess communication (IPC) is forbidden by application control.
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 3.6.0

addMenuItem

public void addMenuItem(long id,
                        ApplicationMenuItem item)
Adds a menu item to the application menu.

Note that if any of the following conditions are true then the menu item will not be added and this method will return normally.

Parameters:
id - Repository ID.
item - The item to add to the menu.
Throws:
ControlledAccessException - if access to the resource of the specified id is forbidden by application control.
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 3.6.0

addMenuItem

public void addMenuItem(long id,
                        ApplicationMenuItem item,
                        ApplicationDescriptor application)
Adds a menu item to the application menu.

Note that if any of the following conditions are true then the menu item will not be added and this method will return normally.

Parameters:
id - Repository ID.
item - The item to add to the menu.
application - An ApplicationDescriptor that describes your application. Required for certain repository IDs (see ID definitions for more information).
Throws:
ControlledAccessException - if access to the resource of the specified id is forbidden by application control.
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 4.2.1

addMenuItem

public void addMenuItem(long id,
                        ApplicationMenuItem item,
                        ApplicationDescriptor application,
                        Object context)
Adds a menu item to the application menu.

Note that if any of the following conditions are true then the menu item will not be added and this method will return normally.

Parameters:
id - Repository ID.
item - The item to add to the menu.
application - An ApplicationDescriptor that describes your application. Required for certain repository IDs (see ID definitions for more information).
context - An object representing a context in which the menu item should be displayed. Only works with certain repository IDs (see ID definitions for more information).
Throws:
ControlledAccessException - if access to the resource of the specified id is forbidden by application control.
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 4.2.1

removeMenuItem

public boolean removeMenuItem(long id,
                              ApplicationMenuItem item)
Removes a given item from a menu.

Parameters:
id - The id of the ApplicationMenuItemRepository.
item - The menu item to be removed; if null then this method immediately returns false without doing anything.
Returns:
true if the menu item was removed, false otherwise.
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 3.6.0





Copyright 1999-2010 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. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.