twindham
twindham

Reputation: 960

How do I change the name of menu item that is contributed by an eclipse plugin

I'm developing an RCP application. In our application we are using the Eclipse Packing Project's Eclipse Marketplace.

There is one command for showing the Eclipse Marketplace. Using plug-in spy, I found that its ID is org.eclipse.epp.mpc.ui.command.showMarketplaceWizard.

The display name on the menu is "Eclipse Marketplace". The Product Manager doesn't like that and wants it to just say "Marketplace".

Is there a way to change the name of this menu item?

Upvotes: 1

Views: 315

Answers (3)

Sadique
Sadique

Reputation: 170

Its really easy with Equinox Transform. It won't take much time. For reference you can have a look at my blog Equinox Transform Revealed. You just need to write an xslt for Plugin.xml.

Upvotes: 0

Fredrik
Fredrik

Reputation: 10656

First I would ask the manager if the issue is really that important to spend time on it, if you dont know exactly how to do it, it's atleast a days job...

I dont know exactly how to do it, but here's what I would start by examining.

Download the source code to the plugin that has that menuitem. If you are lucky, and I think you might be, then that piece of menu text is translateable. You can verify this by finding a *.properties file in the right package that contains that string.

The solution would then be to offer a new translation in the locale you are using where that string has been changed:

  • You would first need to create a plugin fragment
  • Then read more about how to internationalize plugins here and offer a new translation of this string.

This solution will be forward/backward compatible as long as the key to the string won't change, and its a pretty straightforward solution that doesnt violate any core Eclipse principles. Well, not that much atleast.

Of course, this requires that the string is translatable.

Other alternatives:

Change the code in the Eclipse plugin, recompile and distribute this plugin instead of the original. But this means you will need to keep in mind that this plugin is handled in a special way everytime you upgrade to a newer version of Eclipse. And it's pretty ugly.

Upvotes: 1

Tom Seidel
Tom Seidel

Reputation: 9535

You could use the Equinox Transforms project with its xslt bundles. This allows you to perform a xslt-transformation of the plugin.xml that contributes this menu before its loaded by the platform without modifying any platform bundles. Check also Bug 276638

Upvotes: 3

Related Questions