1 package org
.argeo
.cms
.web
;
3 import org
.apache
.commons
.logging
.Log
;
4 import org
.apache
.commons
.logging
.LogFactory
;
5 import org
.argeo
.api
.cms
.CmsTheme
;
6 import org
.eclipse
.rap
.rwt
.application
.Application
;
7 import org
.eclipse
.rap
.rwt
.service
.ResourceLoader
;
9 /** Web specific utilities around theming. */
10 public class WebThemeUtils
{
11 private final static Log log
= LogFactory
.getLog(WebThemeUtils
.class);
13 public static void apply(Application application
, CmsTheme theme
) {
14 ResourceLoader resourceLoader
= new CmsThemeResourceLoader(theme
);
15 resources
: for (String path
: theme
.getImagesPaths()) {
16 if (path
.startsWith("target/"))
17 continue resources
; // skip maven output
18 application
.addResource(path
, resourceLoader
);
19 if (log
.isTraceEnabled())
20 log
.trace("Theme " + theme
.getThemeId() + ": added resource " + path
);
22 for (String path
: theme
.getRapCssPaths()) {
23 application
.addStyleSheet(theme
.getThemeId(), path
, resourceLoader
);
24 if (log
.isDebugEnabled())
25 log
.debug("Theme " + theme
.getThemeId() + ": added RAP CSS " + path
);