diff options
author | Risto Yrjänä <risto.yrjana@itmill.com> | 2008-08-06 07:45:13 +0000 |
---|---|---|
committer | Risto Yrjänä <risto.yrjana@itmill.com> | 2008-08-06 07:45:13 +0000 |
commit | f0570111014e9013b96ac80a4d2e16e182a7aa14 (patch) | |
tree | 7e054ac6d7ab83a4d7b75c828349720548564f19 /src/com/itmill/toolkit/ui/MenuBar.java | |
parent | 64d7127eb5e6b7b6eeb7b823234137367de69c4c (diff) | |
download | vaadin-framework-f0570111014e9013b96ac80a4d2e16e182a7aa14.tar.gz vaadin-framework-f0570111014e9013b96ac80a4d2e16e182a7aa14.zip |
New addItem method
svn changeset:5144/svn branch:trunk
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. * |