-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi everyone!!!
In my project; i want to use different themes like i want to change blue color to orange color. Is it possible? What is the best easy way for it?
Thanks...
OK, I success to implement ThemeProvider to change the theme.
Let me summary some key difference between zk3 and zk5 here.
When I have time, I shall write a formal smalltalk about it.
Even more, implement theme builder into zk studio.
1. Remember to copy "zk.wcs" to to same folder of "norm.css.dsp". You don't have to modify "zk.wcs"
2. "caption.css.dsp" has been renamed to "caption.css". Therefore, THEMER in zk3 will miss this file.
When generating "zk.wcs", it will fail because resource not found.
3. Following is my implementation of ThemeProvider.java
public class ThemeProvider implements org.zkoss.zk.ui.util.ThemeProvider { private String themeName="red"; public Collection getThemeURIs(Execution exec, List uris) { List newUris = new ArrayList(); String uri; for (Iterator it = uris.iterator(); it.hasNext(); newUris.add(uri)) { uri = (String) it.next(); if (uri.startsWith("~./")) uri = (new StringBuilder("~./")).append(themeName).append("/") .append(uri.substring(3)).toString(); } return newUris; } public String beforeWCS(Execution arg0, String arg1) { return arg1; } public String beforeWidgetCSS(Execution arg0, String arg1) { if (arg1.startsWith("~./")) arg1 = (new StringBuilder("~./")).append(themeName).append("/") .append(arg1.substring(3)).toString(); return arg1; } public int getWCSCacheControl(Execution arg0, String arg1) { return -1; } }
I use this tool to generated a themer jar.It works,but the color of some components lisk buttons and scroll bar have no change. I do not know why.
I use these jars to generate:zcommon.jar,zcommons-el.jar,zhtml.jar,zk.jar,zkplus.jar,zul.jar,zweb.jar.If I miss some jars? I use zk5.0.1.
Who can help me ? Thanks!
Hi bluesealycn, does your modification runs under windows?
Asked: 2010-01-02 08:57:33 +0800
Seen: 5,183 times
Last updated: Aug 15 '11