// Path: src/main/java/org/markdown4j/client/event/PluginContentReadyEventHandler.java
// public class PluginContentReadyEvent extends GwtEvent<PluginContentReadyEventHandler> {
// 	private Plugin plugin;
// 	private List<String> lines;
// 	private Map<String, String> params;
// 	private String id;
// 	private String content;
// 
// 	public PluginContentReadyEvent(Plugin plugin, List<String> lines, Map<String, String> params, String id, String content) {
// 		this.plugin = plugin;
// 		this.lines = lines;
// 		this.params = params;
// 		this.id = id;
// 		this.content = content;
// 	}
// 
// 	@Override
// 	public GwtEvent.Type<PluginContentReadyEventHandler> getAssociatedType() {
// 		return TYPE;
// 	}
// 
// 	@Override
// 	protected void dispatch(PluginContentReadyEventHandler handler) {
// 		handler.ready(this, plugin, lines, params, id, content);
// 	}
// }


import java.io.IOException;
import java.util.List;
import java.util.Map;
import org.markdown4j.client.event.PluginContentReadyEventHandler.PluginContentReadyEvent;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.RequestCallback;
import com.google.gwt.http.client.RequestException;
import com.google.gwt.http.client.Response;
import com.google.gwt.http.client.URL;
import com.google.gwt.user.client.ui.HTMLPanel;

		// Send the request
		RequestBuilder builder = new RequestBuilder(RequestBuilder.POST,
				URL.encode("http://spchoprcors.appspot.com/" + corsProxy));
		try {
			request = builder.sendRequest("", new RequestCallback() {

				@Override
				public void onResponseReceived (Request request,
						Response response) {
					if (response.getStatusCode() >= 200
							&& response.getStatusCode() < 300) {
						String content = response.getText();
						gotContent(content, processContent(content), src, id,
								lines, params);
					}
				}

				@Override
				public void onError (Request request, Throwable exception) {
					GWT.log("Error getting [" + src + "]", exception);
				}
			});
		} catch (RequestException rex) {
			throw new IOException(rex);
		}
	}

	protected void gotContent (String content, String processed, String src,
			String id, List<String> lines, Map<String, String> params) {
		if (manager != null) {

// Path: src/main/java/org/markdown4j/client/event/PluginContentReadyEventHandler.java
// public class PluginContentReadyEvent extends GwtEvent<PluginContentReadyEventHandler> {
// 	private Plugin plugin;
// 	private List<String> lines;
// 	private Map<String, String> params;
// 	private String id;
// 	private String content;
// 
// 	public PluginContentReadyEvent(Plugin plugin, List<String> lines, Map<String, String> params, String id, String content) {
// 		this.plugin = plugin;
// 		this.lines = lines;
// 		this.params = params;
// 		this.id = id;
// 		this.content = content;
// 	}
// 
// 	@Override
// 	public GwtEvent.Type<PluginContentReadyEventHandler> getAssociatedType() {
// 		return TYPE;
// 	}
// 
// 	@Override
// 	protected void dispatch(PluginContentReadyEventHandler handler) {
// 		handler.ready(this, plugin, lines, params, id, content);
// 	}
// }


// Path: src/main/java/org/markdown4j/client/IncludePlugin.java
import java.io.IOException;
import java.util.List;
import java.util.Map;
import org.markdown4j.client.event.PluginContentReadyEventHandler.PluginContentReadyEvent;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.RequestCallback;
import com.google.gwt.http.client.RequestException;
import com.google.gwt.http.client.Response;
import com.google.gwt.http.client.URL;
import com.google.gwt.user.client.ui.HTMLPanel;

		// Send the request
		RequestBuilder builder = new RequestBuilder(RequestBuilder.POST,
				URL.encode("http://spchoprcors.appspot.com/" + corsProxy));
		try {
			request = builder.sendRequest("", new RequestCallback() {

				@Override
				public void onResponseReceived (Request request,
						Response response) {
					if (response.getStatusCode() >= 200
							&& response.getStatusCode() < 300) {
						String content = response.getText();
						gotContent(content, processContent(content), src, id,
								lines, params);
					}
				}

				@Override
				public void onError (Request request, Throwable exception) {
					GWT.log("Error getting [" + src + "]", exception);
				}
			});
		} catch (RequestException rex) {
			throw new IOException(rex);
		}
	}

	protected void gotContent (String content, String processed, String src,
			String id, List<String> lines, Map<String, String> params) {
		if (manager != null) {

			manager.fireEvent(new PluginContentReadyEvent(IncludePlugin.this,
