OME
Class MenuMethod
java.lang.Object
|
+--OME.AbstractPluginMethod
|
+--OME.MenuMethod
- public class MenuMethod
- extends AbstractPluginMethod
This class is a plugin method which is used to implement a submenu
containing several other PluginMethod
s (some of which
could be MenuMethods themselves). This class is analogous to Java's
JMenu which contains several JMenuItem's some of which could be JMenu's
themselves.
- See Also:
PluginMethod
Constructor Summary |
MenuMethod(java.lang.String name)
Constructs a menu method. |
Method Summary |
void |
addItem(PluginMethod m)
Adds the specified plugin method to the submenu collection. |
java.lang.String |
getName()
Returns the name of the menu method. |
java.util.Collection |
getSubmenu()
Returns a collection of PluginMethod s that are contained
in the submenu of this Menu Method . |
void |
setSubmenu(java.util.Collection c)
Adds all the plugin methods in the specified collection to the submenu
of this MenuMethod. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
MenuMethod
public MenuMethod(java.lang.String name)
- Constructs a menu method.
- Parameters:
name
- the name to be associated with this
MenuMethod
. This is the name that will be displayed in the
menubar (if this implements a top-level menu) or in the menu (if this
implements a submenu).
getName
public java.lang.String getName()
- Returns the name of the menu method.
- Overrides:
- getName in class AbstractPluginMethod
- Returns:
- the name of the submenu.
- See Also:
PluginMethod.getName()
getSubmenu
public java.util.Collection getSubmenu()
- Returns a collection of
PluginMethod
s that are contained
in the submenu of this Menu Method
.
- Overrides:
- getSubmenu in class AbstractPluginMethod
- Returns:
- the
Collection
of PluginMethods
that
are contained in this MenuMethod
. - See Also:
getSubMenu()
addItem
public void addItem(PluginMethod m)
- Adds the specified plugin method to the submenu collection.
- Parameters:
m
- the PluginMethod
to be added.
setSubmenu
public void setSubmenu(java.util.Collection c)
- Adds all the plugin methods in the specified collection to the submenu
of this MenuMethod. Any and all plugin methods previously in the submenu
will be replaced.
- Parameters:
c
- the Collection
of PluginMethods
that to be added to the submenu of this menu method. This collection of
plugin methods will comprise the new submenu of this menu method.