Re: Reading an attribute that is set in a CSS file as a class

2008-11-19 Thread jwcarman
Well, I came up with a way to do it. I wrote a new class called TextTemplateResourceReference, which you can use along with a StyleSheetReference. Basically, you just pass it in a model for the variables to plugin. I don't know about that lastModifiedTime() implementation, but its overridable

Re: Reading an attribute that is set in a CSS file as a class

2008-11-19 Thread James Carman
And, in case anyone's interested, here's a new WIKI page for it: http://cwiki.apache.org/confluence/display/WICKET/Dynamically+Generate+a+CSS+Stylesheet On Wed, Nov 19, 2008 at 12:48 PM, jwcarman [EMAIL PROTECTED] wrote: Well, I came up with a way to do it. I wrote a new class called

Re: Reading an attribute that is set in a CSS file as a class

2008-11-17 Thread Eyal Golan
Stephen, I need this the same reason James needs it. We generate an image (a JFreeChart image) and we want it to have the same background color as the one specified in the CSS file. Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74

Re: Reading an attribute that is set in a CSS file as a class

2008-11-17 Thread Steve Swinsburg
I understand you need to match some attributes, but I don't understand why the CSS can't just have an extra class containing the attributes you need. Where does the CSS come from? Is it fixed or does it change a lot, ie via user specified/uploaded skins etc? cheers, Steve On 17 Nov

Re: Reading an attribute that is set in a CSS file as a class

2008-11-17 Thread Ernesto Reinaldo Barreiro
Why don't you just generate the CSS or parse it if that's not possible... With the former approach you will have the color before hand, with the latter you will have to locate it somewhere on the CSS. So, what is the best solution will depend on how you manage CSS on your application... Best,

Re: Reading an attribute that is set in a CSS file as a class

2008-11-17 Thread Eyal Golan
James, Yes, I would like you to send an example of this route. It looks as this is what I need. thanks Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74 P Save a tree. Please don't print this e-mail unless it's really necessary

Re: Reading an attribute that is set in a CSS file as a class

2008-11-17 Thread Ernesto Reinaldo Barreiro
Tanks James! At the moment I do not need that code myself but maybe it could be useful to others... Best, Ernesto On Mon, Nov 17, 2008 at 12:20 PM, James Carman [EMAIL PROTECTED]wrote: We're going to go with the generate the CSS route. I'm going to implement that today. If you want me to

Re: Reading an attribute that is set in a CSS file as a class

2008-11-17 Thread James Carman
Perhaps if it's that beneficial to folks, I'll put a wiki page out there in the how to section. On Mon, Nov 17, 2008 at 6:40 AM, Ernesto Reinaldo Barreiro [EMAIL PROTECTED] wrote: Tanks James! At the moment I do not need that code myself but maybe it could be useful to others... Best,

RE: Reading an attribute that is set in a CSS file as a class

2008-11-16 Thread Swinsburg, Stephen
On your component attach an AttributeAppender or AttributeModifier, set the class attribute to be the name of your class. Done :) -Original Message- From: egolan74 [mailto:[EMAIL PROTECTED] Sent: Sun 11/16/2008 10:05 AM To: users@wicket.apache.org Subject: Reading an attribute that is

RE: Reading an attribute that is set in a CSS file as a class

2008-11-16 Thread egolan74
Steve Swinsburg-2 wrote: On your component attach an AttributeAppender or AttributeModifier, set the class attribute to be the name of your class. Done :) Thanks Steve but this is not what I meant. Adding a class as an attribute to a component is a pretty basic stuff. What I want is,

RE: Reading an attribute that is set in a CSS file as a class

2008-11-16 Thread Swinsburg, Stephen
What do you need it for? Why can't you just make another class with just the attribute in it and AttributeAppender that in? -Original Message- From: egolan74 [mailto:[EMAIL PROTECTED] Sent: Sun 11/16/2008 10:42 AM To: users@wicket.apache.org Subject: RE: Reading an attribute that is

Re: Reading an attribute that is set in a CSS file as a class

2008-11-16 Thread James Carman
I have the same sort of need in my application. I need to do an overlay on an existing image using the same colors that are defined in a CSS document. I guess I could dynamically generate the CSS, but I have no idea how to go about that. :) On Sun, Nov 16, 2008 at 7:02 AM, Swinsburg, Stephen

Re: Reading an attribute that is set in a CSS file as a class

2008-11-16 Thread Ernesto Reinaldo Barreiro
I see two options: 1-Generate the css out for of some other data you can easily use at Java level (a velocity template maybe?) 2-Parse the CSS (e.g. with http://cssparser.sourceforge.net/)http://cssparser.sourceforge.net/ http://www.w3.org/Style/CSS/SAC/ For a project I had to use approach 2

Re: Reading an attribute that is set in a CSS file as a class

2008-11-16 Thread James Carman
I was thinking about learning how to use TextTemplates to generate the CSS. Is there any good reference out there? On Sun, Nov 16, 2008 at 9:44 AM, Ernesto Reinaldo Barreiro [EMAIL PROTECTED] wrote: I see two options: 1-Generate the css out for of some other data you can easily use at Java

Re: Reading an attribute that is set in a CSS file as a class

2008-11-16 Thread Ernesto Reinaldo Barreiro
I don't know on the Wicket wiki... but when I have to use such things I always look into the existing wicket code. A quick search on my IDE leads me to this the class org.wicketstuff.yui.markup.html.slider.Slider where a text template is used to populate the init.js file... Hope this helps...

Re: Reading an attribute that is set in a CSS file as a class

2008-11-16 Thread James Carman
Thanks for the tip, Ernesto. I'll check it out. On Sun, Nov 16, 2008 at 10:23 AM, Ernesto Reinaldo Barreiro [EMAIL PROTECTED] wrote: I don't know on the Wicket wiki... but when I have to use such things I always look into the existing wicket code. A quick search on my IDE leads me to this the