Re: Bug submission / Feature Requests
Ross Wetmore <[email protected]>
| Newsgroups | gmane.comp.java.luxor-xul.user |
|---|---|
| Message-ID | <[email protected]> |
Gerald Bauer wrote:
> I agree. The sourceforge bug parade/tracker should
> be working. Have a look a
> http://sourceforge.net/tracker/?atid=394893&group_id=28946&func=browse
> If there are any problems, let me know.
This appears to be a browse page for empty buglists :-)
There is no obvious way to submit here. Perhaps you could
update the Bugs link off Contribute to point to or describe
the entry process.
> To make sure your bug reports don't get lost, I
> invite you to add them to Luxor's Sourceforge bug
> parade/tracker/database in addition to posting them
> here for discussion.
>
> - Gerald
Anyway, this is sort of a BugFix for your perusal ...
I played a bit with the ChromeResourceLoading and updated the
files in the attached zip.
The following snippets show various means I have gotten
to work using hardcoded default and passing in environment
stuff through System.Properties, aka "java -Dprop=value ..."
which is a little cleaner than args parsing.
public static final String CHROME =
"org.luxor.myprog.ui.chrome.ChromeAnchor";
[...]
Properties sysprops = System.getProperties();
String chrome;
if (null != (chrome = sysprops.getProperty("CHROME_FILE"))) {
File rootPath = new File(chrome);
xrl = new ChromeFileResourceLoader(rootPath);
} else
if (null != (chrome = sysprops.getProperty("CHROME_JAR"))) {
File rootPath = new File(chrome);
xrl = new ChromeJarResourceLoader(rootPath);
} else
if (null != (chrome = sysprops.getProperty("CHROME_ANCHOR", CHROME))) {
Class chromeAnchor = Class.forName(chrome);
xrl = new ChromeClassResourceLoader(chromeAnchor);
}
Either a "chrome" directory or a "ChromeAnchor.class" can
be picked up from the classpath, specific jar or directory
in the filesystem and used as an anchor to suck in
underlying files in appropriate startup, config or locale
subdirectories.
If the chrome anchor is not at the root of the jar it is
still possible to use relative paths from the anchor to
pickup things like images imbedded in the *.xul file, i.e.
"org.luxor.myprog.ui.chrome.myprog.startup.myprog.xul"
or "myprog.startup.myprog.xul" works just as well.
It will also find any number of startup/config/locale
directories and take only files that lie within them
rather than everything under the root, or a need to
make these directories be an immediate subdirectory of
the root.
There was a bug in ChromeJarResourceLoader that caused
things to die in caramel code if you included a classes
directory in your classpath and tried to use anchors.
This has been fixed by making the ChromeClassResourceLoader
a fully functional loader, and detecting whether the
class lies in a jar or the filesystem. The constructor
that used classes has been removed from the Jar version.
If you want to go back to the current style of allowing
only subdirectories of the anchor directory to be
included, there is a boolean argument to the getAllEntries()
that can cut off the full tree search.
Duplicate code has been removed and consolidated in
places like getAllEntries() which should make it easier
to extend things in the future.
Enjoy ...
Cheers,
RossW
=====
ChromeResourceLoader.zip
(application/zip, 8.2 KB) - not displayed