Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EList undo a "set"
EList undo a "set" [message #425166] Tue, 18 November 2008 01:43 Go to next message
Alex Boyko is currently offline Alex BoykoFriend
Messages: 200
Registered: July 2009
Senior Member
Hi,

I have an EAttribute of multiplicity many - an EList. Once I call
#set(int, E) a SET event is fired. Change recorder records this an
ADD_MANY and REMOVE. Hence, undo results in ADD and REMOVE change. Is this
expected? If yes, why it's not recorded as a SET change, so when the
change is undone a SET event is fired again with old and new object
swapped?
Thanks!

Cheers,
Alex
Re: EList undo a "set" [message #425167 is a reply to message #425166] Tue, 18 November 2008 06:02 Go to previous messageGo to next message
Renat Zubairov is currently offline Renat ZubairovFriend
Messages: 30
Registered: July 2009
Member
My first guess would be that parent-child relations to the elements in the
list should be affected by this change, i.e. In case of containment
reference container reference inside the objects in the list should be set
to Unset therefore REMOVE is triggered on the list content before setting a
new list inside.

BR
Renat


On 18.11.08 02:43, in article
d820eaf845211208fe0eef83a0ac20b2$1@www.eclipse.org, "Alex Boyko"
<aboyko@ca.ibm.com> wrote:

> Hi,
>
> I have an EAttribute of multiplicity many - an EList. Once I call
> #set(int, E) a SET event is fired. Change recorder records this an
> ADD_MANY and REMOVE. Hence, undo results in ADD and REMOVE change. Is this
> expected? If yes, why it's not recorded as a SET change, so when the
> change is undone a SET event is fired again with old and new object
> swapped?
> Thanks!
>
> Cheers,
> Alex
>
Re: EList undo a "set" [message #425173 is a reply to message #425166] Tue, 18 November 2008 07:02 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Alex,

The change recorder keeps the old value of the list and when it's time
to create a change description, it compares the original value to the
current value. Hence it can't tell whether the change happened as a
result of a set or a remove and an add. Of course the effect of either
is the same...


Alex Boyko wrote:
> Hi,
>
> I have an EAttribute of multiplicity many - an EList. Once I call
> #set(int, E) a SET event is fired. Change recorder records this an
> ADD_MANY and REMOVE. Hence, undo results in ADD and REMOVE change. Is
> this expected? If yes, why it's not recorded as a SET change, so when
> the change is undone a SET event is fired again with old and new
> object swapped?
> Thanks!
>
> Cheers,
> Alex
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:FeatureID=-1
Next Topic:EMF model with generic wildcard
Goto Forum:
  


Current Time: Thu Apr 25 00:13:04 GMT 2024

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

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

Back to the top