chrome resource anchor technique

Gerald Bauer <[email protected]> Thu, 29 Jan 2004 00:57:56 -0800 (PST)
Newsgroups gmane.comp.java.luxor-xul.user
Message-ID <[email protected]>
Hello R. Dale Asberry,

> actually...
> 
> from calc:
> 
> chrome=calc
>
chrome.calc=file:///c:/sandbox/ramses/src/chrome/calc
> 
> which points to the chrome root directory.

   In Ramses I've used an old technique that turned
out to be to complex and confusing to everybody. To
switch between testing (using loose chrome files) and
production (using jarred up chrome files) I used two
set of property files, that is, calc.properties for
testing and calc-prod.properties for production.

   I suggest using the chrome loaders directly. To
switch between testing and production you can use a
simple if statement. Here's an example from the Lopica
Web Start Browser ( online @
http://lopica.sourceforge.net )

	public static void main(String[] args) throws
IOException
	{
		// allow class:// urls
		URL.setURLStreamHandlerFactory( new
LuxorUrlFactory() );

		// make sure we don't miss any errors, warnings,
hints.
		Status.addListener( new StatusConsole() );

		ChromeResourceLoader chromeLoader = null;
		File chromeRootDir = new File(
"c:/sandbox/lopica-jnlp-browser/src/chrome" );
		
		if( chromeRootDir.exists() &&
chromeRootDir.isDirectory() )
		{
		   chromeLoader = new ChromeFileResourceLoader(
chromeRootDir );
		}
		else
		{
		   chromeLoader = new ChromeJarResourceLoader(
AppShell.class  );
		}

		XulManager.getXulManager().setResourceLoader(
chromeLoader );
				
		new AppShell().run();
	}
   
 
> I'll take a look and see how the ChromeAnchor class
> works.  I saw that it
> was an option for loading chrome, but wasn't sure
> how it worked.

  Using an empty ChromeAnchor class bundled with your
chrome is also know as the resource anchor
trick/technique. See
http://rachel.sourceforge.net/tutorial.html for
details.

   - Gerald


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn