Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Cascade deletion in EMF/GMF
Cascade deletion in EMF/GMF [message #237301] Thu, 23 July 2009 10:08 Go to next message
Maxence VANBÉSIEN is currently offline Maxence VANBÉSIENFriend
Messages: 40
Registered: July 2009
Location: Lille, France
Member
Hello,

I'm trying to perform multiple deletion at once from a GMF Diagram. Lets
say I have a link to an object (the link is not contained by the object),
and when I remove the object, I want to remove the link (now with dead
destination) at the same time.

I read an article about this feature
( http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg04468.html)
and I don't feel comfortable with the solution.

When I was developing using GMF 1.x, I remembered I could perform such
feature by modifying the XXXEditHelper.getDestroyDependentsCommand, but it
seems this method is never called anymore with GMF 2.x...

Moreover, I discovered the IEditHelperAdvice mechanism, and I find it
really interesting.

Does someone knows how to perform such multiple deletion with
EditHelperAdvices ? Because I don't feel comfortable with multiple
deletion using the DestroyElementRequest/DestroyElementCommand.

Thanks in advance for your answer,

Maxence
Re: Cascade deletion in EMF/GMF [message #237463 is a reply to message #237301] Sat, 25 July 2009 02:51 Go to previous messageGo to next message
Alex Boyko is currently offline Alex BoykoFriend
Messages: 200
Registered: July 2009
Senior Member
Hi,

XXXEditHelper.getDestroyDependentsCommand should get called - this is how
geoshape example deletes links once source/target is being deleted. It is
possible that the edit helper code is not being invoked at all, you 'd
have to debug to check this. EditHelper should be provided via extension
point, perhaps the extension is missing...

Cheers,
Alex
Re: Cascade deletion in EMF/GMF [message #237522 is a reply to message #237463] Mon, 27 July 2009 07:45 Go to previous messageGo to next message
Maxence VANBÉSIEN is currently offline Maxence VANBÉSIENFriend
Messages: 40
Registered: July 2009
Location: Lille, France
Member
Hello,

At first, thanks for your answer ;)

In fact, I think the problem comes from deeper...

My XXXEditHelper is successfully "used", but only one method is called and
it is always the same: the getDestroyElementCommand() method.

When I try to debug a little bit, I can see that the GMF engine always
create a DestroyElementRequest. (The request is created in the
org.eclipse.gmf.runtime.diagram.ui.actions.AbstractDeleteFro mAction.createTargetRequest()))

By the way, the command used seems to always be the DestroyElementCommand.

I don't know currently where to look, the determine where the
DestroyDependentsRequest is supposed to be created so the
getDestroyDependentsCommand() method should be called. Could you give me
advice ?

Thanks in advance,

Maxence
Re: Cascade deletion in EMF/GMF [message #237527 is a reply to message #237463] Mon, 27 July 2009 08:04 Go to previous message
Maxence VANBÉSIEN is currently offline Maxence VANBÉSIENFriend
Messages: 40
Registered: July 2009
Location: Lille, France
Member
Hello again,

It seems that I found something that makes the
XXXEditHelper.getDestroyDependentsCommand being called.

In fact, in the YYYBaseEditHelper, the getDestroyElementCommand() method
is generated as returning "null". When i make it return
"super.getDestroyElementCommand(req)", the method is called in my
EditHelper.

Is this normal, Is what I did a correct way to proceed ?

Thanks in advance,

Maxence
Previous Topic:Compartments to fit children
Next Topic:Unable to create a valid mapping model
Goto Forum:
  


Current Time: Fri Apr 19 04:52:41 GMT 2024

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

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

Back to the top