2 Replies Latest reply on Apr 8, 2009 10:35 AM by domdom

    XCSS: dynamic property values at run-time

      Hi

      I'm working on a project, where I have a desktop client and a web application, which refer to the same component base. On the client we use custom components based on swing, which can be highly configured with an own set of property files.
      Now for the appropriate web components, I wrote own renderers, which work with xcss files for customization. Since I don't want to have two sets of property files, I want to generate the xcss files from the client property files. Furthermore I want to avoid the deploy times for the xcss files, so the values shall be filled in dynamically. Actually similar to what already can be done with ".skin.properties" files, now only with other property files (those for my desktop client).
      I also have to do some calculations and changes, since the possibilites of skinning with css are not that big as those I have with skinning the swing based client components, as you can imagine.
      Now I'm asking myself, what is the best way to achieve this!
      Should I aim for creating an own SkinFactory implementation, or should I try to get values for every css attribute from a resource so that my xcss files would look similar to this:
      [...]
      <u:selector name=".an_example_css_class">
      <u:style name="border-color">
      <f:resource f:key="...valueCreationFromClientPropertiesResource">
      <f:attribute name="buttonComponent" value="border-color" />
      </f:resource>
      </u:style>
      <u:style name="width">
      <f:resource f:key="...valueCreationFromClientPropertiesResource">
      <f:attribute name="buttonComponent" value="width" />
      </f:resource>
      </u:style>
      </u:selector
      [...]
      I'm not sure wether this would work. I use Resources so far only to create some images, which have an url containing the encoded attributes. But in this case, there would mainly be some values, actually no resources...
      Anyway, I want the xcss files to be static and not changing and get the actual values from elsewhere.
      Thx for reading and if you have a hint I'd be very glad to hear from you ;)