aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/itmill/toolkit/ui/MenuBar.java
diff options
context:
space:
mode:
authorRisto Yrjänä <risto.yrjana@itmill.com>2008-08-06 07:45:13 +0000
committerRisto Yrjänä <risto.yrjana@itmill.com>2008-08-06 07:45:13 +0000
commitf0570111014e9013b96ac80a4d2e16e182a7aa14 (patch)
tree7e054ac6d7ab83a4d7b75c828349720548564f19 /src/com/itmill/toolkit/ui/MenuBar.java
parent64d7127eb5e6b7b6eeb7b823234137367de69c4c (diff)
downloadvaadin-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.java27
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.
*