Name: gm110360 Date: 06/02/2004 A DESCRIPTION OF THE REQUEST : The current "load" method of SynthLookAndFeel requires to pass a "Class" object to resolve the resources inside the style: "load(InputStream input, Class<?> resourceBase)". Now let's suppose I have written a style made of several images (I'm using the SynthLookAndFeel and no custom painters). In the style file, I reference the images relatively to the style file. I have the following files in the "mystyle" folder: style.xml images/checkbox-selected.png images/checkbox-unselected.png Case 1: I have my style and icons in the jar of my application. Solution 1: I need to have a "Class" in the same package of "style.xml". This class will serve as a hook to get the resources. I'm ok with that. Case 2: I have several styles packaged, each packaged in zip files, those zip files are not in the classpath. How can I load my styles? Solution 2.1: I do not see any way to do it with the current implementation. If I had a method like "load(URL styleXml)" where the styleXML url context would be used to load the resources, it would be enough. Better would be to support this concept of "self-contained themes" (aka themepacks in SkinLF) and to be able to load the style with "loadStyle(URL styleZIP)". Solution 2.2: Write my own custom "SynthParser" and fill the SynthStyleFactory from this new "SynthParser". Should not this be built in Swing instead? JUSTIFICATION : Having an easier way to load the style from any location would make it possible to bundle styles in one zip/jar theme. This will ease the job of graphics designer and could help to spread the concept of SynthLookAndFeel and style files (having the equivalent of www.themexp.org but with Java themes). EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - New methods to be added to SynthLookAndFeel to load a theme from a "zip file" or to provide an URL as the resourceBase instead of a class. (Incident Review ID: 275571) ======================================================================
|