aboutsummaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2011-11-29 15:11:12 +0200
committerLeif Åstrand <leif@vaadin.com>2011-11-29 15:11:12 +0200
commit96b7065f7ce30e4ef04bea13905745e05eb7bae6 (patch)
treeadee5bcb00721ff12ef066ddcdfc4f853d802bb2 /src/com
parentddc6070445611cdf4f62003f8eb47e01baabbcd1 (diff)
downloadvaadin-framework-96b7065f7ce30e4ef04bea13905745e05eb7bae6.tar.gz
vaadin-framework-96b7065f7ce30e4ef04bea13905745e05eb7bae6.zip
Ensure window attached by LegacyApplication has an application
Diffstat (limited to 'src/com')
-rw-r--r--src/com/vaadin/Application.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/com/vaadin/Application.java b/src/com/vaadin/Application.java
index 23bac80e19..7bbe0b095c 100644
--- a/src/com/vaadin/Application.java
+++ b/src/com/vaadin/Application.java
@@ -120,6 +120,12 @@ public class Application implements Terminal.ErrorListener, Serializable {
throw new IllegalStateException(
"mainWindow has already been set");
}
+ if (mainWindow.getApplication() == null) {
+ mainWindow.setApplication(this);
+ } else if (mainWindow.getApplication() != this) {
+ throw new IllegalStateException(
+ "mainWindow is attached to another application");
+ }
this.mainWindow = mainWindow;
}
@@ -172,6 +178,7 @@ public class Application implements Terminal.ErrorListener, Serializable {
public void addWindow(Root root, String name) {
legacyRootNames.put(name, root);
+ root.setApplication(this);
}
public void removeWindow(Root root) {