I am creating a command programmaticaly:
final Command commandAdd = commandService.getCommand( "editor.commands.macro.add1");
commandAdd.define( "Add", "Add Macro", commandService
.getCategory( "editor.category.macrogroup" ) );
Then I create a Contribution item and add it to the toolbar:
CommandContributionItemParameter addMacroParameter =
new CommandContributionItemParameter( serviceLocator , "", commandAdd.getId(),
CommandContributionItem.STYLE_PUSH );
CommandContributionItem add = new CommandContributionItem(addMacroParameter);
toolBarManager.add(add);
Right now the toolbar has the button "Add" in it. My problem is if I run this code again, but I change the name from "add" to lets say "Insert" :
final Command commandAdd = commandService.getCommand( "editor.commands.macro.add1");
commandAdd.define( "Insert", "Add Macro", commandService
.getCategory( "editor.category.macrogroup" ) );
my toolbar has the command with still the name "Add" on it. I simply can't change that name anymore, unless I define a command with another id instead of "editor.commands.macro.add1"
How can I simply edit the name that appears in the toolbar? Thanks!