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 -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -