Search in sources :

Example 1 with DesktopThemeLoader

use of com.haulmont.cuba.desktop.theme.DesktopThemeLoader in project cuba by cuba-platform.

the class App method initTheme.

protected void initTheme() throws Exception {
    DesktopConfig config = configuration.getConfig(DesktopConfig.class);
    String themeName = config.getTheme();
    DesktopThemeLoader desktopThemeLoader = AppBeans.get(DesktopThemeLoader.NAME);
    theme = desktopThemeLoader.loadTheme(themeName);
    theme.init();
    ThemeConstantsRepository themeRepository = AppBeans.get(ThemeConstantsRepository.NAME);
    ThemeConstants uiTheme = themeRepository.getConstants(themeName);
    if (uiTheme == null) {
        throw new IllegalStateException("Unable to use theme constants '" + themeName + "'");
    }
    this.themeConstants = uiTheme;
}
Also used : ThemeConstants(com.haulmont.cuba.gui.theme.ThemeConstants) DesktopThemeLoader(com.haulmont.cuba.desktop.theme.DesktopThemeLoader) ThemeConstantsRepository(com.haulmont.cuba.gui.theme.ThemeConstantsRepository)

Aggregations

DesktopThemeLoader (com.haulmont.cuba.desktop.theme.DesktopThemeLoader)1 ThemeConstants (com.haulmont.cuba.gui.theme.ThemeConstants)1 ThemeConstantsRepository (com.haulmont.cuba.gui.theme.ThemeConstantsRepository)1