Overriding a command name in another plugin [message #499667] |
Mon, 23 November 2009 16:29 |
Raajesh B.Kashyap Messages: 7 Registered: July 2009 |
Junior Member |
|
|
We are trying to debug a problem which involves overriding the name of a command in another plugin, in our RCP application. I want to understand the correct mechanism to override the name of the command when a new plugin is loaded.
Basically, we have a common plugin which defines a command, and its name is internationalized in the plugin.properties file in the same common plugin, something like this:
In the common plugin's plugin.xml:
<extension point="org.eclipse.ui.commands">
<command
id="com.x.y.z.abc"
name="%abc.TITLE">
</command>
</extension>
In the common plugin's plugin.properties:
abc.TITLE = Perform Operation
This command is then normally displayed in the menu system as "Perform Operation".
We have another plugin, which is optionally loaded by customers during the installation process. When this plugin is loaded, the need is to change the displayed name to something else (while the internal functionality executed is the same). So, what has been done is to re-define the command again in the optional plugin, something like this:
In the optional plugin's plugin.xml:
<extension point="org.eclipse.ui.commands">
<command
id="com.x.y.z.abc"
name="%abc.TITLE">
</command>
</extension>
In the optional plugin's plugin.properties:
abc.TITLE = Perform Transaction
However, this mechanism does not seem to work consistently. During development, when using Eclipse, the application shows "Perform Transaction" when the optional plugin is loaded, but in the installed environment, it still shows "Perform Operation". Even in the development environment, it does exhibit the behavior sometimes.
My question is if this is the correct way to override the command name in the optional plugin, and if not, what should be done?
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02765 seconds