/*
 * Copyright (c) 2008 Haulmont Technology Ltd. All Rights Reserved.
 * Haulmont Technology proprietary and confidential.
 * Use is subject to license terms.

 * Author: Nikolay Gorodnov
 * Created: 18.10.2010 19:22:04
 *
 * $Id$
 */
package com.haulmont.cuba.toolkit.gwt.client.swfupload;

import com.vaadin.terminal.gwt.client.ApplicationConnection;

public class SwfUploadAPI {
    public static native void onReady(Runnable r) /*-{
        if (!$wnd.swfUploadHelper) {
            var id = $wnd.setInterval(function () {
                if ($wnd.swfUploadHelper) {
                    $wnd.clearInterval(id);
                    @com.haulmont.cuba.toolkit.gwt.client.swfupload.SwfUploadAPI::execRunnable(Ljava/lang/Runnable;)(r);
                }
            }, 100);
        } else {
            @com.haulmont.cuba.toolkit.gwt.client.swfupload.SwfUploadAPI::execRunnable(Ljava/lang/Runnable;)(r);
        }
    }-*/;

    private static void execRunnable(Runnable r) {
        if (r != null) {
            try {
                r.run();
            } catch (Throwable e) {
                ApplicationConnection.getConsole().log(e.toString());
            }
        }
    }

}

@@ -336,37 +336,24 @@
 .client.
-ApplicationConnection
+VConsole
 ;%0D%0A%0D%0Apub
@@ -1114,42 +1114,16 @@
     
-ApplicationConnection.get
+V
 Console
-()
 .log
@@ -1176,9 +1176,5 @@
  %7D%0D%0A
-%0D%0A%7D%0D%0A
+%7D

Embed GanttChart into page