Bug 494343 - Default menu label has "()" added to the name of a parametrized command when values attribute is not set
Summary: Default menu label has "()" added to the name of a parametrized command when ...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.6   Edit
Hardware: All All
: P3 trivial (vote)
Target Milestone: 4.8 M7   Edit
Assignee: Michael Keppler CLA
QA Contact: Mickael Istria CLA
URL:
Whiteboard:
Keywords: bugday, helpwanted
Depends on:
Blocks:
 
Reported: 2016-05-23 15:44 EDT by Slava Kabanovich CLA
Modified: 2018-04-04 09:00 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Slava Kabanovich CLA 2016-05-23 15:44:58 EDT
Define a command

	<command id="mycommand" name="My Command">
		<commandParameter id="myparameter" name="name" optional="true">
		</commandParameter>
	</command>

and reference it in a menu contribution

	<command commandId="mycommand" style="push">
		<parameter name="myparameter" value="somevalue">
		</parameter>
	</command>

Menu item label will be "My Command ()".

That can be fixed either by adding attribute 'values' to the command parameter definition (but suppose I do not want the parameter to be included in the menu item label), or by setting the label of the menu item explicitely label="My Command". Though the workaround is simple, it do takes time to follow the weird "()" addition to its source, and since attribute 'values' is optional, org.eclipse.core.commands.ParameterizedCommand.getName(String baseName) might first check that there is something to put inside "()", and if there is nothing, then not to add them at all.
Comment 1 Brian de Alwis CLA 2016-06-01 11:38:41 EDT
Would you be willing to submit a patch?

https://wiki.eclipse.org/Platform_UI/How_to_Contribute
Comment 2 Mickael Istria CLA 2016-10-06 03:07:56 EDT
@Slava: do you think you'll be able to submit a patch for that very soon? 4.6.2 deadline is approaching and I believe it would be a pity to have it missing a fix for this issue.
Comment 3 Eclipse Genie CLA 2018-04-04 08:35:26 EDT
New Gerrit change created: https://git.eclipse.org/r/120702
Comment 5 Mickael Istria CLA 2018-04-04 09:00:58 EDT
Thanks Michael!