Example usage for com.vaadin.client ComputedStyle getPaddingHeight

List of usage examples for com.vaadin.client ComputedStyle getPaddingHeight

Introduction

In this page you can find the example usage for com.vaadin.client ComputedStyle getPaddingHeight.

Prototype

public double getPaddingHeight() 

Source Link

Document

Returns the sum of the top and bottom padding.

Usage

From source file:com.haulmont.cuba.web.toolkit.ui.client.tabsheet.CubaTabSheetWidget.java

License:Apache License

@Override
public void updateContentNodeHeight() {
    if (!isDynamicHeight()) {
        ComputedStyle fullHeight = new ComputedStyle(getElement());
        double contentHeight = fullHeight.getHeight();

        ComputedStyle tabsCs = new ComputedStyle(tabs);
        contentHeight -= tabsCs.getHeight();

        contentHeight -= deco.getOffsetHeight();

        ComputedStyle cs = new ComputedStyle(contentNode);
        contentHeight -= cs.getPaddingHeight();
        contentHeight -= cs.getBorderHeight();

        if (contentHeight < 0) {
            contentHeight = 0;/*from ww w. ja va  2 s  .  com*/
        }

        // Set proper values for content element
        double ceilHeight = Math.ceil(contentHeight);

        contentNode.getStyle().setHeight(ceilHeight, Style.Unit.PX);
    } else {
        contentNode.getStyle().clearHeight();
    }
}