[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.emf] Use of Copy, Paste Command

All,
I use my own copy and paste command to copy / paste objects using EMF
commands. I had to validate the owner on which the object is pasted.
for e.g. A contains a list of B objects.
If B's parent is a (instance of A), then B can be pasted only to a.

To accomplish this, I need to know the eContainer of B. But the
PasteFromClipboardCommand does not provide me with the eContainer of the
object copied.

command.append

(new CommandWrapper()

{

protected Command createCommand()

{

// Command copyCommand = CopyCommand.create(domain, domain.getClipboard());

CompoundCommand compoundCommand = new CompoundCommand();

Collection objectsToBePasted = copyCommand.getResult();

...

}

The objectsToBePasted has information regarding the object but not the
container. What is the recommended approach in this case. Should I store the
eContainer of the owner when it is copied and use it when it is pasted ?.

Thanks

Balaji