Sunday, August 10, 2008

Crime and Punishment


Thinking that your action set is sooooo important that it deserves to appear in the toolbar of every perspective in every Eclipse product that contains your plug-in.

This very common Eclipse programming faux-pas is easy to make. All it takes is set the 'visible' attribute of your action set extension to 'true'.

There are many examples out there, but one example I was bitten by recently is the Ant/External Tools action set in the Eclipse SDK.

Running Ant scripts is useful, but its appeal is certainly not so universal to demand this ultimate level of visibility. The Ant action set currently appears by default in the toolbar of every perspective of every product that packages the org.eclipse.platform feature.

It may be reasonable to see it in the Java perspective:

It is questionable to see it in the Team Synchronizing perspective:

We have also inherited the gift of Ant in the SQL perspective of PowerSQL, where the target audience does not necessarily need Ant or even know what Ant is:


Lesson Learned:

Use the 'visible' attribute wisely when creating an action set, and nobody gets hurt :)


David Carver said...

Better yet, migrate away from ActionSets and to the org.eclipse.ui.menus extension point and create it as a toolbar, that others can add too and control when it's visible.

Chris Aniszczyk (zx) said...

It would be really cool to see a bug open for this ;)

Wassim Melhem said...

Already done: