[EMF.Edit] AddCommand to add root object to resource [message #668191] |
Wed, 04 May 2011 08:42  |
Eclipse User |
|
|
|
Hi,
How should I instantiate an AddCommand to add a new root object into a Resource ?
The documentation of AddCommand says that the AddCommand is equivalent to the call:
((EList)extent).addAll(index, (Collection)collection);
but I really don't understand what it means. I've tried:
AddCommand.create(domain, resource.getContents(),null,newRootEObject, resource.getContents().size());
but it still fails in factorAddCommand because getEOwner is null (it is a list, not an EObject).
Thanks,
Yves.
|
|
|
Re: [EMF.Edit] AddCommand to add root object to resource [message #668323 is a reply to message #668191] |
Thu, 05 May 2011 04:48  |
Eclipse User |
|
|
|
Yves,
Just "new" one using the constructor, i.e., new AddCommand(domain,
resource.getContents(), value).
Yves Bontemps wrote:
> Hi,
>
> How should I instantiate an AddCommand to add a new root object into a
> Resource ?
>
> The documentation of AddCommand says that the AddCommand is equivalent
> to the call:
>
> ((EList)extent).addAll(index, (Collection)collection);
>
> but I really don't understand what it means. I've tried:
>
> AddCommand.create(domain, resource.getContents(),null,newRootEObject,
> resource.getContents().size());
>
> but it still fails in factorAddCommand because getEOwner is null (it
> is a list, not an EObject).
>
> Thanks,
> Yves.
|
|
|
Powered by
FUDForum. Page generated in 0.03519 seconds