|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.ui.MenuItem
net.rim.blackberry.api.sendmenu.SendCommandMenuItem
public class SendCommandMenuItem
Represents a menu item for a SendCommand
.
This class of menu items is specialized for displaying
SendCommand
objects in a SendCommandMenu
.
Field Summary |
---|
Fields inherited from class net.rim.device.api.ui.MenuItem |
---|
CANCEL_SELECT, CHANGE_OPTION, CLOSE, COPY, CUT, ORDINAL_COMPARATOR, PASTE, SAVE_CLOSE, SELECT |
Constructor Summary | ||
---|---|---|
|
SendCommandMenuItem(SendCommand sendCommand,
int ordinal,
int priority)
Constructs a new SendCommandMenuItem instance with the
specified SendCommand , ordinal, and priority. |
|
|
SendCommandMenuItem(SendCommand sendCommand,
StringProvider text,
int ordinal,
int priority)
Constructs a new SendCommandMenuItem instance with the
specified SendCommand , text that is to be used as the label
for this SendCommandMenuItem , ordinal, and priority. |
Method Summary | ||
---|---|---|
|
SendCommand |
getSendCommand()
Returns the SendCommand that was provided to the constructor
and is to be executed when this SendCommandMenuItem is
selected by the user. |
|
void |
handleSendCommandException(SendCommand sendCommand,
SendCommandException exception)
Displays an error message in a dialog box. |
|
void |
run()
Executes the SendCommand that is encapsulated in this
SendCommandMenuItem . |
Methods inherited from class net.rim.device.api.ui.MenuItem |
---|
createMenuItem, getBundle, getCommand, getCommandContext, getIcon, getId, getOrdinal, getPrefab, getPriority, getTarget, getTextStringProvider, isSeparator, separator, setCommand, setCommandContext, setIcon, setOrdinal, setPriority, setText, setText, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SendCommandMenuItem(SendCommand sendCommand, int ordinal, int priority)
SendCommandMenuItem
instance with the
specified SendCommand
, ordinal, and priority.
The value that is returned from
sendCommand.getDisplayName()
is used as the label for the
SendCommandMenuItem
.
sendCommand
- The command that will be executed when the user
selects this menu item.ordinal
- The ordering of this menu item.priority
- The priority of this menu item.
NullPointerException
- if sendCommand
is
null
.
IllegalArgumentException
- if priority
or
ordinal
is negative.public SendCommandMenuItem(SendCommand sendCommand, StringProvider text, int ordinal, int priority)
SendCommandMenuItem
instance with the
specified SendCommand
, text that is to be used as the label
for this SendCommandMenuItem
, ordinal, and priority.
sendCommand
- The command that will be executed when the user
selects this menu item.text
- The name of this menu item.ordinal
- The ordering of this menu item.priority
- The priority of this menu item.
NullPointerException
- if sendCommand
or
text
is null
.
IllegalArgumentException
- if priority
or
ordinal
is negative.Method Detail |
---|
public SendCommand getSendCommand()
SendCommand
that was provided to the constructor
and is to be executed when this SendCommandMenuItem
is
selected by the user.
SendCommand
of this
SendCommandMenuItem
. This method never returns
null
.public void handleSendCommandException(SendCommand sendCommand, SendCommandException exception)
This method is invoked by the SendCommandMenuItem.run()
method of this
SendCommandMenuItem
if the SendCommand.run()
method
of the given SendCommand
throws a
SendCommandException
.
This method may be overridden in subclasses.
sendCommand
- The executed SendCommand
.exception
- The SendCommandException
that was
thrown by the executed SendCommand
.public void run()
SendCommand
that is encapsulated in this
SendCommandMenuItem
.
This method invokes the SendCommand.run()
method of the
encapsulated SendCommand
. If the invoked
run()
method throws a SendCommandException
,
then this SendCommandMenuItem
object’s
#handleSendCommandException()
method is invoked.
run
in interface Runnable
run
in class MenuItem
Thread.run()
|
|||||||||
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