diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2009-12-01 07:14:38 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2009-12-01 07:14:38 +0000 |
commit | 037c81cc4cc15027c62764e5c89d77b1c30fb33c (patch) | |
tree | 9a8f251697bbae819340afffd56d175fdb774002 /src/com/vaadin/ui/MenuBar.java | |
parent | d645c3db7409978fe318c278b1158f987fc59a6a (diff) | |
download | vaadin-framework-037c81cc4cc15027c62764e5c89d77b1c30fb33c.tar.gz vaadin-framework-037c81cc4cc15027c62764e5c89d77b1c30fb33c.zip |
fixes #3785, implemented style names for MenuBar.MenuItem
svn changeset:10110/svn branch:6.2
Diffstat (limited to 'src/com/vaadin/ui/MenuBar.java')
-rw-r--r-- | src/com/vaadin/ui/MenuBar.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/com/vaadin/ui/MenuBar.java b/src/com/vaadin/ui/MenuBar.java index 5715e230c4..528b6eec0a 100644 --- a/src/com/vaadin/ui/MenuBar.java +++ b/src/com/vaadin/ui/MenuBar.java @@ -86,6 +86,10 @@ public class MenuBar extends AbstractComponent { target.startTag("item"); target.addAttribute("id", item.getId()); + if (item.getStyleName() != null) { + target.addAttribute("style", item.getStyleName()); + } + if (item.isSeparator()) { target.addAttribute("separator", true); target.endTag("item"); @@ -130,7 +134,7 @@ public class MenuBar extends AbstractComponent { /** Deserialize changes received from client. */ @Override - public void changeVariables(Object source, Map variables) { + public void changeVariables(Object source, Map<String, Object> variables) { Stack<MenuItem> items = new Stack<MenuItem>(); boolean found = false; @@ -391,6 +395,7 @@ public class MenuBar extends AbstractComponent { private boolean enabled = true; private boolean visible = true; private boolean isSeparator = false; + private String styleName; /** * Constructs a new menu item that can optionally have an icon and a @@ -691,6 +696,15 @@ public class MenuBar extends AbstractComponent { return isSeparator; } + public void setStyleName(String styleName) { + this.styleName = styleName; + requestRepaint(); + } + + public String getStyleName() { + return styleName; + } + }// class MenuItem }// class MenuBar |