Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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
Edwin Tuzar is currently offline Edwin Tuzar
Messages: 33
Registered: April 2013
Location: Kaiserslautern
Member

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!


Edwin W.T.
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
Edwin Tuzar is currently offline Edwin Tuzar
Messages: 33
Registered: April 2013
Location: Kaiserslautern
Member

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


Edwin W.T.

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

Report message to a 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
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 697
Registered: November 2009
Senior Member
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: Wed Aug 27 13:22:16 EDT 2014

Powered by FUDForum. Page generated in 0.08667 seconds