Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Create elements programatically
Create elements programatically [message #1041592] Mon, 15 April 2013 09:35 Go to next message
Philipp El is currently offline Philipp ElFriend
Messages: 14
Registered: September 2012
Junior Member
Hi,

i have a problem:
I have created a graphical editor using GMF. Now i want to make it possible to create new elements via a button instead of drag and drop via the palette.
I have no idea where i have to add the button for creating new elements and how the elements can be created.
The elements should be visible in the diagram after pressing the button!

Thank you very much!

Best regards,
Philipp
Re: Create elements programatically [message #1041641 is a reply to message #1041592] Mon, 15 April 2013 11:07 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

to create such a model element you can use CreateUnspecifiedTypeRequest http://publib.boulder.ibm.com/infocenter/rsahelp/v7r0m0/index.jsp?topic=/org.eclipse.gmf.doc/reference/api/runtime/org/eclipse/gmf/runtime/diagram/ui/requests/CreateUnspecifiedTypeRequest.html . This is what the tools in the palette also use. The main question is now where you want to place the button for adding your new model elment.

Ralph
Re: Create elements programatically [message #1041645 is a reply to message #1041592] Mon, 15 April 2013 11:11 Go to previous message
Philipp El is currently offline Philipp ElFriend
Messages: 14
Registered: September 2012
Junior Member
Hi Ralph,

thank you!
The button should appear below the palette.

Best regards,

Philipp
Previous Topic:Embedded Xtext on GMF
Next Topic:Question on refreshing relations
Goto Forum:
  


Current Time: Fri Apr 26 21:30:35 GMT 2024

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

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

Back to the top