Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 16:13 Go to next message
exquisitus is currently offline exquisitusFriend
Messages: 18
Registered: July 2009
Junior Member
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 09:45 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
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 18:43 Go to previous messageGo to next message
exquisitus is currently offline exquisitusFriend
Messages: 18
Registered: July 2009
Junior Member
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 09:24 Go to previous message
exquisitus is currently offline exquisitusFriend
Messages: 18
Registered: July 2009
Junior Member
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 Jan 27 15:43:51 GMT 2021

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

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

Back to the top