Example usage for com.vaadin.ui.themes ValoTheme MENU_PART

List of usage examples for com.vaadin.ui.themes ValoTheme MENU_PART

Introduction

In this page you can find the example usage for com.vaadin.ui.themes ValoTheme MENU_PART.

Prototype

String MENU_PART

To view the source code for com.vaadin.ui.themes ValoTheme MENU_PART.

Click Source Link

Document

Add this style name to any layout and place it inside a layout with the #MENU_ROOT style to build a menu component.

Usage

From source file:org.fatal1t.finbe.ui.components.Menu.java

public Menu() {
    MenuBar.Command itemsCommand = new MenuBar.Command() {
        @Override/*w  w  w  . j ava  2s .  co  m*/
        public void menuSelected(MenuBar.MenuItem selectedItem) {
            getUI().getNavigator().navigateTo(ItemsView.NAME);
        }
    };
    MenuBar.Command dashboardCommand = new MenuBar.Command() {
        @Override
        public void menuSelected(MenuBar.MenuItem selectedItem) {
            getUI().getNavigator().navigateTo(DashboardView.NAME);
        }
    };

    mainMenu.addItem("Desired Items", itemsCommand);
    mainMenu.addItem("Dashboard", dashboardCommand);
    mainMenu.setVisible(true);

    addComponent(mainMenu);
    this.setDefaultComponentAlignment(Alignment.TOP_CENTER);
    this.setStyleName(ValoTheme.MENU_PART);
    //this.setWidth(1920, Unit.PIXELS);
}

From source file:org.ikasan.dashboard.ui.IkasanUI.java

License:BSD License

private Component buildContent() {
    menuContent.addStyleName("sidebar");
    menuContent.addStyleName(ValoTheme.MENU_PART);
    menuContent.addStyleName("no-vertical-drag-hints");
    menuContent.addStyleName("no-horizontal-drag-hints");
    menuContent.setWidth(null);/*ww  w. j a va 2  s  . com*/
    menuContent.setHeight("100%");

    menuContent.addComponent(this.menu);

    return menuContent;
}

From source file:org.vaadin.spring.sidebar.components.ValoSideBar.java

License:Apache License

@Override
protected CssLayout createCompositionRoot() {
    CssLayout layout = new CssLayout();
    layout.addStyleName(ValoTheme.MENU_PART);
    if (largeIcons) {
        layout.addStyleName(ValoTheme.MENU_PART_LARGE_ICONS);
    }/*from  w  w  w .  ja v  a  2s. c  om*/
    layout.setWidth(null);
    layout.setHeight("100%");
    if (logo != null) {
        layout.addComponent(logo);
    }
    if (headerLayout != null) {
        layout.addComponent(headerLayout);
    }
    return layout;
}