-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Wow!
Fantastic!
Finally, a long awaited theme customization is available!
Great, fantastic job!
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
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.
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.