Example usage for com.vaadin.ui HorizontalLayout setHeight

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

Introduction

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

Prototype

@Override
    public void setHeight(float height, Unit unit) 

Source Link

Usage

From source file:org.ripla.web.demo.skin.stylish.Skin.java

License:Open Source License

@Override
public Component getHeader(final String inAppName) {
    final HorizontalLayout out = new HorizontalLayout();
    out.setStyleName("demo-header"); //$NON-NLS-1$
    out.setWidth("100%"); //$NON-NLS-1$
    out.setHeight(50, Unit.PIXELS);

    final Label lTitle = LabelHelper.createLabel("Ripla Demo [with stylish skin]", "demo-header-text");
    lTitle.setSizeUndefined();//from w  w  w  .j  a v  a  2  s. c  om
    out.addComponent(lTitle);
    out.setComponentAlignment(lTitle, Alignment.MIDDLE_CENTER);

    return out;
}

From source file:org.sensorhub.ui.AdminUI.java

License:Mozilla Public License

protected Component buildHeader() {
    HorizontalLayout header = new HorizontalLayout();
    header.setMargin(false);/*from  w  ww  . j a  v  a2  s  .c  om*/
    header.setHeight(100.0f, Unit.PIXELS);
    header.setWidth(100.0f, Unit.PERCENTAGE);
    Image img = new Image(null, LOGO_ICON);
    img.setHeight(90, Unit.PIXELS);
    img.setStyleName(STYLE_LOGO);
    header.addComponent(img);
    Label title = new Label("SensorHub");
    title.addStyleName(UIConstants.STYLE_H1);
    title.addStyleName(STYLE_LOGO);
    title.setWidth(null);
    header.addComponent(title);
    header.setExpandRatio(img, 0);
    header.setExpandRatio(title, 1);
    header.setComponentAlignment(img, Alignment.MIDDLE_LEFT);
    header.setComponentAlignment(title, Alignment.MIDDLE_RIGHT);
    return header;
}

From source file:org.vaadin.addon.itemlayout.demo.client.ui.ItemLayoutDemoUI.java

License:Open Source License

private Component initItemVerticalExamples() {
    // Layout to show examples
    final VerticalLayout example = new VerticalLayout();
    example.setHeight(100, Unit.PERCENTAGE);
    example.addComponent(new Label("Demo for ItemVertical"));

    final HorizontalLayout horizontalLayout = new HorizontalLayout();
    horizontalLayout.setHeight(100, Unit.PERCENTAGE);
    horizontalLayout.setMargin(true);/* w ww . j av a2  s  .com*/
    example.addComponent(horizontalLayout);

    final ItemVertical itemVertical = buildDefaultItemVertical();
    itemVertical.addItemClickListener(buildClickListener());

    final OptionGroup sample = buildSelectableOption();
    sample.addValueChangeListener(buildValueChangeListener(itemVertical));
    horizontalLayout.addComponent(sample);
    horizontalLayout.addComponent(itemVertical);
    return example;
}

From source file:org.vaadin.tori.component.Breadcrumbs.java

License:Apache License

private Component getCategoryLink(final Category category) {
    HorizontalLayout result = new HorizontalLayout();
    result.setSpacing(true);/*w w w .ja  va2s. co m*/
    result.setHeight(100.0f, Unit.PERCENTAGE);
    result.addStyleName("categorylink");
    final Link crumb = new Link(category.getName(), new ExternalResource(
            "#" + ToriNavigator.ApplicationView.CATEGORIES.getUrl() + "/" + category.getId()));
    crumb.setHeight(100.0f, Unit.PERCENTAGE);
    result.addComponent(crumb);
    result.setComponentAlignment(crumb, Alignment.MIDDLE_CENTER);
    Component siblingMenu = getSiblingMenuBar(category);
    siblingMenu.setHeight(100.0f, Unit.PERCENTAGE);
    result.addComponent(siblingMenu);
    result.setComponentAlignment(siblingMenu, Alignment.MIDDLE_CENTER);
    return result;
}

From source file:org.vaadin.tori.util.ComponentUtil.java

License:Apache License

public static HorizontalLayout getHeaderLayout(final String titleString) {
    final HorizontalLayout result = new HorizontalLayout();
    result.setWidth(100.0f, Unit.PERCENTAGE);
    result.setHeight(56.0f, Unit.PIXELS);
    result.setSpacing(true);// w  ww  .j a  v  a  2s .co  m
    result.setMargin(true);
    result.addStyleName("headerlayout");
    Component title = getHeadingLabel(titleString, HeadingLevel.H2);
    result.addComponent(title);
    result.setComponentAlignment(title, Alignment.MIDDLE_LEFT);
    return result;
}