label - How do i change command's name from toolbar programmatically in rcp? -


i creating command programmaticaly:

final command commandadd = commandservice.getcommand( "editor.commands.macro.add1");      commandadd.define( "add", "add macro", commandservice             .getcategory( "editor.category.macrogroup" ) ); 

then create contribution item , add toolbar:

commandcontributionitemparameter addmacroparameter =                 new commandcontributionitemparameter( servicelocator , "", commandadd.getid(),                     commandcontributionitem.style_push );         commandcontributionitem add = new commandcontributionitem(addmacroparameter);  toolbarmanager.add(add); 

right toolbar has button "add" in it. problem if run code again, change name "add" lets "insert" :

final command commandadd = commandservice.getcommand( "editor.commands.macro.add1");         commandadd.define( "insert", "add macro", commandservice                 .getcategory( "editor.category.macrogroup" ) ); 

my toolbar has command still name "add" on it. can't change name anymore, unless define command id instead of "editor.commands.macro.add1"

how can edit name appears in toolbar? thanks!


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -