[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.emf] Add and Save an EReference attribute of an Element


Hello, that may be a newbie question but I have trouble adding and saving an ERefence of an Element.

I currently have a xxx Element which have an yyy EReference


//First I create the yyy object: YYY yyy = XXXFactory.eINSTANCE.createYYY(); yyy .setSomething("blabla");

//then i add it to my XXX element:
editingDomain.getCommandStack().execute(new SetCommand(editingDomain, xxx, XXXPackage.Literals.XXX__YYY, yyy));


and that don't works, it add it correctly to my element (saw it through debug) but when i save the file nothing happens (the xml file is unchanged).


However if I do the same thing for an EAttribute (e.g. the name of the Element), it works perfectly.
It does the same thing with AddCommand (org.eclipse.emf.edit.command)

I don't know what i'm missing.
Thank you in advance for your help :)