Skip to main content



      Home
Home » Modeling » EMF » EList undo a "set"
EList undo a "set" [message #425166] Mon, 17 November 2008 20:43 Go to next message
Eclipse UserFriend
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 01:02 Go to previous messageGo to next message
Eclipse UserFriend
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 02:02 Go to previous message
Eclipse UserFriend
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
>
Previous Topic:FeatureID=-1
Next Topic:EMF model with generic wildcard
Goto Forum:
  


Current Time: Sun Jul 06 17:00:51 EDT 2025

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

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

Back to the top