views:

86

answers:

1

I have a some additional xml files(containing standard eclipse extensions) that lie outside the bundle. Is there a way that I could contribute the extns/extnpoints in those files to the platform's extension registry?

I tried

`Platform.getExtensionRegistry.addContribution(..)`

But the method takes a masterToken object, which I dont have access to, and without which it gives me an exception.

A: 

You have to use some internal methods. Here is what I do:

    IExtensionRegistry reg = Platform.getExtensionRegistry();
    Object ut = ((ExtensionRegistry)reg).getTemporaryUserToken();

    IContributor cont = ContributorFactoryOSGi.createContributor(Platform
            .getBundle(editor.getPluginId()));


    if (!reg.addContribution(is, cont, false, null, null, ut))
        Util.impossible("Contribution not added due to error"); //$NON-NLS-1$
Francis Upton
Thanks Francis,I also use something similar. But there are two problems(correct me if I am worng) here:a) Using temprorary tokens, the contributions won't persistb) Though my system is an OSGI system, the new contributions are coming from a non-osgi-bundle contributor.I created the contributor without using ContributorFactoryOSGi somehow, but I am not sure how actually to mix osgi-contributors and non-sogi contributors.
Suraj Chandran
I'm not sure how to answer any of your concerns. I would post in the Eclipse Runtime Equinox newsgroup (in eclipse.org - they have a web forums interface as well) and you should be able to get some good help there.
Francis Upton
can you also post the link here, so i could follow up. thanks.
Suraj Chandran