Package com.vaadin.spring.server
Class SpringUIProvider
java.lang.Object
com.vaadin.server.UIProvider
com.vaadin.spring.server.SpringUIProvider
- All Implemented Interfaces:
Serializable
public class SpringUIProvider
extends com.vaadin.server.UIProvider
Vaadin
UIProvider that looks up UI classes from the
Spring application context. The UI classes must be annotated with
SpringUI.- Author:
- Petter Holmström (petter@vaadin.com), Henri Sara (hesara@vaadin.com)
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidconfigureNavigator(com.vaadin.ui.UI ui) Configures a UI to use the navigator found bygetNavigator()if there is aSpringViewDisplayannotation.com.vaadin.ui.UIcreateInstance(com.vaadin.server.UICreateEvent event) protected voidcreateThemeDirectory(String theme) Create theme directory in the servlet context (if possible) to support caching of themes compiled on the fly also in applications deployed as JARs.protected StringderiveMappingForUI(String uiBeanName) Derive the name (path) for a UI based on its annotation parameters.protected voidprotected ObjectfindSpringViewDisplay(com.vaadin.ui.UI ui) protected SpringNavigatorReturns the configured navigator bean or null if no bean defined.getPageTitle(com.vaadin.server.UICreateEvent event) protected jakarta.servlet.ServletContextprotected SpringViewDisplayPostProcessorgetTheme(com.vaadin.server.UICreateEvent event) protected Class<? extends com.vaadin.ui.UI>getUIByPath(String path) Class<? extends com.vaadin.ui.UI>getUIClass(com.vaadin.server.UIClassSelectionEvent uiClassSelectionEvent) protected org.springframework.web.context.WebApplicationContextprotected voidmapPathToUI(String path, Class<? extends com.vaadin.ui.UI> uiClass) Methods inherited from class com.vaadin.server.UIProvider
getAnnotationFor, getPushMode, getPushTransport, getWidgetset, getWidgetsetInfo, isPreservedOnRefresh
-
Field Details
-
logger
protected final org.slf4j.Logger logger
-
-
Constructor Details
-
SpringUIProvider
public SpringUIProvider(com.vaadin.server.VaadinSession vaadinSession)
-
-
Method Details
-
detectUIs
protected void detectUIs() -
deriveMappingForUI
Derive the name (path) for a UI based on its annotation parameters.If a path is given as a parameter for the annotation, it is used. An empty string maps to the root context.
- Parameters:
uiBeanName- name of the UI bean- Returns:
- path to map the UI to
-
getUIClass
public Class<? extends com.vaadin.ui.UI> getUIClass(com.vaadin.server.UIClassSelectionEvent uiClassSelectionEvent) - Specified by:
getUIClassin classcom.vaadin.server.UIProvider
-
getWebApplicationContext
protected org.springframework.web.context.WebApplicationContext getWebApplicationContext() -
mapPathToUI
-
getUIByPath
-
createInstance
public com.vaadin.ui.UI createInstance(com.vaadin.server.UICreateEvent event) - Overrides:
createInstancein classcom.vaadin.server.UIProvider
-
createThemeDirectory
Create theme directory in the servlet context (if possible) to support caching of themes compiled on the fly also in applications deployed as JARs.Any errors are logged and otherwise ignored, as this only helps caching.
- Parameters:
theme- name of the theme
-
getServletContext
protected jakarta.servlet.ServletContext getServletContext() -
findSpringViewDisplay
-
getSpringViewDisplayPostProcessor
-
getTheme
- Overrides:
getThemein classcom.vaadin.server.UIProvider
-
getPageTitle
- Overrides:
getPageTitlein classcom.vaadin.server.UIProvider
-