Example usage for com.vaadin.client ComputedStyle getBorderHeight

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

Introduction

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

Prototype

public double getBorderHeight() 

Source Link

Document

Returns the sum of the top and bottom border width.

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   w ww .j a v  a2 s.c om*/
        }

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

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