Example usage for com.vaadin.ui Image setHeight

List of usage examples for com.vaadin.ui Image setHeight

Introduction

In this page you can find the example usage for com.vaadin.ui Image setHeight.

Prototype

@Override
    public void setHeight(String height) 

Source Link

Usage

From source file:uk.co.intec.keyDatesApp.components.HeaderComponent.java

License:Apache License

/**
 * Constructor, passing the Vaadin application page
 *
 * @param ui/* ww w  . ja  v a 2  s.c  o m*/
 *            MainUI application page
 */
public HeaderComponent(MainUI ui) {
    setHeight("50px");
    setStyleName("header");

    final HorizontalLayout bannerArea = new HorizontalLayout();
    bannerArea.setStyleName("menuArea");
    bannerArea.setSizeFull();

    final ThemeResource resource = new ThemeResource("img/intec-logo.gif.png");
    final Image bannerImg = new Image();
    bannerImg.setAlternateText("Intec");
    bannerImg.setHeight("50px");
    bannerImg.setDescription("Intec Logo");
    bannerImg.setSource(resource);
    bannerImg.setWidth(null);
    bannerImg.setStyleName("bannerImg");

    setMenubar(new MenuBar());
    getMenubar().setStyleName(ValoTheme.MENU_SUBTITLE);
    getMenubar().addStyleName("valo-menu-subtitle-indent");
    getMenubar().setWidth(100, Unit.PERCENTAGE);

    if (!"Anonymous".equals(getUserName())) {
        final MenuItem logout = menubar.addItem("Logout", null);
        logout.setStyleName("menuRight");
    }

    final MenuItem userItem = menubar.addItem(getUserName(), null);
    userItem.setStyleName("menuRight");

    bannerArea.addComponents(bannerImg, menubar);
    bannerArea.setExpandRatio(menubar, 1);
    addComponent(bannerArea);
    setExpandRatio(bannerArea, 1);
    setSizeFull();
}