package ca.patricklam.judodb.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;

public class ConfigWidget extends Composite {
	interface MyUiBinder extends UiBinder<Widget, ConfigWidget> {}
	public static MyUiBinder uiBinder = GWT.create(MyUiBinder.class);
	
	private final JudoDB jdb;

	public ConfigWidget(JudoDB jdb) {
		this.jdb = jdb;
		initWidget(uiBinder.createAndBindUi(this));
	}
}

@@ -70,16 +70,68 @@
 nt.GWT;%0A
+import com.google.gwt.core.client.JavaScriptObject;%0A
 import c
@@ -474,105 +474,1667 @@
 db;%0A
-%0A%09public ConfigWidget(JudoDB jdb) %7B%0A%09%09this.jdb = jdb;%0A%09%09initWidget(uiBinder.createAndBindUi(this)
+%09private static final String PULL_CONFIG_URL = JudoDB.BASE_URL + %22pull_config.php%22;%0A%09//private static final String PUSH_CONFIG_URL = JudoDB.BASE_URL + %22push_config.php%22;%0A%09private static final String CALLBACK_URL_SUFFIX_Q = %22?callback=%22;%0A%0A%09public ConfigWidget(JudoDB jdb) %7B%0A%09%09this.jdb = jdb;%0A%09%09initWidget(uiBinder.createAndBindUi(this));%0A%09%09jdb.pleaseWait();%0A%09%09getJson(jdb.jsonRequestId++, PULL_CONFIG_URL + CALLBACK_URL_SUFFIX_Q, this);%0A%09%7D%0A%09%0A%09/**%0A%09 * Make call to remote server.%0A%09 */%0A%09public native static void getJson(int requestId, String url,%0A%09      ConfigWidget handler) /*-%7B%0A%09   var callback = %22callback%22 + requestId;%0A%0A%09   var script = document.createElement(%22script%22);%0A%09   script.setAttribute(%22src%22, url+callback);%0A%09   script.setAttribute(%22type%22, %22text/javascript%22);%0A%09   window%5Bcallback%5D = function(jsonObj) %7B%0A%09     handler.@ca.patricklam.judodb.client.ListWidget::handleJsonResponse(Lcom/google/gwt/core/client/JavaScriptObject;)(jsonObj);%0A%09     window%5Bcallback + %22done%22%5D = true;%0A%09   %7D%0A%0A%09   setTimeout(function() %7B%0A%09     if (!window%5Bcallback + %22done%22%5D) %7B%0A%09       handler.@ca.patricklam.judodb.client.ListWidget::handleJsonResponse(Lcom/google/gwt/core/client/JavaScriptObject;)(null);%0A%09     %7D%0A%0A%09     document.body.removeChild(script);%0A%09     delete window%5Bcallback%5D;%0A%09     delete window%5Bcallback + %22done%22%5D;%0A%09   %7D, 5000);%0A%0A%09   document.body.appendChild(script);%0A%09  %7D-*/;%0A%0A%09/**%0A%09 * Handle the response to the request for data from a remote server.%0A%09 */%0A%09public void handleJsonResponse(JavaScriptObject jso) %7B%0A%09%09if (jso == null) %7B%0A%09%09%09jdb.displayError(%22Couldn't retrieve JSON (config)%22);%0A%09%09%09return;%0A%09%09%7D%0A%0A%09    //this.config = jso.cast();%0A%09    jdb.clearStatus(
 );%0A%09

Add more boilerplate to Config widget in prep for impl.