protected boolean selected = false;
protected String description = null;
+ private String styleName;
+
/**
* Default menu item {@link Widget} constructor for GWT.create().
*
super.setStyleName(primaryStyleName + "-menuitem");
}
+ if (styleName != null) {
+ addStyleDependentName(styleName);
+ }
+
if (enabled) {
removeStyleDependentName("disabled");
} else {
}
if (uidl.hasAttribute(MenuBarConstants.ATTRIBUTE_ITEM_STYLE)) {
- String itemStyle = uidl
+ styleName = uidl
.getStringAttribute(MenuBarConstants.ATTRIBUTE_ITEM_STYLE);
- addStyleDependentName(itemStyle);
}
if (uidl.hasAttribute(MenuBarConstants.ATTRIBUTE_ITEM_DESCRIPTION)) {
description = uidl
.getStringAttribute(MenuBarConstants.ATTRIBUTE_ITEM_DESCRIPTION);
}
+
+ updateStyleNames();
}
public TooltipInfo getTooltip() {
<td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]/domChild[0]</td>
<td>my-menu-bar-menuitem</td>
</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]/domChild[0]</td>
+ <td>my-menu-bar-menuitem-normal</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]/domChild[0]</td>
+ <td>icon-white</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]/domChild[0]</td>
+ <td>icon-headphones</td>
+</tr>
<tr>
<td>assertCSSClass</td>
<td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]/domChild[1]</td>
<td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]/domChild[0]</td>
<td>my-other-menu-menuitem</td>
</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]/domChild[0]</td>
+ <td>my-other-menu-menuitem-normal</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]/domChild[0]</td>
+ <td>icon-white</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]/domChild[0]</td>
+ <td>icon-headphones</td>
+</tr>
<tr>
<td>assertCSSClass</td>
<td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]/domChild[1]</td>
<td>vaadin=runcomvaadintestscomponentsmenubarMenuBarPrimaryStylenames::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VMenuBar[0]#item0</td>
<td>[tab]</td>
</tr>
-
</tbody></table>
</body>
</html>
mainMenu.setPrimaryStyleName("my-menu-bar");
MenuItem submenu1 = mainMenu.addItem("Submenu1", null);
+ submenu1.setStyleName("normal icon-white icon-headphones");
+
MenuItem item1 = submenu1.addItem("Item1", null);
item1.setCheckable(true);
item1.setStyleName("my-menu-item");