0

ZK Diffrent Themes

asked 2010-01-02 08:57:33 +0800

wolverine gravatar image wolverine
30 1 1 2

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...

delete flag offensive retag edit

21 Replies

Sort by ยป oldest newest

answered 2010-01-03 19:05:01 +0800

PeterKuo gravatar image PeterKuo
481 2

you may google "theme site:zkoss.org", and you'll find

http://docs.zkoss.org/wiki/ZKThemer

link publish delete flag offensive edit

answered 2010-01-04 03:51:22 +0800

haddorp gravatar image haddorp
81 2 3

Is this working with ZK 5.0 RC2? I've done a short tests and it seems to more compatible to the older version.

Has anyone heard about a themes gallery where users can post and download there themes?

link publish delete flag offensive edit

answered 2010-01-18 05:48:12 +0800

PeterKuo gravatar image PeterKuo
481 2

Because ThemeProvider mechanism has changed, therefore it is not compatible.

You can refer to
http://docs.zkoss.org/wiki/Theme

Wish someone can update it, and write another smalltalk.

link publish delete flag offensive edit

answered 2010-01-18 20:05:44 +0800

PeterKuo gravatar image PeterKuo
481 2

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;
	}
}

link publish delete flag offensive edit

answered 2010-03-23 10:54:04 +0800

tquezada gravatar image tquezada
6

Hi! I generate a new color theme (putting ff0000 - red) but when i run the application is like pink... somebody can tell me why and how can i create a red theme

link publish delete flag offensive edit

answered 2010-03-23 20:27:32 +0800

PeterKuo gravatar image PeterKuo
481 2

@tquezada
for your need, you may dig into the code, and try to modify the color adjustment code.

link publish delete flag offensive edit

answered 2010-05-19 22:26:22 +0800

quduoduo gravatar image quduoduo
3

oh yes thank you

link publish delete flag offensive edit

answered 2010-05-20 01:04:33 +0800

vinhvo gravatar image vinhvo
369 3

Have any body succeeded with altering the code ?
Can you give some hints ?

link publish delete flag offensive edit

answered 2010-06-24 21:34:05 +0800

bluesealycn gravatar image bluesealycn
42

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!

link publish delete flag offensive edit

answered 2010-06-25 03:14:02 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

Hi bluesealycn, does your modification runs under windows?

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2010-01-02 08:57:33 +0800

Seen: 5,183 times

Last updated: Aug 15 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More