@Override public void setParentThemeSource(ThemeSource parent) { this.parentThemeSource = parent; // Update existing Theme objects. // Usually there shouldn't be any at the time of this call. synchronized (this.themeCache) { for (Theme theme : this.themeCache.values()) { initParent(theme); } } }
/** * Retrieves the current theme from the given request, using the ThemeResolver * and ThemeSource bound to the request by the DispatcherServlet. * @param request current HTTP request * @return the current theme, or {@code null} if not found * @see #getThemeResolver */ public static Theme getTheme(HttpServletRequest request) { ThemeResolver themeResolver = getThemeResolver(request); ThemeSource themeSource = getThemeSource(request); if (themeResolver != null && themeSource != null) { String themeName = themeResolver.resolveThemeName(request); return themeSource.getTheme(themeName); } else { return null; } }
/** * Return this servlet's ThemeSource, if any; else return {@code null}. * <p>Default is to return the WebApplicationContext as ThemeSource, * provided that it implements the ThemeSource interface. * @return the ThemeSource, if any * @see #getWebApplicationContext() */ public final ThemeSource getThemeSource() { if (getWebApplicationContext() instanceof ThemeSource) { return (ThemeSource) getWebApplicationContext(); } else { return null; } }
public void setParentThemeSource(ThemeSource parent) { this.parentThemeSource = parent; // Update existing Theme objects. // Usually there shouldn't be any at the time of this call. synchronized (this.themeCache) { for (Theme theme : this.themeCache.values()) { initParent(theme); } } }
@Override public ThemeSource getParentThemeSource() { return this.parentThemeSource; }
@Override public void setParentThemeSource(ThemeSource parentThemeSource) { this.parentThemeSource = parentThemeSource; }
@Override public ThemeSource getParentThemeSource() { return parentThemeSource; }
public ThemeSource getParentThemeSource() { return this.parentThemeSource; }
public void setParentThemeSource(ThemeSource parentThemeSource) { this.parentThemeSource = parentThemeSource; }
public ThemeSource getParentThemeSource() { return parentThemeSource; }
/** * Return the ThemeSource that has been bound to the request by the * DispatcherServlet. * @param request current HTTP request * @return the current ThemeSource */ public static ThemeSource getThemeSource(HttpServletRequest request) { return (ThemeSource) request.getAttribute(DispatcherServlet.THEME_SOURCE_ATTRIBUTE); }