-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Wow!
Fantastic!
Finally, a long awaited theme customization is available!
Great, fantastic job!
Thanks for the response Jose. I have another question, the ThemeProvider class you mentioned that I have to change, is it the one inside the jar theme or can I provide it in my application? If is the one inside the generated jar file, could it be possible for you to update the theme generator to provide for this function? Thanks.
José,
I was unable to get it to work (I'm running on windows/tomcat). I've tried to unzip the contents of the jar (web folder), place it in my project's web folder (that was the only way I got for my browser to see the .css.dsp files) and implemented the ThemeProvider to point to that directory, but it keeps not loading the theme.
The only weird thing I noticed is that the zkthemer.jar is not generating a /js/ folder.
Is that a problem? Looks like ZK is expecting that folder.
<link rel="stylesheet" type="text/css" href="/my_project/zkau/web/lila/zul/css/normmoz.css.dsp"/> <link rel="stylesheet" type="text/css" href="/my_project/zkau/web/lila<b >/js/</b>ext/timeplot/api/styles/timeplot-bundle.css"/> <link rel="stylesheet" type="text/css" href="/my_project/zkau/web/lila/zkex/zul/css/zkexmoz.css.dsp"/> <link rel="stylesheet" type="text/css" href="/my_project/zkau/web/lila/zkmax/zul/css/zkmaxmoz.css.dsp"/>
Any ideas?
This is really delightful. Robbie has kindly offered to put the file onto zkforge. Why not get commit access to zkforge from the project guys and then put you code there and folks can then help upgrade it to zk5?
:-)
Well done.
Thanks again Jose. I have been playing with it for a while and what I did is this. I created my own class inside my application called CustomThemeProvider and I used the same methods that you posted above. I also changed the zk.xml so that it uses my java class for the theme provider. When the application loads, I am able to load the generated color jar with no problem, but if I have multiple jars, it loads the first one in alphabetical order. For example, I have jars: red.jar, green.jar and lila.jar and green is the one that loads. I discovered that if I change the "themeName" global variable inside getThemeURIs to the theme I want, it loads. For example:
uri = "~./" + "lila" + "/" + uri.substring(3);
This will load the lila theme instead of the green.jar. This only works when the application loads, so I am trying to get the same result at runtime. So far what I have done is this:
ArrayList dsps = new ArrayList();
dsps.add("~./zul/css/norm*.css.dsp*");
dsps.add("~./zkex/zul/css/zkex*.css.dsp*");
dsps.add("~./zkmax/zul/css/zkmax*.css.dsp*");
dsps.add("~./js/ext/timeplot/api/styles/timeplot-bundle.css");
CustomThemeProvider tp = new CustomThemeProvider();
tp.themeName="lila";
tp.getThemeURIs(Executions.getCurrent(), dsps);
This method gets called when I push a button to change the theme. So far I haven't been able to get it to work, the theme doesn't change. I guess I'm missing something that must be done in order to load the theme that I specified. Any help is greatly appreciated. Thanks.
EVERE: Unable to load /WEB-INF/zk.xml
org.zkoss.zk.ui.UiException: Unable to load zkthemer.ThemeProvider, at [SYS jndi:/localhost/CSS-M-eye/WEB-INF/zk.xml line 8 col 17]
He conseguido que funcione, lo he hecho de la siguiente forma.
1. copie el archivo zkthemer.jar al directorio lib del proyecto.
2. generé el archivo de tema ejecutando zkthemer.jar desde el directorio lib:
lbertel@aldebaran ~/Proyectos/workspace/geored_zk/web/WEB-INF/lib $ java -jar zkthemer.jar -c d8d8d8 -z . -t lila
Generated file: lila.ja
3. Se modifica el zk.xml
4. Adicionar al buld path del proyecto el archivo lila.jar.
4. Se realiza un clean del proyecto, para que reconstruya el proyecto.
5. y por último realice un refresh del proyecto (F5).
Y todo ok, funciono correctamente.
Hi, sorry i have since yet not can run the zkthemer well. I have done a lila.jar but no success by implementing in the application.
I work on windows system.
But by testing it, i have at a time become a 'attribut cannot be serializized' error. Please have early a look for this when running in clustered environment.
regards
Stephan