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
Post a Comment