Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Get menu button with specific id
Get menu button with specific id [message #1714277] Wed, 11 November 2015 09:36 Go to next message
Tuan Hoang Anh is currently offline Tuan Hoang AnhFriend
Messages: 42
Registered: May 2015
Member
Hi all,

I add a menu button using plugin extension. And I want to manage that button with the specific ID that is defined in plugin.xml.
 <extension
        point="org.eclipse.ui.menus">
     <menuContribution
           locationURI="toolbar:org.eclipse.sirius.diagram.ui.tabbar?after=additions">
        <command
              commandId="stopCommand"
              icon="icons/tool/stop.gif"
              id="stopCommand"
              tooltip="Stop Application">
        </command>
     </menuContribution>
</extension>


Could anyone tell me how to get the list of all button with the same Id "stopCommand"? I want to edit the button (change icon, set text, set tooltip) anywhere.

Best Regards,
Tuan Hoang
Re: Get menu button with specific id [message #1714321 is a reply to message #1714277] Wed, 11 November 2015 17:59 Go to previous message
Brian de Alwis is currently offline Brian de AlwisFriend
Messages: 659
Registered: January 2012
Senior Member

Changing the icon, text, and tooltip are the preserve of the command's current handler: remember that with the command/handler paradigm, another more-applicable handler may be bound to "your" command. Cause your handler to implement IElementUpdater. And call ICommandService.refreshElements(commandId) when a situation arises that you need to trigger updates on possible UI bindings of the command.

Hope that helps.

Brian.


Eclipse Platform committer. Ask me about Eclipse support, training, and consulting.
Previous Topic:Strategies for debugging a refactoring operation in a custom plugin?
Next Topic:Late startup?
Goto Forum:
  


Current Time: Sun Oct 22 21:20:50 GMT 2017

Powered by FUDForum. Page generated in 0.05128 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software