Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » update nodes on link creation and deletion
update nodes on link creation and deletion [message #482894] Fri, 28 August 2009 13:32 Go to next message
Vitaliy Volevach is currently offline Vitaliy VolevachFriend
Messages: 13
Registered: August 2009
Junior Member
Hello,

in my model I need to update some properties of connected nodes when a link is either created or deleted.
So far i have all non-autogen code inside an extension plugin and i would like to leave it that way.
To extend the creation request i think i have to add my own policy for CREATION_ROLE. But I could not find anything similar for deletion of an object, so I need some help there.

Regards,
Vitaliy

[Updated on: Mon, 31 August 2009 07:54]

Report message to a moderator

Re: update nodes link creation and deletion [message #483146 is a reply to message #482894] Mon, 31 August 2009 11:02 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Volevach,

???ItemSemanticEditPolicy.getDestroyElementCommand() will be called on deleting
an element, so you can place a breakpoint there to see which particular request
was used to initiate this command.

-----------------
Alex Shatalin
Re: update nodes on link creation and deletion [message #483167 is a reply to message #482894] Mon, 31 August 2009 12:57 Go to previous messageGo to next message
Vitaliy Volevach is currently offline Vitaliy VolevachFriend
Messages: 13
Registered: August 2009
Junior Member
Hello Alex,

i tried to debug the getDestroyElementCommand() int the Link's ItemSemanticEditPolicy class to see when it is called.
My problem is now that the org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElemen tRequest " is not only generated when I delete the link but also every time I click on it and even on it's creation. So I am now a little confused how to proceed.
Re: update nodes on link creation and deletion [message #483364 is a reply to message #483167] Tue, 01 September 2009 11:08 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Vitaliy,

getDestroyElementCommand() is called then you do something on diagram (change
selection...) but returned command will not be executed unless you call delete.

-----------------
Alex Shatalin
Re: update nodes on link creation and deletion [message #483431 is a reply to message #482894] Tue, 01 September 2009 15:29 Go to previous message
Vitaliy Volevach is currently offline Vitaliy VolevachFriend
Messages: 13
Registered: August 2009
Junior Member
Hello Alex,

thanks for your answer. Now I achieved my goal by overriding getDestroyElementCommand() and returning a CompositeTransactionalCommand where the generic DestroyElementCommand is composed together with my custom command. So far everything is working just fine.

Regards,
Vitaliy

[Updated on: Sun, 13 September 2009 14:34]

Report message to a moderator

Previous Topic:Create nodes programmatically
Next Topic:Customize 'save' action
Goto Forum:
  


Current Time: Fri Nov 28 03:22:15 GMT 2014

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

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