@Override public Class<? extends UI> getUIClass(UIClassSelectionEvent event) { VaadinRequest request = event.getRequest(); String url = parseUIMapping(request); // If url is login, return LoginUI class if (url.contains("login")) { return LoginUI.class; } // If url is an empty url then return Secure if user is an // authenticated else return login UI if (url.isEmpty()) { Principal principal = request.getUserPrincipal(); if (null == principal) { return LoginUI.class; } return SecureUI.class; } // Return the secured UI if (url.contains("secured")) { return SecureUI.class; } return null; }
@Override public Class<? extends UI> getUIClass(UIClassSelectionEvent event) { String userAgent = event.getRequest().getHeader("user-agent").toLowerCase(); if (overrideMobileUA() || userAgent.contains("mobile")) { return WoundManagementUI.class; } else { return WoundManagementUI.class; } }
@Override @SuppressWarnings("unchecked") public Class<? extends UI> getUIClass(UIClassSelectionEvent event) { Object uiClassNameObj = event.getService() .getDeploymentConfiguration() .getApplicationOrSystemProperty(VaadinSession.UI_PARAMETER, null); if (uiClassNameObj instanceof String) { String uiClassName = uiClassNameObj.toString(); return uiNameToUiClassMap.get(uiClassName); } return null; }
/** {@inheritDoc} */ @Override public Class<? extends UI> getUIClass(final UIClassSelectionEvent event) { final VaadinRequest request = event.getRequest(); if (request.getPathInfo().startsWith("/ui/elifui")) return LeadInputFormUI.class; else return ExtaCrmUI.class; }
/** * Asserts the {@link ModularUIProvider#getUIClass(com.vaadin.server.UIClassSelectionEvent)} * always returns the {@link PageletAwareUI} class. */ @Test public void testGetUIClass() { UIClassSelectionEvent event = createMock(UIClassSelectionEvent.class); Class<?> uiClass = provider.getUIClass(event); assertEquals(PageletAwareUI.class, uiClass); }
@Override public Class<? extends UI> getUIClass(UIClassSelectionEvent event) { String userAgent = event.getRequest().getHeader("user-agent").toLowerCase(); if(userAgent.contains("webkit")) { return MyTouchKitUI.class; } else { return MyFallbackUI.class; } }
@Override public Class<? extends UI> getUIClass(UIClassSelectionEvent event) { checkUiRequestMapping(); Class<?extends UI> clazz = this.uiMapping.getUiClass(event.getRequest()); return clazz != null ? clazz : super.getUIClass(event); }
@Override public Class<? extends UI> getUIClass(UIClassSelectionEvent event) { return MainUI.class; }
@Override public Class<? extends UI> getUIClass(UIClassSelectionEvent uiClassSelectionEvent) { return vaadinProvider.getUIClass(); }
@Override public Class<? extends UI> getUIClass(UIClassSelectionEvent event) { return uiClass; }
@Override public Class<? extends UI> getUIClass(UIClassSelectionEvent event) { return PageletAwareUI.class; }
@Override public Class<? extends UI> getUIClass(UIClassSelectionEvent uiClassSelectionEvent) { return BaseVaadinUI.class; }