diff options
author | Jonas Zipprick <jonas.zipprick@gmail.com> | 2017-12-29 11:36:05 +0100 |
---|---|---|
committer | Aleksi Hietanen <aleksi@vaadin.com> | 2017-12-29 12:36:05 +0200 |
commit | 0663acc47174bf86c02cdb7291e1c0d7b98551ed (patch) | |
tree | 2c3076f2a1b2d376575555b7eb2a8aee7a5ce893 /uitest/src/main/java/com/vaadin/tests | |
parent | 1619d1f0bbd41de3f175b9eb2f34b468ec7e0367 (diff) | |
download | vaadin-framework-0663acc47174bf86c02cdb7291e1c0d7b98551ed.tar.gz vaadin-framework-0663acc47174bf86c02cdb7291e1c0d7b98551ed.zip |
Add ContentMode for the description of MenuItems (#9984)
Adds the ability to set the content mode for the description of a menu item that is part of a menu bar.
This functionality was already available for every AbstractComponent but missing for the menu items of menu bars.
If no content mode is specified it defaults to the PREFORMATED content mode.
Diffstat (limited to 'uitest/src/main/java/com/vaadin/tests')
-rw-r--r-- | uitest/src/main/java/com/vaadin/tests/elements/menubar/MenuBarUI.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/elements/menubar/MenuBarUI.java b/uitest/src/main/java/com/vaadin/tests/elements/menubar/MenuBarUI.java index a78eae271c..d56ead71e9 100644 --- a/uitest/src/main/java/com/vaadin/tests/elements/menubar/MenuBarUI.java +++ b/uitest/src/main/java/com/vaadin/tests/elements/menubar/MenuBarUI.java @@ -16,6 +16,7 @@ package com.vaadin.tests.elements.menubar; import com.vaadin.server.VaadinRequest; +import com.vaadin.shared.ui.ContentMode; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.MenuBar; import com.vaadin.ui.MenuBar.Command; @@ -38,8 +39,11 @@ public class MenuBarUI extends AbstractTestUI { String secondaryLevelItemSuffix) { MenuBar menuBar = new MenuBar(); MenuItem file = menuBar.addItem("File" + topLevelItemSuffix, null); - file.addItem("Open" + secondaryLevelItemSuffix, new MenuBarCommand()); - file.addItem("Save" + secondaryLevelItemSuffix, new MenuBarCommand()); + file.addItem("Open" + secondaryLevelItemSuffix, new MenuBarCommand()) + .setDescription("<b>Preformatted</b>\ndescription"); + file.addItem("Save" + secondaryLevelItemSuffix, new MenuBarCommand()) + .setDescription("plain description,\n <b>HTML</b> is visible", + ContentMode.TEXT); file.addItem("Save As.." + secondaryLevelItemSuffix, new MenuBarCommand()); file.addSeparator(); @@ -52,7 +56,9 @@ public class MenuBarUI extends AbstractTestUI { new MenuBarCommand()); file.addSeparator(); - file.addItem("Exit" + secondaryLevelItemSuffix, new MenuBarCommand()); + file.addItem("Exit" + secondaryLevelItemSuffix, new MenuBarCommand()) + .setDescription("<b>HTML</b><br/>description", + ContentMode.HTML); MenuItem edit = menuBar.addItem("Edit" + topLevelItemSuffix, null); edit.addItem("Copy" + secondaryLevelItemSuffix, new MenuBarCommand()); |