Skip to main content



      Home
Home » Modeling » EMF » [EMF.Edit] AddCommand to add root object to resource
[EMF.Edit] AddCommand to add root object to resource [message #668191] Wed, 04 May 2011 08:42 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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.
Previous Topic:Problems with the clipboard of editingDomain
Next Topic:Sharing a Resource across multiple ResourceSets
Goto Forum:
  


Current Time: Sun Jul 20 17:26:00 EDT 2025

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

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

Back to the top