net.rim.device.api.ui.menu
Class SubMenu

java.lang.Object
  extended by net.rim.device.api.ui.component.Menu
      extended by net.rim.device.api.ui.menu.SubMenu
Direct Known Subclasses:
SendCommandMenu, ContentHandlerMenu

public class SubMenu
extends Menu

A submenu that can be added to a Menu instance by invoking Menu.add(SubMenu submenu).

Since:
BlackBerry API 6.0.0

Field Summary
 
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
SubMenu(MenuItem[] items, String text, int ordering, int priority)
          Constructs a submenu.
SubMenu(MenuItem[] items, ResourceBundle rb, int rbId, int ordering, int priority)
          Constructs a submenu.
SubMenu(MenuItem[] items, StringProvider stringProvider, int ordering, int priority)
          Constructs a submenu.
 
Method Summary
 MenuItem getMenuItem()
          Retrieves the menu item that is to be added to the parent menu and that causes the submenu to be displayed when invoked.
 Runnable getMenuItemRunnable()
          Return the runnable that will be invoked when the run() method of the MenuItem returned from getMenuItem() is invoked.
 void setMenuItemRunnable(Runnable runnable)
          Set a Runnable that will be invoked when the run() method of the MenuItem returned from getMenuItem() is invoked.
 
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
 



Constructor Detail

SubMenu

public SubMenu(MenuItem[] items,
               String text,
               int ordering,
               int priority)
Constructs a submenu.

Parameters:
items - Array of MenuItem objects to add to the menu.
text - Text to identify the submenu item in the parent menu.
ordering - Ordering of the submenu item relative to other items in the parent menu.
priority - Priority of the submenu item within the parent menu.
Since:
BlackBerry API 6.0.0

SubMenu

public SubMenu(MenuItem[] items,
               StringProvider stringProvider,
               int ordering,
               int priority)
Constructs a submenu.

Parameters:
items - Array of MenuItem objects to add to the menu.
stringProvider - StringProvider containing text to identify the submenu item in the parent menu.
ordering - Ordering of the submenu item relative to other items in the parent menu.
priority - Priority of the submenu item within the parent menu.
Since:
BlackBerry API 7.0.0

SubMenu

public SubMenu(MenuItem[] items,
               ResourceBundle rb,
               int rbId,
               int ordering,
               int priority)
Constructs a submenu.

Parameters:
items - Array of MenuItem objects to add to the menu.
rb - Resource bundle which contains the text string to identify the submenu in the parent menu.
rbId - Identifier of the submenu text string within the resource bundle rb.
ordering - Ordering of the submenu item relative to other items in the parent menu.
priority - Priority of the submenu item within the parent menu.
Since:
BlackBerry API 6.0.0


Method Detail

getMenuItem

public MenuItem getMenuItem()
Retrieves the menu item that is to be added to the parent menu and that causes the submenu to be displayed when invoked.

Returns:
Submenu item added to the parent menu item.
Since:
BlackBerry API 6.0.0

setMenuItemRunnable

public void setMenuItemRunnable(Runnable runnable)
Set a Runnable that will be invoked when the run() method of the MenuItem returned from getMenuItem() is invoked.

Parameters:
runnable - The Runnable to be invoked, it can be null.
Since:
BlackBerry API 7.0.0

getMenuItemRunnable

public Runnable getMenuItemRunnable()
Return the runnable that will be invoked when the run() method of the MenuItem returned from getMenuItem() is invoked.

Returns:
runnable The Runnable to be invoked, it can be null.
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