public final class CommandMenu extends CommandItem
Command
s.Modifier and Type | Class and Description |
---|---|
static interface |
CommandMenu.Action
A multiple command wrapper which may be used to execute
different commands depending on the value of
ActionEvent.getModifiers() . |
static class |
CommandMenu.Action2
An implementation of
CommandMenu.Action which may be used
to execute two different commands depending on the value of
ActionEvent.getModifiers() . |
Modifier and Type | Field and Description |
---|---|
CommandItem[] |
items
Specifications of the menu items.
|
Constructor and Description |
---|
CommandMenu(String label,
CommandItem[] items)
Constructs a menu specification.
|
Modifier and Type | Method and Description |
---|---|
CommandMenu |
copy()
Returns a deep copy of this menu.
|
protected CommandItem |
doCopy() |
boolean |
equals(Object other) |
int |
hashCode() |
static void |
showMenu(CommandMenu menu,
Gadget gadget,
int x,
int y)
Equivalent to
showMenu(menu, gadget, x, y, false) |
static void |
showMenu(CommandMenu menu,
Gadget gadget,
int x,
int y,
boolean showAtLeft)
Display specified menu.
|
public CommandItem[] items
public CommandMenu(String label, CommandItem[] items)
label
- label of this menu; may be null
unless this
menu is a sub menu of another menuitems
- specifications of the menu itemspublic CommandMenu copy()
protected CommandItem doCopy()
doCopy
in class CommandItem
public int hashCode()
hashCode
in class CommandItem
public boolean equals(Object other)
equals
in class CommandItem
public static void showMenu(CommandMenu menu, Gadget gadget, int x, int y)
showMenu(menu, gadget, x, y, false)
public static void showMenu(CommandMenu menu, Gadget gadget, int x, int y, boolean showAtLeft)
menu
- the menu to be displayedgadget
- specified coordinates are relative to this gadgetx
- X position of the top/left corner of the menu relative to
specified gadgety
- Y position of the top/left corner of the menu relative to
specified gadgetshowAtLeft
- display the menu at the left of point
(x, y)