summaryrefslogtreecommitdiffstats
path: root/client-compiler
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2012-11-22 09:54:50 +0200
committerLeif Åstrand <leif@vaadin.com>2012-11-22 09:55:00 +0200
commit7a92557965c5ddc9dd949b965ec03a789bb03956 (patch)
tree083e85847c8971b1ba63e4dcadc1e2884fac5102 /client-compiler
parent8e2be0633ed221455bb94988321f1a81c11527fe (diff)
downloadvaadin-framework-7a92557965c5ddc9dd949b965ec03a789bb03956.tar.gz
vaadin-framework-7a92557965c5ddc9dd949b965ec03a789bb03956.zip
Make code splitting work (#8636)
Change-Id: I25c1494d29d20c89dc9c259995ed4b87067e859b
Diffstat (limited to 'client-compiler')
-rw-r--r--client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java30
1 files changed, 24 insertions, 6 deletions
diff --git a/client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java b/client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java
index 652eb38b5c..9d833f51bb 100644
--- a/client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java
+++ b/client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java
@@ -16,6 +16,7 @@ import java.util.Map.Entry;
import java.util.Set;
import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.RunAsyncCallback;
import com.google.gwt.core.ext.Generator;
import com.google.gwt.core.ext.GeneratorContext;
import com.google.gwt.core.ext.TreeLogger;
@@ -34,7 +35,6 @@ import com.vaadin.client.metadata.ConnectorBundleLoader;
import com.vaadin.client.metadata.InvokationHandler;
import com.vaadin.client.metadata.ProxyHandler;
import com.vaadin.client.metadata.TypeData;
-import com.vaadin.client.metadata.TypeDataBundle;
import com.vaadin.client.metadata.TypeDataStore;
import com.vaadin.client.ui.UnknownComponentConnector;
import com.vaadin.server.widgetsetutils.metadata.ClientRpcVisitor;
@@ -131,12 +131,21 @@ public class ConnectorBundleLoaderFactory extends Generator {
w.print(".runAsync(");
}
- w.print("new ");
- w.print(TypeDataBundle.class.getName());
- w.println("(getName()) {");
+ w.println("new %s() {", RunAsyncCallback.class.getName());
w.indent();
- w.println("public void load() {");
+ w.println("public void onSuccess() {");
+ w.indent();
+
+ w.println("load();");
+ w.println("%s.get().setLoaded(getName());",
+ ConnectorBundleLoader.class.getName());
+
+ // Close onSuccess method
+ w.outdent();
+ w.println("}");
+
+ w.println("private void load() {");
w.indent();
printBundleData(logger, w, bundle);
@@ -145,7 +154,16 @@ public class ConnectorBundleLoaderFactory extends Generator {
w.outdent();
w.println("}");
- // Close new TypeDataBundle() {}
+ w.println("public void onFailure(Throwable reason) {");
+ w.indent();
+
+ w.println("%s.get().setLoadFailure(getName(), reason);",
+ ConnectorBundleLoader.class.getName());
+
+ w.outdent();
+ w.println("}");
+
+ // Close new RunAsyncCallback() {}
w.outdent();
w.print("}");