| java.lang.Object javax.microedition.lcdui.Command com.sun.midp.chameleon.SubMenuCommand
SubMenuCommand | public class SubMenuCommand extends Command (Code) | | The SubMenuCommand is an extension of LCDUI's Command object.
It represents a collection of Commands which should be made
available as a type of "sub menu" under a single Command heading.
|
Constructor Summary | |
public | SubMenuCommand(String label, int commandType, int priority) Creates a new command object with the given short
label,
type, and
priority.
The newly created command has no long label. | public | SubMenuCommand(String shortLabel, String longLabel, int commandType, int priority) Creates a new command object with the given
labels,
type, and
priority.
The short label is required and must not be
null . |
Method Summary | |
public synchronized void | addSubCommand(Command cmd) Adds the given Command to the list of sub commands. | public synchronized void | addSubCommands(Command[] cmds) Adds the given set of Commands to the list of sub commands. | public synchronized Command[] | getSubCommands() Retrieves the set of subcommands from this SubMenuCommand.
This method will return a copy of the internal array holding
the set of sub menu Commands.
an array holding the set of Commands to be shownon the "submenu" for this SubMenuCommand. | public synchronized void | notifyListener(Command c) Called to notify the CommandListener of this SubMenuCommand that
a sub command has been selected. | public synchronized void | removeAll() Removes all commands that are currently in the list of sub commands. | public void | setListener(CommandListener listener) Sets the CommandListener of this SubMenuCommand to notify when one
of the sub commands is selected. |
listener | protected CommandListener listener(Code) | | The CommandListener to notify when a sub command is selected.
|
subCommands | protected Command[] subCommands(Code) | | An array holding the Commands that are part of the "submenu".
|
SubMenuCommand | public SubMenuCommand(String label, int commandType, int priority)(Code) | | Creates a new command object with the given short
label,
type, and
priority.
The newly created command has no long label. This constructor is
identical to Command(label, null, commandType, priority) .
Parameters: label - the command's short label Parameters: commandType - the command's type Parameters: priority - the command's priority value throws: NullPointerException - if label is null throws: IllegalArgumentException - if the commandType is an invalid type See Also: SubMenuCommand.Command(String,String,int,int) |
SubMenuCommand | public SubMenuCommand(String shortLabel, String longLabel, int commandType, int priority)(Code) | | Creates a new command object with the given
labels,
type, and
priority.
The short label is required and must not be
null . The long label is
optional and may be null if the command is to have
no long label.
Parameters: shortLabel - the command's short label Parameters: longLabel - the command's long label, or null if none Parameters: commandType - the command's type Parameters: priority - the command's priority value throws: NullPointerException - if shortLabel isnull throws: IllegalArgumentException - if the commandType is aninvalid type |
addSubCommand | public synchronized void addSubCommand(Command cmd)(Code) | | Adds the given Command to the list of sub commands.
Parameters: cmd - The Command to add to the current list of submenu commands throws: IllegalArgumentException - if the given Command is null |
addSubCommands | public synchronized void addSubCommands(Command[] cmds)(Code) | | Adds the given set of Commands to the list of sub commands.
Parameters: cmds - An array of Commands to add to the current list of submenu commands throws: IllegalArgumentException - if the given array is null |
getSubCommands | public synchronized Command[] getSubCommands()(Code) | | Retrieves the set of subcommands from this SubMenuCommand.
This method will return a copy of the internal array holding
the set of sub menu Commands.
an array holding the set of Commands to be shownon the "submenu" for this SubMenuCommand. 'null'means this SubMenuCommand has no sub commands. |
notifyListener | public synchronized void notifyListener(Command c)(Code) | | Called to notify the CommandListener of this SubMenuCommand that
a sub command has been selected.
Parameters: c - the Command that was selected |
removeAll | public synchronized void removeAll()(Code) | | Removes all commands that are currently in the list of sub commands.
|
setListener | public void setListener(CommandListener listener)(Code) | | Sets the CommandListener of this SubMenuCommand to notify when one
of the sub commands is selected.
Parameters: listener - the CommandListener to notify when a sub command isselected |
|
|