aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java20
-rw-r--r--src/com/vaadin/terminal/gwt/client/ApplicationConnection.java12
-rw-r--r--src/com/vaadin/terminal/gwt/client/WidgetLoader.java4
3 files changed, 18 insertions, 18 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java
index 960b0a8b0e..540841a6ae 100644
--- a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java
+++ b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java
@@ -218,7 +218,7 @@ public class ApplicationConfiguration implements EntryPoint {
static// TODO consider to make this hashmap per application
LinkedList<Command> callbacks = new LinkedList<Command>();
- private static int widgetsLoading;
+ private static int dependenciesLoading;
private static ArrayList<ApplicationConnection> runningApplications = new ArrayList<ApplicationConnection>();
@@ -454,26 +454,26 @@ public class ApplicationConfiguration implements EntryPoint {
*
* @param c
*/
- static void runWhenWidgetsLoaded(Command c) {
- if (widgetsLoading == 0) {
+ static void runWhenDependenciesLoaded(Command c) {
+ if (dependenciesLoading == 0) {
c.execute();
} else {
callbacks.add(c);
}
}
- static void startWidgetLoading() {
- widgetsLoading++;
+ static void startDependencyLoading() {
+ dependenciesLoading++;
}
- static void endWidgetLoading() {
- widgetsLoading--;
- if (widgetsLoading == 0 && !callbacks.isEmpty()) {
+ static void endDependencyLoading() {
+ dependenciesLoading--;
+ if (dependenciesLoading == 0 && !callbacks.isEmpty()) {
for (Command cmd : callbacks) {
cmd.execute();
}
callbacks.clear();
- } else if (widgetsLoading == 0 && deferredWidgetLoader != null) {
+ } else if (dependenciesLoading == 0 && deferredWidgetLoader != null) {
deferredWidgetLoader.trigger();
}
@@ -534,7 +534,7 @@ public class ApplicationConfiguration implements EntryPoint {
}
private boolean isBusy() {
- if (widgetsLoading > 0) {
+ if (dependenciesLoading > 0) {
communicationFree = 0;
return true;
}
diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
index 3ec4233c59..ab9520240c 100644
--- a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
+++ b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
@@ -1618,19 +1618,19 @@ public class ApplicationConnection {
}
};
- ApplicationConfiguration.runWhenWidgetsLoaded(c);
+ ApplicationConfiguration.runWhenDependenciesLoaded(c);
}
private static void loadStyleDependencies(JsArrayString dependencies) {
// Assuming no reason to interpret in a defined order
ResourceLoadListener resourceLoadListener = new ResourceLoadListener() {
public void onResourceLoad(ResourceLoadEvent event) {
- ApplicationConfiguration.endWidgetLoading();
+ ApplicationConfiguration.endDependencyLoading();
}
};
ResourceLoader loader = ResourceLoader.get();
for (int i = 0; i < dependencies.length(); i++) {
- ApplicationConfiguration.startWidgetLoading();
+ ApplicationConfiguration.startDependencyLoading();
loader.loadStylesheet(dependencies.get(i), resourceLoadListener);
}
}
@@ -1644,20 +1644,20 @@ public class ApplicationConnection {
ResourceLoadListener resourceLoadListener = new ResourceLoadListener() {
public void onResourceLoad(ResourceLoadEvent event) {
if (dependencies.length() != 0) {
- ApplicationConfiguration.startWidgetLoading();
+ ApplicationConfiguration.startDependencyLoading();
// Load next in chain (hopefully already preloaded)
event.getResourceLoader().loadScript(dependencies.shift(),
this);
}
// Call start for next before calling end for current
- ApplicationConfiguration.endWidgetLoading();
+ ApplicationConfiguration.endDependencyLoading();
}
};
ResourceLoader loader = ResourceLoader.get();
// Start chain by loading first
- ApplicationConfiguration.startWidgetLoading();
+ ApplicationConfiguration.startDependencyLoading();
loader.loadScript(dependencies.shift(), resourceLoadListener);
// Preload all remaining
diff --git a/src/com/vaadin/terminal/gwt/client/WidgetLoader.java b/src/com/vaadin/terminal/gwt/client/WidgetLoader.java
index 16e99716a0..491e569411 100644
--- a/src/com/vaadin/terminal/gwt/client/WidgetLoader.java
+++ b/src/com/vaadin/terminal/gwt/client/WidgetLoader.java
@@ -9,12 +9,12 @@ import com.google.gwt.core.client.RunAsyncCallback;
abstract class WidgetLoader implements RunAsyncCallback {
public void onFailure(Throwable reason) {
- ApplicationConfiguration.endWidgetLoading();
+ ApplicationConfiguration.endDependencyLoading();
}
public void onSuccess() {
addInstantiator();
- ApplicationConfiguration.endWidgetLoading();
+ ApplicationConfiguration.endDependencyLoading();
}
abstract void addInstantiator();