Monday, April 7, 2008

The bursting of bubbles

I've seen more than one post (well deservedly) applauding the enhanced support for content-type specific icons in Eclipse 3.4M6 and showing how to make use of them through an extension or org.eclipse.ui.editors, but I think that something needs to be pointed out about that solution. Developers who do this aren't just specifying their icons, they're specifying whole new editors. This isn't a bad thing, but every editor has to have a unique ID, and it's easy to forget that some other features depend on that editor ID. The most common example is the org.eclipse.ui.actionSetPartAssociations extension point, which adds menu and toolbar actions automatically as you switch from workbench part to workbench part. In WTP, this is how the JSP and Web Page Editors ensure that the Run menu is present and populated with the Launch action set, and it's how most editors expose the Annotation Navigation action set. So when you're registering an editor to get that custom icon showing up, keep in mind that there may be more to it than reusing the right editor and editor contributor class.