Example usage for com.vaadin.server Sizeable getHeightUnits

List of usage examples for com.vaadin.server Sizeable getHeightUnits

Introduction

In this page you can find the example usage for com.vaadin.server Sizeable getHeightUnits.

Prototype

public Unit getHeightUnits();

Source Link

Document

Gets the height property units.

Usage

From source file:com.vaadHL.utl.state.ScreenInfo.java

License:Apache License

/**
 * Gets size info from a screen object/*  w  w  w .j ava2s.c o  m*/
 * 
 * @param si
 *            si the screen object implementing the {@link Sizeable}
 *            interface
 */
public void sizeFrom(Sizeable si) {
    height = si.getHeight();
    heightUnits = si.getHeightUnits();
    width = si.getWidth();
    widthUnits = si.getWidthUnits();
}

From source file:org.lunifera.runtime.web.vaadin.databinding.component.internal.SizeableHeightProperty.java

License:Open Source License

protected Object doGetValue(Object source) {
    Sizeable component = (Sizeable) source;

    Unit heightUnit = component.getHeightUnits();
    if (heightUnit == null) {
        heightUnit = Unit.PIXELS;/*  w w  w  .j  a  va2  s.co m*/
    }

    return String.format("%s%s", Float.toString(component.getHeight()), heightUnit.getSymbol());
}