Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Create elements programatically
Create elements programatically [message #1041592] Mon, 15 April 2013 05:35 Go to next message
Eclipse UserFriend
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 07:07 Go to previous messageGo to next message
Eclipse UserFriend
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 07:11 Go to previous message
Eclipse UserFriend
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: Tue Jul 01 16:33:38 EDT 2025

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

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

Back to the top