Example usage for com.vaadin.ui MenuBar setAutoOpen

List of usage examples for com.vaadin.ui MenuBar setAutoOpen

Introduction

In this page you can find the example usage for com.vaadin.ui MenuBar setAutoOpen.

Prototype

public void setAutoOpen(boolean autoOpenTopLevelMenu) 

Source Link

Document

Using this method menubar can be put into a special mode where top level menus opens without clicking on the menu, but automatically when mouse cursor is moved over the menu.

Usage

From source file:com.expressui.core.view.menu.MenuBarNode.java

License:Open Source License

MenuBar createMenuBar() {
    MenuBar menuBar = new MenuBar();
    menuBar.setSizeUndefined();//from   w  w w  .j  a  v a 2s.c  o  m
    menuBar.setAutoOpen(true);
    menuBar.setHtmlContentAllowed(true);

    for (MenuBarNode child : children.values()) {
        if (child.isViewAllowed() && child.isVisible()) {
            MenuBar.MenuItem childMenuItem = menuBar.addItem(child.caption, child.command);
            child.populate(childMenuItem);
        }
    }

    return menuBar;
}