Example usage for com.vaadin.client Util getRequiredHeight

List of usage examples for com.vaadin.client Util getRequiredHeight

Introduction

In this page you can find the example usage for com.vaadin.client Util getRequiredHeight.

Prototype

@Deprecated
public static int getRequiredHeight(Widget widget) 

Source Link

Usage

From source file:com.haulmont.cuba.web.widgets.client.addons.dragdroplayouts.ui.csslayout.VDDCssLayout.java

License:Apache License

private void updatePlaceHolderStyleProperties(VDragEvent drag) {
    int width = 0;
    int height = 0;
    String className = "";

    placeHolderElement.setClassName(DRAG_SHADOW_STYLE_NAME);

    ComponentConnector draggedConnector = (ComponentConnector) drag.getTransferable()
            .getData(Constants.TRANSFERABLE_DETAIL_COMPONENT);
    if (draggedConnector != null) {
        height = Util.getRequiredHeight(draggedConnector.getWidget());
        width = Util.getRequiredWidth(draggedConnector.getWidget());
        className = draggedConnector.getWidget().getElement().getClassName();
        className = className.replaceAll(VLayoutDragDropMouseHandler.ACTIVE_DRAG_SOURCE_STYLENAME, "");
        placeHolderElement.addClassName(className);
    } else if (drag.getElementOver() != getElement()) {
        width = 3;// ww w.java 2s.  c o m
        height = drag.getElementOver().getOffsetHeight();
    }

    placeHolderElement.getStyle().setWidth(width, Unit.PX);
    placeHolderElement.getStyle().setHeight(height, Unit.PX);
}

From source file:fi.jasoft.simplecalendar.client.SimpleCalendarWidget.java

License:Apache License

private void calculateRowHeights() {
    int totalHeight = Util.getRequiredHeight(this)
            - Util.measureVerticalPaddingAndBorder(grid.getElement(), 10);
    double rowHeight = totalHeight / ROWS;

    for (int r = 0; r < ROWS; r++) {
        for (int c = 0; c < COLUMNS; c++) {
            if (r > 0) {
                grid.getCellFormatter().getElement(r, c).getStyle().setHeight(rowHeight, Unit.PX);
            }/*w  w w  .  j a  v a  2 s  .c  om*/
        }
    }
}

From source file:org.vaadin.tepi.listbuilder.widgetset.client.ui.VListBuilder.java

License:Apache License

void setInternalHeights() {
    int captionHeight = 0;
    int totalHeight = getOffsetHeight();

    if (optionsCaption != null) {
        captionHeight = Util.getRequiredHeight(optionsCaption);
    } else if (selectionsCaption != null) {
        captionHeight = Util.getRequiredHeight(selectionsCaption);
    }//w w  w .j  ava2  s .  c  om
    String selectHeight = (totalHeight - captionHeight) + "px";

    selections.setHeight(selectHeight);
    options.setHeight(selectHeight);
}