Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Duplicate Extension Element IDs
Duplicate Extension Element IDs [message #503288] Fri, 11 December 2009 11:58 Go to next message
Aaron L is currently offline Aaron LFriend
Messages: 18
Registered: November 2009
Junior Member
I have an Eclipse-based RCP application that allows other plugins to extend it via a custom extension point that I have created. The extension point element requires an ID that uniquely identifies the item being contributed by the plugin.

I was wondering if I could prevent other plugins from contributing items that have an ID that is the same as an item that has already been contributed or what the best way to handle this scenario would be.

Should my RCP application be modified to handle contributions with duplicate IDs (perhaps by ignoring duplicate contributions or notifying the user of an error condition) or does Eclipse already have something built in to handle these cases?

I quickly tried to see how Eclipse handles this by contributing 2 views to the Eclipse workbench with identical IDs. Eclipse seems to ignore the second view with the duplicate ID but does not indicate any error condition.

Any suggestions would be greatly appreciated.
Re: Duplicate Extension Element IDs [message #503755 is a reply to message #503288] Tue, 15 December 2009 15:56 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You just have to pick a predictable strategy and go with that. The different extension readers use different strategies depending on their requirements.

1) first in ... discard any that come after.

2) last in ... keep the first and discard any new ones.

3) reject all if there's a conflict.

Some extension readers sort the extensions by ID before processing since it helps increase the predictability of #1 and #2 (#3 is always predictable).

Some extension readers log any errors they encounter. Some clients use that to discover the problems they have. Some clients complain that it freaks out their customers and we shouldn't do that. You'll have to decide which kind of clients you have first Smile


Previous Topic:[Team] How to add files in the commit dialog
Next Topic:Funcitonality for "Cleanup" views, other fine-grained control..
Goto Forum:

Current Time: Thu Apr 26 06:11:14 GMT 2018

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

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