[Project_owners] Changing contents.rdf / overlays dynamically

Pete Collins pete at mozdevgroup.com
Mon Jul 5 14:45:10 EDT 2004


Brian King wrote:

> I'm wondering if anyone has done something like the following?:
>
> - I have a bunch of UI widgets, split between different overlay files
> - I want to pick and choose which ones to use/pull in, which can be 
> different in any given session.
> - The contents.rdf file that defines the overlays, when registered 
> creates an overlays.rdf file in 
> chrome/overlayinfo/<extension>/content/overlays.rdf
> - Until now, I do this by hand editing contents.rdf, and 
> re-registering the chrome.
>
> What I would like to do is:
> - Provide a GUI for choosing which widgets to appear, and the 
> checkboxes would map to different overlay files.

Yo want to maintain a fixed number of different overlays so you can then 
choose a specific overlay and the point to that from overlays.rdf right?

> - Modify contents.rdf, or even better directly overlays.rdf based on 
> users choice, via script.

You can't modify contents.rdf because it's wrapped up in a jar. You can 
modify overlays.rdf since it is just another datasource. Take a look at 
the jsLib uninstall code Neil implemented and you'll see where he did that.

http://www.mozdev.org/source/browse/~checkout~/jslib/libraries/install/uninstall.js?rev=1.29&content-type=text/plain

Take a look a the removeOverlay function.

--pete


-- 
Pete Collins
www.mozdevgroup.com
Mozilla Software Development Solutions 




More information about the Project_owners mailing list