Package org.springframework.ui.context

Examples of org.springframework.ui.context.Theme


  protected Theme getFallbackTheme() {
    ThemeSource themeSource = RequestContextUtils.getThemeSource(getRequest());
    if (themeSource == null) {
      themeSource = new ResourceBundleThemeSource();
    }
    Theme theme = themeSource.getTheme(DEFAULT_THEME_NAME);
    if (theme == null) {
      throw new IllegalStateException("No theme defined and no fallback theme found");
    }
    return theme;
  }
View Full Code Here


  public Theme getTheme(String themeName) {
    if (themeName == null) {
      return null;
    }
    synchronized (this.themeCache) {
      Theme theme = this.themeCache.get(themeName);
      if (theme == null) {
        String basename = this.basenamePrefix + themeName;
        MessageSource messageSource = createMessageSource(basename);
        theme = new SimpleTheme(themeName, messageSource);
        initParent(theme);
View Full Code Here

   */
  protected void initParent(Theme theme) {
    if (theme.getMessageSource() instanceof HierarchicalMessageSource) {
      HierarchicalMessageSource messageSource = (HierarchicalMessageSource) theme.getMessageSource();
      if (getParentThemeSource() != null && messageSource.getParentMessageSource() == null) {
        Theme parentTheme = getParentThemeSource().getTheme(theme.getName());
        if (parentTheme != null) {
          messageSource.setParentMessageSource(parentTheme.getMessageSource());
        }
      }
    }
  }
View Full Code Here

  protected Theme getFallbackTheme() {
    ThemeSource themeSource = RequestContextUtils.getThemeSource(getRequest());
    if (themeSource == null) {
      themeSource = new ResourceBundleThemeSource();
    }
    Theme theme = themeSource.getTheme(DEFAULT_THEME_NAME);
    if (theme == null) {
      throw new IllegalStateException("No theme defined and no fallback theme found");
    }
    return theme;
  }
View Full Code Here

TOP

Related Classes of org.springframework.ui.context.Theme

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.