Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » IExtensionRegistry.addContribution() calls not working in E4?
IExtensionRegistry.addContribution() calls not working in E4? [message #987023] Fri, 23 November 2012 00:11 Go to next message
Laurent Petit is currently offline Laurent PetitFriend
Messages: 21
Registered: December 2010
Junior Member
Hello,

following this IBM article:

www.ibm.com/developerworks/opensource/library/os-ecl-dynext/

I've been able to generically programmatically add extensions to plugins in Eclipse 3.

For instance, I've been able to dynamically contribute an IViewPart by calling IExtensionRegistry.addContribution() with the relevant XML stream.

And then instantly see, in my Eclipse 3 instance, the effect of the call: seeing the IViewPart name show up in the Show View > ... menu.

But this does not seem to work in Eclipse 4.

Is this a limitation of the Eclipse 3 compatibility layer?

I'm not ready yet to support 2 different code bases for my plugin for Eclipse 3 and Eclipse 4, so I'd like to be able to get this working.

Is there some method somewhere to call to inform the Eclipse 4 machinery that it should refresh based on new content declared via the call to IExtensionRegistry.addContribution() ?

Any help appreciated,

--
Laurent Petit
Re: IExtensionRegistry.addContribution() calls not working in E4? [message #987134 is a reply to message #987023] Fri, 23 November 2012 17:33 Go to previous messageGo to next message
Eclipse UserFriend
It's a limitation of the current view registry implementation -- it's not dynamic. I've started hacking at it, but It's not yet complete.
Re: IExtensionRegistry.addContribution() calls not working in E4? [message #987149 is a reply to message #987134] Fri, 23 November 2012 20:02 Go to previous messageGo to next message
Laurent Petit is currently offline Laurent PetitFriend
Messages: 21
Registered: December 2010
Junior Member
hello,

Just to make sure we speak about the same problem:

- I had the same problem when I tried to register new commands/handlers/menu entries this way.
- with eclipse 3, for both view registration / commands, etc. Registrations, it worked.

Regards, Laurent.
Re: IExtensionRegistry.addContribution() calls not working in E4? [message #987150 is a reply to message #987149] Fri, 23 November 2012 20:21 Go to previous messageGo to next message
Eclipse UserFriend
For Eclipse 4.x, much of the underlying UI framework code was re-implemented or required substantial change. In the interest of time, support for dynamic registry changes was not considered a priority. If you look at ViewRegistry, which holds onto the known list of views, the registry is built in its @PostConstruct and no registry listeners are ever registered.

If you absolutely need this to work, you might be able to call "WorkbenchPlugin.getInstance().reset()" (a protected method) to reset those caches.

Brian.
Re: IExtensionRegistry.addContribution() calls not working in E4? [message #987153 is a reply to message #987150] Fri, 23 November 2012 21:09 Go to previous message
Laurent Petit is currently offline Laurent PetitFriend
Messages: 21
Registered: December 2010
Junior Member
Thanks for your help Brian, but it's now clear to me that it is a dead end, so I'd better try another approach.
Your input was invaluable to help me clear things out,

Cheers,

--
Laurent
Previous Topic:XWT Databinding
Next Topic:How to use IPartListener
Goto Forum:
  


Current Time: Sat Apr 20 02:04:29 GMT 2024

Powered by FUDForum. Page generated in 0.03622 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top