Example usage for com.vaadin.shared.ui.menubar MenuBarConstants OPEN_ROOT_MENU_ON_HOWER

List of usage examples for com.vaadin.shared.ui.menubar MenuBarConstants OPEN_ROOT_MENU_ON_HOWER

Introduction

In this page you can find the example usage for com.vaadin.shared.ui.menubar MenuBarConstants OPEN_ROOT_MENU_ON_HOWER.

Prototype

String OPEN_ROOT_MENU_ON_HOWER

To view the source code for com.vaadin.shared.ui.menubar MenuBarConstants OPEN_ROOT_MENU_ON_HOWER.

Click Source Link

Usage

From source file:com.haulmont.cuba.web.widgets.addons.contextmenu.MenuBar.java

License:Apache License

/** Paint (serialise) the component for the client. */
@Override/* ww  w  . ja  va 2  s. c o m*/
public void paintContent(PaintTarget target) throws PaintException {
    target.addAttribute(MenuBarConstants.OPEN_ROOT_MENU_ON_HOWER, openRootOnHover);

    if (isHtmlContentAllowed()) {
        target.addAttribute(MenuBarConstants.HTML_CONTENT_ALLOWED, true);
    }

    target.startTag("options");

    if (getWidth() > -1) {
        target.startTag("moreItem");
        target.addAttribute("text", moreItem.getText());
        if (moreItem.getIcon() != null) {
            target.addAttribute("icon", moreItem.getIcon());
        }
        target.endTag("moreItem");
    }

    target.endTag("options");
    target.startTag("items");

    // This generates the tree from the contents of the menu
    for (MenuItem item : getItems()) {
        paintItem(target, item);
    }

    target.endTag("items");
}