|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.ui.component.Menu
net.rim.device.api.ui.menu.SubMenu
net.rim.blackberry.api.sendmenu.SendCommandMenu
public class SendCommandMenu
Represents a SubMenu
component that encapsulates an array of
SendCommandMenuItem
objects in a context menu and is specialized for
displaying and executing SendCommand
objects.
Field Summary | ||
---|---|---|
|
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 | ||
---|---|---|
|
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. |
|
|
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. |
|
|
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 | ||
---|---|---|
|
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 |
---|
public static final StringProvider DEFAULT_TEXT
This is used as the label for the SendCommandMenu
if one
is not provided to the constructor.
Constructor Detail |
---|
public SendCommandMenu(SendCommand[] sendCommands, int ordering, int priority)
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
.
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
.
IllegalArgumentException
- if ordering
or
priority
is negative.public SendCommandMenu(SendCommand[] sendCommands, StringProvider text, int ordering, int priority)
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
.
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
.
NullPointerException
- if text
is null
.
IllegalArgumentException
- if ordering
or
priority
is negative, or if text
is of length 0.public SendCommandMenu(SendCommandMenuItem[] menuItems, StringProvider text, int ordering, int priority)
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
.
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
.
NullPointerException
- if text
is null
.
IllegalArgumentException
- if ordering
or
priority
is negative, or if text
is of length 0.Method Detail |
---|
public SendCommandMenuItem[] getSendCommandMenuItems()
SendCommandMenuItem
menu items that are
included in this SendCommandMenu
.
SendCommandMenuItem
objects contained in
this SendCommandMenu
. If there are no items, an array of
zero elements is returned. This method never returns null
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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