List of usage examples for com.vaadin.shared.ui.menubar MenuBarConstants ATTRIBUTE_CHECKED
String ATTRIBUTE_CHECKED
To view the source code for com.vaadin.shared.ui.menubar MenuBarConstants ATTRIBUTE_CHECKED.
Click Source Link
From source file:com.haulmont.cuba.web.widgets.addons.contextmenu.MenuBar.java
License:Apache License
private void paintItem(PaintTarget target, MenuItem item) throws PaintException { if (!item.isVisible()) { return;//w ww. j av a2 s.c o m } target.startTag("item"); target.addAttribute("id", item.getId()); if (item.getStyleName() != null) { target.addAttribute(MenuBarConstants.ATTRIBUTE_ITEM_STYLE, item.getStyleName()); } if (item.isSeparator()) { target.addAttribute("separator", true); } else { target.addAttribute("text", item.getText()); Command command = item.getCommand(); if (command != null) { target.addAttribute("command", true); } Resource icon = item.getIcon(); if (icon != null) { target.addAttribute(MenuBarConstants.ATTRIBUTE_ITEM_ICON, icon); } if (!item.isEnabled()) { target.addAttribute(MenuBarConstants.ATTRIBUTE_ITEM_DISABLED, true); } String description = item.getDescription(); if (description != null && description.length() > 0) { target.addAttribute(MenuBarConstants.ATTRIBUTE_ITEM_DESCRIPTION, description); } if (item.isCheckable()) { // if the "checked" attribute is present (either true or false), // the item is checkable target.addAttribute(MenuBarConstants.ATTRIBUTE_CHECKED, item.isChecked()); } if (item.hasChildren()) { for (MenuItem child : item.getChildren()) { paintItem(target, child); } } } target.endTag("item"); }