Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Changing remove behaviour
Changing remove behaviour [message #411335] Tue, 24 July 2007 05:55 Go to next message
Fateh SAADA KHELKHAL is currently offline Fateh SAADA KHELKHAL
Messages: 19
Registered: July 2009
Junior Member
Hello.

Here is my situation:

I would like to do some modifications on references of an object before removing it from my model. I tried to create a new remove command where, for example, I'd like to avoid removing the object. I was surprised that the object still there but not the references it has for other objects. I think they are removed somewhere else.

How could I "properly" avoid that?

Here is an other question: if some modifications are done some where else than in command, is this still coherent with Command Design Pattern and its purposes? this behaviour is surprising me but maybe I'm wrong?!?

Could anyone help me please?

Thanks.
Re: Changing remove behaviour [message #411340 is a reply to message #411335] Tue, 24 July 2007 07:17 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25739
Registered: July 2009
Senior Member
Fateh,

Probably you should have a look at how the DeleteCommand behaves and how
DeleteAction uses it. By default it will remove all references to the
deleted object and will use commands to do all that cleanup. You could
configure DeleteAction not to do that or to do something a little different.


Fateh SAADA KHELKHAL wrote:
> Hello.
>
> Here is my situation:
>
> I would like to do some modifications on references of an object before removing it from my model. I tried to create a new remove command where, for example, I'd like to avoid removing the object. I was surprised that the object still there but not the references it has for other objects. I think they are removed somewhere else.
>
> How could I "properly" avoid that?
>
> Here is an other question: if some modifications are done some where else than in command, is this still coherent with Command Design Pattern and its purposes? this behaviour is surprising me but maybe I'm wrong?!?
>
> Could anyone help me please?
>
> Thanks.
>
Re: Changing remove behaviour [message #411348 is a reply to message #411340] Tue, 24 July 2007 08:05 Go to previous messageGo to next message
Fateh SAADA KHELKHAL is currently offline Fateh SAADA KHELKHAL
Messages: 19
Registered: July 2009
Junior Member
OK. Thanks a lot.
Re: Changing remove behaviour [message #411355 is a reply to message #411340] Tue, 24 July 2007 08:32 Go to previous message
Fateh SAADA KHELKHAL is currently offline Fateh SAADA KHELKHAL
Messages: 19
Registered: July 2009
Junior Member
Hello again.

I think I've found something that may help me: the <b>protected boolean removeAllReferencesOnDelete()</b> method in the concerned <b>ActionBarContributor</b> class. Retruning false avoid Delete Action to remove references.

Thanks again.
Previous Topic:shared node
Next Topic:dynamic extension of model
Goto Forum:
  


Current Time: Wed Apr 16 00:57:05 EDT 2014

Powered by FUDForum. Page generated in 0.06386 seconds