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

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

Introduction

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

Prototype

String MENU_PART_LARGE_ICONS

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

Click Source Link

Document

Add this style name to any layout with the #MENU_PART style name to make any menu items inside the menu emphasize the icons more than the captions.

Usage

From source file:org.geant.sat.ui.MainView.java

License:BSD License

/**
 * Constructor. Initializes menu./*from   w ww. j a v  a 2 s  .com*/
 * 
 * @param ui
 *            Main ui instance to access shared data.
 */
public MainView(MainUI ui) {
    super(ui);
    Design.read(this);
    addStyleName(ValoTheme.MENU_PART_LARGE_ICONS);
    // Menu items are set by roles.
    // TODO: Make a configurable bean for role & view visibility

    // Surveys are shown to admin,ass coord. and survey owner.
    if (getMainUI().getRole().isAdmin(getMainUI().getUser().getDetails())
            || getMainUI().getRole().isAssessmentCoordinator(getMainUI().getUser().getDetails())
            || getMainUI().getRole().isSurveyOwner(getMainUI().getUser().getDetails())) {
        menuContent.addComponent(createMenuButton(getString("lang.surveys"), MENU_SURVEYS));
    }
    // Entities are shown to admin, and ass coord.
    if (getMainUI().getRole().isAdmin(getMainUI().getUser().getDetails())
            || getMainUI().getRole().isAssessmentCoordinator(getMainUI().getUser().getDetails())) {
        menuContent.addComponent(createMenuButton(getString("lang.entities"), MENU_ENTITIES));
    }
    // User list is shown to admin only
    if (getMainUI().getRole().isAdmin(getMainUI().getUser().getDetails())) {
        menuContent.addComponent(createMenuButton(getString("lang.users"), MENU_USERS));
    }
    menuContent.addComponent(createMenuButton(getString("lang.profile"), MENU_PROFILE));
    menuContent.addComponent(createMenuButton(getString("lang.about"), MENU_ABOUT));
    if (getMainUI().getRole().isSurveyOwner(getMainUI().getUser().getDetails())) {
        menuContent.addComponent(createMenuButton(getString("lang.limesurvey"), MENU_LIMESURVEY));
    }
}

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 .j  a  v  a 2  s  .  co  m
    layout.setWidth(null);
    layout.setHeight("100%");
    if (logo != null) {
        layout.addComponent(logo);
    }
    if (headerLayout != null) {
        layout.addComponent(headerLayout);
    }
    return layout;
}

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

License:Apache License

/**
 * Specifies whether the side bar should use large icons or not.
 *
 * @see ValoTheme#MENU_PART_LARGE_ICONS//from ww  w .ja  va  2  s.co m
 */
public void setLargeIcons(boolean largeIcons) {
    this.largeIcons = largeIcons;
    if (getCompositionRoot() != null) {
        if (largeIcons) {
            getCompositionRoot().addStyleName(ValoTheme.MENU_PART_LARGE_ICONS);
        } else {
            getCompositionRoot().removeStyleName(ValoTheme.MENU_PART_LARGE_ICONS);
        }
    }
}