diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-08-31 12:02:51 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-08-31 19:00:00 +0300 |
commit | 8679f49c5e036d39d34a9fca8a907c4d19df21c9 (patch) | |
tree | 9979d5cf330043523e7d68221133bbcd5b3300f5 /uitest/src/com/vaadin/tests/application | |
parent | cf9ab5aea84d2be1686c5f46edd9522cd0750baf (diff) | |
download | vaadin-framework-8679f49c5e036d39d34a9fca8a907c4d19df21c9.tar.gz vaadin-framework-8679f49c5e036d39d34a9fca8a907c4d19df21c9.zip |
Refactor UI bootstrap (#9443)
Diffstat (limited to 'uitest/src/com/vaadin/tests/application')
-rw-r--r-- | uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java | 7 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/application/ThreadLocalInstances.java | 19 |
2 files changed, 16 insertions, 10 deletions
diff --git a/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java b/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java index 3013659ed7..8962f5de9a 100644 --- a/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java +++ b/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java @@ -1,7 +1,7 @@ package com.vaadin.tests.application; import com.vaadin.Application; -import com.vaadin.UIRequiresMoreInformationException; +import com.vaadin.annotations.PreserveOnRefresh; import com.vaadin.server.AbstractUIProvider; import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.AbstractTestApplication; @@ -9,6 +9,7 @@ import com.vaadin.ui.Label; import com.vaadin.ui.UI; public class RefreshStatePreserve extends AbstractTestApplication { + @PreserveOnRefresh public static class RefreshStateUI extends UI { @Override public void init(WrappedRequest request) { @@ -22,12 +23,10 @@ public class RefreshStatePreserve extends AbstractTestApplication { @Override public void init() { super.init(); - setUiPreserved(true); addUIProvider(new AbstractUIProvider() { @Override public Class<? extends UI> getUIClass(Application application, - WrappedRequest request) - throws UIRequiresMoreInformationException { + WrappedRequest request) { return RefreshStateUI.class; } }); diff --git a/uitest/src/com/vaadin/tests/application/ThreadLocalInstances.java b/uitest/src/com/vaadin/tests/application/ThreadLocalInstances.java index 0e7dd1b242..89cbf5d3ff 100644 --- a/uitest/src/com/vaadin/tests/application/ThreadLocalInstances.java +++ b/uitest/src/com/vaadin/tests/application/ThreadLocalInstances.java @@ -1,9 +1,9 @@ package com.vaadin.tests.application; import com.vaadin.Application; -import com.vaadin.UIRequiresMoreInformationException; import com.vaadin.server.DownloadStream; import com.vaadin.server.PaintException; +import com.vaadin.server.UIProvider; import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.AbstractTestApplication; import com.vaadin.tests.integration.FlagSeResource; @@ -73,12 +73,19 @@ public class ThreadLocalInstances extends AbstractTestApplication { @Override public void init() { reportCurrentStatus("app init"); - } + addUIProvider(new UIProvider() { + @Override + public UI instantiateUI(Application application, + Class<? extends UI> type, WrappedRequest request) { + return mainWindow; + } - @Override - protected UI getUI(WrappedRequest request) - throws UIRequiresMoreInformationException { - return mainWindow; + @Override + public Class<? extends UI> getUIClass(Application application, + WrappedRequest request) { + return mainWindow.getClass(); + } + }); } @Override |