[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.emf] Re: Getting EditingDomain and ResourceSet from IFile

Artur,

Comments below.

Artur Kronenberg wrote:
Hi,

I would need to get the EditingDomain and the ResourceSet from and IFile without opening that file in the EMF editor?
Hmmm.
I don't know if that question even makes sense or not, but is that possible?
Not totally, no.
I have multiple files which I need to add things programmatically, so I need the resourceset to find the owner where to add my new nodes and I need the editing domain to execute the AddCommand I create.
Commands are only necessary generally in editors, because that's the only place you need to be able to undo what you're doing.

With one file, I got everything by opening the editor, but I don't know if I can modify files that aren't even opened?
Yes, but you need only load them into a new ResourceSetImpl, do what you want with them, and save them if you want. The FAQ shows how to convert an IFile to a URI...
any help would be very nice :)
Best regards,
Artur