net.rim.blackberry.api.sendmenu
Class SendCommandMenu

java.lang.Object
  extended by net.rim.device.api.ui.component.Menu
      extended by net.rim.device.api.ui.menu.SubMenu
          extended by net.rim.blackberry.api.sendmenu.SendCommandMenu

public class SendCommandMenu
extends SubMenu

Represents a SubMenu component that encapsulates an array of SendCommandMenuItem objects in a context menu and is specialized for displaying and executing SendCommand objects.

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

Field Summary
Category: Signed static StringProvider DEFAULT_TEXT
          Default label of the menu.
 
Fields inherited from class net.rim.device.api.ui.component.Menu
CANCELLED, INSTANCE_CONTEXT, INSTANCE_CONTEXT_SELECTION, INSTANCE_DEFAULT, INSTANCE_FROM_MENU_KEY, MENU_POPUP, SORTED, UNDEFINED
 
Constructor Summary
Category: Signed SendCommandMenu(SendCommandMenuItem[] menuItems, StringProvider text, int ordering, int priority)
          Constructs a new SendCommandMenu instance with the specified array of SendCommandMenuItem objects, the menu’s label, and the ordering and the priority of the menu.
Category: Signed SendCommandMenu(SendCommand[] sendCommands, int ordering, int priority)
          Constructs a new SendCommandMenu instance with the specified array of SendCommand objects and the ordering and the priority of the menu.
Category: Signed SendCommandMenu(SendCommand[] sendCommands, StringProvider text, int ordering, int priority)
          Constructs a new SendCommandMenu instance with the specified array of SendCommand objects, the menu’s label, and the ordering and the priority of the menu.
 
Method Summary
Category: Signed  SendCommandMenuItem[] getSendCommandMenuItems()
          Returns the array of SendCommandMenuItem menu items that are included in this SendCommandMenu.
 
Methods inherited from class net.rim.device.api.ui.menu.SubMenu
getMenuItem, getMenuItemRunnable, setMenuItemRunnable
 
Methods inherited from class net.rim.device.api.ui.component.Menu
add, add, add, add, add, addSeparator, close, deleteAll, deleteItem, getBackground, getBorder, getCaretBackground, getDefault, getFont, getItem, getItemCookie, getItemId, getSelectedCookie, getSelectedId, getSelectedItem, getSize, isDisplayed, setBackground, setBorder, setCaretBackground, setDefault, setDefault, setFont, setItemHighlight, setTarget, show
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Field Detail

DEFAULT_TEXT

public static final StringProvider DEFAULT_TEXT
Default label of the menu.

This is used as the label for the SendCommandMenu if one is not provided to the constructor.

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


Constructor Detail

SendCommandMenu

public SendCommandMenu(SendCommand[] sendCommands,
                       int ordering,
                       int priority)
Constructs a new SendCommandMenu instance with the specified array of SendCommand objects and the ordering and the priority of the menu.

The label of the menu is set to the value of SendCommandMenu.DEFAULT_TEXT.

The constructed SendCommandMenu contains SendCommandMenuItem objects, one per SendCommand in the specified sendCommands array, and in the same order. The ordering and priority parameters are simply given to the constructor of the superclass, SubMenu.

Any null elements in the specified sendCommands array are ignored. Therefore, to exclude a SendCommand from the SendCommandMenu, the caller can simply set its element in the array to null.

Parameters:
sendCommands - An array of SendCommand objects that are used to initialize the SendCommandMenu. If the sendCommands parameter is null, then it is treated like a zero-length array and no items are added to the SendCommandMenu.
ordering - The ordering of the SendCommandMenu.
priority - The priority of the SendCommandMenu.
Throws:
IllegalArgumentException - if ordering or priority is negative.
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

SendCommandMenu

public SendCommandMenu(SendCommand[] sendCommands,
                       StringProvider text,
                       int ordering,
                       int priority)
Constructs a new SendCommandMenu instance with the specified array of SendCommand objects, the menu’s label, and the ordering and the priority of the menu.

The constructed SendCommandMenu contains SendCommandMenuItem objects, one per SendCommand in the specified sendCommands array, and in the same order. The specified text parameter is used as the menu’s label. The ordering and priority parameters are simply given to the constructor of the superclass, SubMenu.

Any null elements in the specified sendCommands array are ignored. Therefore, to exclude a SendCommand from the SendCommandMenu, the caller can simply set its element in the array to null.

Parameters:
sendCommands - An array of SendCommand objects that are used to initialize the SendCommandMenu. If the sendCommands parameter is null, then it is treated like a zero-length array and no items are added to the SendCommandMenu.
text - The name of the SendCommandMenu.
ordering - The ordering of the SendCommandMenu.
priority - The priority of the SendCommandMenu.
Throws:
NullPointerException - if text is null.
IllegalArgumentException - if ordering or priority is negative, or if text is of length 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.
Since:
BlackBerry API 7.0.0

SendCommandMenu

public SendCommandMenu(SendCommandMenuItem[] menuItems,
                       StringProvider text,
                       int ordering,
                       int priority)
Constructs a new SendCommandMenu instance with the specified array of SendCommandMenuItem objects, the menu’s label, and the ordering and the priority of the menu.

The constructed SendCommandMenu contains the specified SendCommandMenuItem objects, in the same order as in the array specified. The specified text parameter is used as the menu’s label. The ordering and priority parameters are simply given to the constructor of the superclass, SubMenu.

Any null elements in the specified menuItems array are ignored. Therefore, to exclude a SendCommand from the SendCommandMenu, the caller can simply set its element in the array to null.

Parameters:
menuItems - An array of SendCommandMenuItem objects that are used to initialize the SendCommandMenu. If the specified menuItems parameter is null, then it is treated like a zero-length array and no items are added to the SendCommandMenu.
text - The name of the SendCommandMenu.
ordering - The ordering of the SendCommandMenu.
priority - The priority of the SendCommandMenu.
Throws:
NullPointerException - if text is null.
IllegalArgumentException - if ordering or priority is negative, or if text is of length 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.
Since:
BlackBerry API 7.0.0


Method Detail

getSendCommandMenuItems

public SendCommandMenuItem[] getSendCommandMenuItems()
Returns the array of SendCommandMenuItem menu items that are included in this SendCommandMenu.

Returns:
An array of SendCommandMenuItem objects contained in this SendCommandMenu. If there are no items, an array of zero elements is returned. This method never returns null.
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