Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Handle connection deletion outside of the editor
Handle connection deletion outside of the editor [message #207888] Mon, 06 October 2008 12:13 Go to next message
Eclipse UserFriend
Hi,

I'm using GMF 2.0 with Eclipse 3.3.

My meta-model :

- Association
1 -> Entity
1 -> Entity
- Entity
0..* -> associations: Association

An Entity is represented by a node and an association by a connection.

I'm using a CanonicalConnectionEditPolicy on the DiagramEditPart to
synchronize changes in the model. I have customized it to have multiple
diagrams for the same model following this tips :
http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg13013.html

My problem :

It works fine with Entity (nodes) but not with Association
(connections).
When I delete an Association from the model outside the editor (in an
explorer) using the TransactionnalEditingDomain, the connection is not
deleted.

Any ideas ?

Thank you,
Sylvain Dudoit
Re: Handle connection deletion outside of the editor [message #207930 is a reply to message #207888] Tue, 07 October 2008 05:45 Go to previous messageGo to next message
Eclipse UserFriend
Hello Sylvain,

Did you generate CanonicalEditPolicies by GMF or was it custom code?
Looks like CaninicalEditPolicy installed on diagram was not notified on link
deletion. To handle this situation you have to listen for the corresponding
notification inside generated <Link>EditPart and call canonical update for
the diagram from there (see generated ???DiagramUpdateCommand).

-----------------
Alex Shatalin
Re: Handle connection deletion outside of the editor [message #208196 is a reply to message #207930] Thu, 09 October 2008 14:43 Go to previous messageGo to next message
Eclipse UserFriend
After debug in the DiagramEventBroker, it appears that the
CanonicalConnectionEditPolicy installed on the DiagramEditPart doesn't
receive Notifications. The Notifications are received by the
ShapeNodeEditPart of the element containing the association. This is
logical.

So, how to receive all Notifications in my DiagramEditPart's
CanonicalConnectionEditPolicy ?

Note that in order to have multiple views of a same model, I commented
this generated method of my CanonicalConnectionEditPolicy :

/**
* @generated NOT
*/
protected List getSemanticChildrenList() {
return Collections.EMPTY_LIST;
}

Thank you in advance for your answer !
Sylvain
Re: Handle connection deletion outside of the editor [message #208500 is a reply to message #208196] Tue, 14 October 2008 05:24 Go to previous message
Eclipse UserFriend
I finally solved my problem by adding an EContentAdapter in the
"activate()" of my ConnectionCanonicalEditPolicy to "refresh()" the
diagram when a "REMOVE" or "REMOVE_MANY" occurs.

Hope this help !
Sylvain
Previous Topic:Is it possible to display the diagram root element as node?
Next Topic:GMF Editors Logging
Goto Forum:
  


Current Time: Wed Jul 02 18:36:01 EDT 2025

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

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

Back to the top