<commit_before>/*
 * Copyright (c) 2008-2013 Haulmont. All rights reserved.
 * Use is subject to license terms, see http://www.cuba-platform.com/license for details.
 */

package com.haulmont.cuba.web.toolkit.ui.client.fieldgroup;

import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.Scheduler;
import com.haulmont.cuba.web.toolkit.ui.CubaFieldGroup;
import com.haulmont.cuba.web.toolkit.ui.client.groupbox.CubaGroupBoxConnector;
import com.vaadin.client.ApplicationConnection;
import com.vaadin.client.BrowserInfo;
import com.vaadin.client.UIDL;
import com.vaadin.client.communication.StateChangeEvent;
import com.vaadin.shared.ui.Connect;

/**
 * @author artamonov
 * @version $Id$
 */
@Connect(CubaFieldGroup.class)
public class CubaFieldGroupConnector extends CubaGroupBoxConnector {

    protected boolean forcedUpdateSize = !BrowserInfo.get().isChrome();

    @Override
    public CubaFieldGroupWidget getWidget() {
        return (CubaFieldGroupWidget) super.getWidget();
    }

    @Override
    protected CubaFieldGroupWidget createWidget() {
        return GWT.create(CubaFieldGroupWidget.class);
    }

    @Override
    public CubaFieldGroupState getState() {
        return (CubaFieldGroupState) super.getState();
    }

    @Override
    public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
        super.updateFromUIDL(uidl, client);

        // Hot fix for Vaadin bug #12672
        // Empty space on page after expanded component - incorrect height calculation in Chrome
        if (!forcedUpdateSize && isUndefinedHeight()) {
            Scheduler.get().scheduleFixedDelay(new Scheduler.RepeatingCommand() {
                @Override
                public boolean execute() {
                    if (getLayoutManager() != null) {
                        getLayoutManager().forceLayout();

                        forcedUpdateSize = true;
                    }
                    return true;
                }
            }, 200);
        }
    }

    @Override
    public void onStateChanged(StateChangeEvent stateChangeEvent) {<commit_msg>Нельзя открыть пункт меню после закрытия editor'а в chrome'е #PL-2766<commit_after>/*
 * Copyright (c) 2008-2013 Haulmont. All rights reserved.
 * Use is subject to license terms, see http://www.cuba-platform.com/license for details.
 */

package com.haulmont.cuba.web.toolkit.ui.client.fieldgroup;

import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.Scheduler;
import com.haulmont.cuba.web.toolkit.ui.CubaFieldGroup;
import com.haulmont.cuba.web.toolkit.ui.client.groupbox.CubaGroupBoxConnector;
import com.vaadin.client.ApplicationConnection;
import com.vaadin.client.BrowserInfo;
import com.vaadin.client.UIDL;
import com.vaadin.client.communication.StateChangeEvent;
import com.vaadin.shared.ui.Connect;

/**
 * @author artamonov
 * @version $Id$
 */
@Connect(CubaFieldGroup.class)
public class CubaFieldGroupConnector extends CubaGroupBoxConnector {

    protected boolean forcedUpdateSize = !BrowserInfo.get().isChrome();

    @Override
    public CubaFieldGroupWidget getWidget() {
        return (CubaFieldGroupWidget) super.getWidget();
    }

    @Override
    protected CubaFieldGroupWidget createWidget() {
        return GWT.create(CubaFieldGroupWidget.class);
    }

    @Override
    public CubaFieldGroupState getState() {
        return (CubaFieldGroupState) super.getState();
    }

    @Override
    public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
        super.updateFromUIDL(uidl, client);

        // Hot fix for Vaadin bug #12672
        // Empty space on page after expanded component - incorrect height calculation in Chrome
        if (!forcedUpdateSize && isUndefinedHeight()) {
            Scheduler.get().scheduleFixedDelay(new Scheduler.RepeatingCommand() {
                @Override
                public boolean execute() {
                    if (getLayoutManager() != null) {
                        getLayoutManager().forceLayout();

                        forcedUpdateSize = true;
                        return false;
                    }
                    return true;
                }
            }, 200);
        }
    }

    @Override
    public void onStateChanged(StateChangeEvent stateChangeEvent) {
{'fraction_non_alphanumeric': 0.09575955265610438, 'fraction_numerical': 0.008387698042870456, 'mean_word_length': 2.7559055118110236, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5568817', 'n_tokens_mistral': 1249, 'n_tokens_neox': 1176, 'n_words': 255}