Example usage for com.vaadin.ui AbstractOrderedLayout setExpandRatio

List of usage examples for com.vaadin.ui AbstractOrderedLayout setExpandRatio

Introduction

In this page you can find the example usage for com.vaadin.ui AbstractOrderedLayout setExpandRatio.

Prototype

public void setExpandRatio(Component component, float ratio) 

Source Link

Document

This method is used to control how excess space in layout is distributed among components.

Usage

From source file:org.jdal.vaadin.ui.Box.java

License:Apache License

/**
 * Try to imitate HorizontalStruct on Swing BoxLayout
 * @param layout Layout to add the struct
 * @param width struct withd//from ww w.  j  ava  2 s.co  m
 */
public static void addHorizontalStruct(AbstractOrderedLayout layout, int width) {
    Label label = new Label();
    label.setWidth(width + "px");
    layout.addComponent(label);
    layout.setExpandRatio(label, 0f);
}

From source file:org.jdal.vaadin.ui.Box.java

License:Apache License

/**
 * Try to imitate VerticalStruct of Swing BoxLayout
 * @param layout  layout to add struct/*from w w w  . j  av a 2s. c om*/
 * @param height struct height
 */
public static void addVerticalStruct(AbstractOrderedLayout layout, int height) {
    Label label = new Label();
    label.setHeight(height + "px");
    layout.addComponent(label);
    layout.setExpandRatio(label, 0f);
}