diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-09-05 15:42:02 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-09-05 15:42:02 +0300 |
commit | de3ac989c85451767510917822463353bcab71cd (patch) | |
tree | 48a991db5d3a700e99e37d53df4fa7902bbb780b /uitest/src/com/vaadin/tests/minitutorials | |
parent | 8bdaf8732e660d1b9595c9d503999022320b0314 (diff) | |
download | vaadin-framework-de3ac989c85451767510917822463353bcab71cd.tar.gz vaadin-framework-de3ac989c85451767510917822463353bcab71cd.zip |
Change LegacyApplication to be a UIProvider (#9402)
Diffstat (limited to 'uitest/src/com/vaadin/tests/minitutorials')
-rw-r--r-- | uitest/src/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java | 46 |
1 files changed, 20 insertions, 26 deletions
diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java index 8c2a816e1c..05da2506e8 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java @@ -31,35 +31,29 @@ import com.vaadin.ui.UI; * @author Vaadin Ltd * @since 7.0.0 */ -public class DifferentFeaturesForDifferentClients extends Application { +public class DifferentFeaturesForDifferentClients extends AbstractUIProvider { @Override - public void init() { - super.init(); - addUIProvider(new AbstractUIProvider() { - @Override - public Class<? extends UI> getUIClass(Application application, - WrappedRequest request) { - // could also use browser version etc. - if (request.getHeader("user-agent").contains("mobile")) { - return TouchRoot.class; - } else { - return DefaultRoot.class; - } - } + public Class<? extends UI> getUIClass(Application application, + WrappedRequest request) { + // could also use browser version etc. + if (request.getHeader("user-agent").contains("mobile")) { + return TouchRoot.class; + } else { + return DefaultRoot.class; + } + } - // Must override as default implementation isn't allowed to - // instantiate our non-public classes - @Override - public UI createInstance(Application application, - Class<? extends UI> type, WrappedRequest request) { - try { - return type.newInstance(); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - }); + // Must override as default implementation isn't allowed to + // instantiate our non-public classes + @Override + public UI createInstance(Application application, Class<? extends UI> type, + WrappedRequest request) { + try { + return type.newInstance(); + } catch (Exception e) { + throw new RuntimeException(e); + } } } |