Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Replacing an element in your model
Replacing an element in your model [message #200456] Tue, 05 August 2008 11:40 Go to next message
Toyin is currently offline ToyinFriend
Messages: 35
Registered: July 2009
Member
Is there a way to design an application where you can right-click on an
element and then click on a botton in the context menu to replace the
element with another one? Please help.
Thank you

Toyin
Re: Replacing an element in your model [message #200652 is a reply to message #200456] Wed, 06 August 2008 03:55 Go to previous message
Jevon  is currently offline Jevon Friend
Messages: 164
Registered: July 2009
Senior Member
Hi Toyin,

I did this by deleting the selected element and then creating a new
element where the old one was. Try the "Insert Topic" tutorial on
http://wiki.eclipse.org/GMF_Tutorial_Part_3 to learn how to create new
elements based on selecting an option in a context menu.

To create a command to delete an element:

DestroyElementRequest request = new DestroyElementRequest(element, false);
Command deleteLinkCmd = sublink.getCommand( new
EditCommandRequestWrapper(request) );

Jevon

Toyin Fakorede wrote:
> Is there a way to design an application where you can right-click on an
> element and then click on a botton in the context menu to replace the
> element with another one? Please help.
> Thank you
>
> Toyin
>
Previous Topic:programmatically create element in a View
Next Topic:connection-editing via properties is incorrect
Goto Forum:
  


Current Time: Tue Apr 23 11:05:12 GMT 2024

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

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

Back to the top