package com.test.gwt.client;

import com.google.gwt.core.client.ScriptInjector;
import com.test.gwt.client.TestGWT.JsClientBundle;

public class GWTReactBundleWrapper {
	public static void injectScript() {
	    if (!isInjected()) {
	        ScriptInjector.fromString(JsClientBundle.INSTANCE.gwtreactbundlejs().getText()).setWindow(ScriptInjector.TOP_WINDOW).inject();
	    }
	}

	private native final static boolean isInjected() /*-{
	    if (!(typeof $wnd.TestGWT === "undefined") && !(null===$wnd.TestGWT)) {
	        return true;
	    }
	    return false;
	}-*/;
}
