diff options
Diffstat (limited to 'src/com/itmill/toolkit/ui/MenuBar.java')
-rw-r--r-- | src/com/itmill/toolkit/ui/MenuBar.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/com/itmill/toolkit/ui/MenuBar.java b/src/com/itmill/toolkit/ui/MenuBar.java index 0b137d7484..38162cf6fd 100644 --- a/src/com/itmill/toolkit/ui/MenuBar.java +++ b/src/com/itmill/toolkit/ui/MenuBar.java @@ -154,6 +154,20 @@ public class MenuBar extends AbstractComponent { } /** + * Add a new item to the menubar. Command can be null, but a caption must be + * given. + * + * @param caption + * the text for the menu item + * @param command + * the command for the menu item + * @throws IllegalArgumentException + */ + public MenuBar.MenuItem addItem(String caption, MenuBar.Command command) { + return addItem(caption, null, command); + } + + /** * Add a new item to the menubar. Icon and command can be null, but a * caption must be given. * @@ -396,6 +410,19 @@ public class MenuBar extends AbstractComponent { } /** + * Add a new item inside this item, thus creating a submenu. Command can + * be null, but a caption must be given. + * + * @param caption + * the text for the menu item + * @param command + * the command for the menu item + */ + public MenuBar.MenuItem addItem(String caption, MenuBar.Command command) { + return addItem(caption, null, command); + } + + /** * Add a new item inside this item, thus creating a submenu. Icon and * command can be null, but a caption must be given. * |