Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Add a button (button-menu) to the GMF toolbar(How to add a button to the GMF toolbar)
Add a button (button-menu) to the GMF toolbar [message #1125188] Fri, 04 October 2013 04:50 Go to next message
Eclipse UserFriend
What is the path that I have to follow in order to have a functional button on the GMF toolbar?
More details: http://stackoverflow.com/questions/18985646/gmf-add-a-button-to-its-toolbar
until now I managed to make a button to appear there by modifying in XXXDiagramActionBarContributor (XXX any name) the public void init(IActionBars bars, IWorkbenchPage page) {} method. More exactly by adding an action to the (IToolBarManager) toolBarManager.
But now I don't get where to handle the button if it's clicked or not...
Thanks in advance!
Re: Add a button (button-menu) to the GMF toolbar [message #1128177 is a reply to message #1125188] Mon, 07 October 2013 08:23 Go to previous messageGo to next message
Eclipse UserFriend
I found something helpful in this pdf: http://www.inf.ed.ac.uk/teaching/courses/ip/resources/GEF/GEF_Tutorial_2up.pdf --- at least something in the right direction Wink
PS: chapter 9 especially

[Updated on: Mon, 07 October 2013 08:23] by Moderator

Re: Add a button (button-menu) to the GMF toolbar [message #1128203 is a reply to message #1128177] Mon, 07 October 2013 08:55 Go to previous message
Eclipse UserFriend
Hi,

the pop up toolbar is created by a PopupBarEditPolicy installed into your editparts. I managed to customize this menu by overriding fillPopupBarDescriptors(). This allows you to add your own buttons. Just call the addPopupBarDescriptor method from this method. For the elementtype you can provide null.

Ralph
Previous Topic:Error: EditPart has to be selectable
Next Topic:Expression Label For Element
Goto Forum:
  


Current Time: Tue Jul 08 13:48:40 EDT 2025

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

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

Back to the top