Skip to main content


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
Eclipse UserFriend
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.
Previous Topic:Define save action in plugin
Next Topic:Late startup?
Goto Forum:
  


Current Time: Thu Apr 25 10:22:31 GMT 2024

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

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

Back to the top