Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Use ID on the extension element or as an attribute?
Use ID on the extension element or as an attribute? [message #512766] Sun, 07 February 2010 07:04
Philipp Kursawe is currently offline Philipp KursaweFriend
Messages: 135
Registered: July 2009
Senior Member
Hello all,

I wonder whats the best approach to give an extension a unique ID. There
are two ways to do that:

1. Use the ID already present on each extension element
2. Create an "id" attribute in a child-element of the extension

I am currently working on a "CopyTo" extension for the Eclipse
Workbench, that allows to quickly copy Java classes or method bodies to
your favorite pastebin site and puts the URL of the created entry into
the clipboard. For some pastebin providers there is post-processing
needed that one should be able to plug-in via extensions. So I have the
"eclipseutils.ui.copyto" Extension Point that should provide the following:

1. Allow to specify a response handler
2. Allow to describe parameter configurations, that the user can
edit prior the request is sent

Should I have 2 EPs for that: "eclipseutils.ui.copyto.responseHandlers"
and "eclipseutils.ui.copyto.paramInfos"? Or one
"eclipseutils.ui.copyto.extensions" with sub-elements "responseHandlers"
and "paramInfos"? Each "CopyTo" is contributed via menuContribution that
uses the "eclipseutils.ui.copyto" command. One of the command parameters
is "id" which is used to look up extensions provided for that
menuContribution. I guess the quickest way to fetch an extension for a
specific "id" is to ask the IExtensionRegistry for an IExtension with a
specific ID. That would mean you have to set the ID on the extension
itself. Otherwise I would have to query all IConfigurationElements and
parse it for the "id" attribute. How you design your extensions also
depends if others should be able to contribute to them later. The
product splashscreen is a good example of late bindings. You describe
the splashscreen somewhere and later reference it in a binding with a
specific product. Any thoughts?

Previous Topic:perform URL resource loading inside IElementUpdater.updateElement(UIElement, Map)
Next Topic:Resource rename and non-text based editors
Goto Forum:

Current Time: Thu May 24 16:09:30 GMT 2018

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

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

Back to the top