[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.emf] Re: Undo/Redo using ChangeCommand

Hello Mr Ed marks,
Thanks for your relpy.
Regarding duplication of the obj1 to dupObj1 is just creating a copy of obji itself and adding then obj3 is then reference to dupObj so that obj3 will have reference to the duplicates obj1 created.


My only problem during undo is the the reference added to obj3 while duplicating not getting removed i.e even after undo (where dupObj1) removed from tree obj3 is still holding reference to that duplicated object.

For me i need immediate solution for this ?Or can i refer any of the undo/redo testcase which handles this type of problems ?

Thanks BG



Ed Merks wrote:

BG,

I just have a bad feeling I'm missing something important that's not been stated. I certainly imagine that if changes are being recorded for obj1 and obj3 that apply those changes will undo any changes made to them. A running (failing) test case I can use to reproduce the problem is likely to be better than dozens of note exchanges. To directly answer your question, I imagine at some point you are duplicating obj1 (not sure what that means, it might just mean creating an object of the same type as obj1, or it might mean more). I would imagine that this duplication process, if it involves changes that affect obj1 or any other object would itself be done as a specialized change command. But I'd need to ask many more questions to understand exactly the complete structure of what you are doing....

BG wrote:

Hello Mr Ed Marks

Regarding first question abt [1] .I didn't get this point sorry ?

Well, I noticed it's single valued so when obj3 refers to dupObj1, obj1 is being modified, right? So are changes for it being recorded? I.e., are you passing obj3 and obj1 to the change command?

"Yes we are passing the obj1 and obj3 seperately for recording"

Perhaps that's all that's missing, so I won't worry about the other issues until this part is clear. You might also try passing in the whole resource that contains all these things... ?
"Can i known how to pass this as a resource since these are from different resoucres (different object type they are non-containment reference) ?"



Regarding 2 it will have reference to obj3 from obj1...

and during duplication also it obj3 holds reference to dupObj1 i.e

               |----obj1                    obj3|
               |----dupObj1

The dupObj1 is created and reference is added using our own command which similar to add command.

Can i known how to pass the created dupObj1 to recorder while recording ?

Regards
BG


Hello Mr Ed