Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Replace/overwrite resource files of another plugin
Replace/overwrite resource files of another plugin [message #526647] Mon, 12 April 2010 13:50 Go to next message
AvH  is currently offline AvH Friend
Messages: 7
Registered: April 2010
Junior Member
Hi!

I have multiple plug-in projects, one of them implementing some third-party logic. This one is configured by a bunch of properties files. A default configuration resides directly here.

Now I depend on this plug-in from other projects. The problem is that I'd like to override some of its resources to change its behaviour. I learned that different plug-ins have different class loaders, which makes that not a trivial task. By simply placing the changed properties files in the plug-in's classpath this cannot be achieved.

My question is: it is possible somehow?

Thanks a lot!

Regards,
Alexander

Re: Replace/overwrite resource files of another plugin [message #526960 is a reply to message #526647] Tue, 13 April 2010 15:08 Go to previous messageGo to next message
AvH  is currently offline AvH Friend
Messages: 7
Registered: April 2010
Junior Member
Hi again,

I'm still experimenting with the issue stated above.

I learned that there is something called buddy classloaders. With that in mind I modified the dependent plug-in's manifest (A) and added "Eclipse-BuddyPolicy=registered". My own plug-in (B) got "Eclipse-RegisterBuddy: A". This should make the plug-in A look for classes (and resources?) in plug-in B's classloader.

What happens is somewhat strange: plug-in A behaves different now, but still does NOT respect my configuration (which lies in plug-in B).

Does this buddy stuff really work with resources too?

How can the order where to search for them be defined?

Thanks,
Alexander
icon3.gif  [Solved] Replace/overwrite resource files of another plugin [message #527815 is a reply to message #526960] Fri, 16 April 2010 14:56 Go to previous message
AvH  is currently offline AvH Friend
Messages: 7
Registered: April 2010
Junior Member
It works for me now.

The pronlem seems to be that plug-in A still prefers its own resources, and only looks for its buddies' resources if it cannot found them.

So I extended one of its classes, specified another resources path, and voila: the resources are loaded from my plug-in.

Cheers,
Alexander
Previous Topic:RCP UI thread
Next Topic:Moving an RCP product from eclipce 3.3 to 3.5
Goto Forum:
  


Current Time: Fri Dec 19 02:25:44 GMT 2014

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

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