Example usage for com.vaadin.client LayoutManager setNeedsMeasure

List of usage examples for com.vaadin.client LayoutManager setNeedsMeasure

Introduction

In this page you can find the example usage for com.vaadin.client LayoutManager setNeedsMeasure.

Prototype

public void setNeedsMeasure(ComponentConnector component) 

Source Link

Document

Informs this LayoutManager that the size of a component might have changed.

Usage

From source file:com.haulmont.cuba.web.toolkit.ui.client.tableshared.TableWidgetDelegate.java

License:Apache License

public void scheduleLayoutForChildWidgets() {
    if (table.scrollBody != null) {
        // Fix for #VAADIN-12970, relayout cell widgets
        // Haulmont API
        ComponentConnector connector = Util.findConnectorFor(table);
        // may be null if we switch tabs fast
        if (connector != null) {
            LayoutManager lm = connector.getLayoutManager();

            for (Widget w : table.scrollBody) {
                HasWidgets row = (HasWidgets) w;
                for (Widget child : row) {
                    ComponentConnector childConnector = Util.findConnectorFor(child);
                    if (childConnector != null && childConnector.getConnectorId() != null) {
                        if (childConnector instanceof ManagedLayout
                                || childConnector instanceof AbstractLayoutConnector) {
                            lm.setNeedsMeasure(childConnector);
                        }/*from  w  w  w  .j  ava2s  . c o  m*/
                    }
                }
            }
        }
    }
}