Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Change value of a model element on deleting connection
Change value of a model element on deleting connection [message #143558] Fri, 20 July 2007 04:16 Go to next message
Eclipse UserFriend
Hi !

I want to update a model value when I delete a connection from my
diagram. I thought that I could do that on the
ConnectionItemSemanticEditPolicy.getDestroyElementCommand(.. ) but this
method is called when I select the connection on the graph, when I
delete the connection, and when I create a connection.

Is there a way to know if the connection will be deleted and not
selected/created ?

Thanks in advance
Re: Change value of a model element on deleting connection [message #143576 is a reply to message #143558] Fri, 20 July 2007 08:18 Go to previous message
Eclipse UserFriend
Hi Julien,

This method is apparently called in all these situations to update
enablement of the associated action. Your update should be a part of the
command you return. This way, it will be executed only when the
connection is actually deleted from the diagram.

Note that if the connection is deleted by other means (e.g.,
programmatically), this command may not be executed. If you really need
to make sure any deletion of this type of connection should update the
model, you should subscribe to your (transactional) editing domain with
a precommit ResourceSetListener and contribute your trigger command from
transactionAboutToCommit(...) method.

Best regards,
Boris


Julien Forot wrote:
> Hi !
>
> I want to update a model value when I delete a connection from my
> diagram. I thought that I could do that on the
> ConnectionItemSemanticEditPolicy.getDestroyElementCommand(.. ) but this
> method is called when I select the connection on the graph, when I
> delete the connection, and when I create a connection.
>
> Is there a way to know if the connection will be deleted and not
> selected/created ?
>
> Thanks in advance
Previous Topic:Border Items overlapping the border
Next Topic:Modeling Assistant Provider - Suppressing existing connection handles
Goto Forum:
  


Current Time: Tue Jul 22 03:26:20 EDT 2025

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

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

Back to the top