EMF changes do not reflect Xtext Document [message #1060170] |
Thu, 23 May 2013 11:45 |
junior developer Messages: 354 Registered: January 2013 |
Senior Member |
|
|
Hi all ,
I changed EMF ,I write code in the public abstract class ContentUnitImpl extends MinimalEObjectImpl.Container implements ContentUnit.
I did debug ,entered in the debug but changes not reflect in the Xtext Editor.Why this changes reflected in the Xtext Document(Editor) ?
My code is below :
public void setName(String newName)
{
String oldName = name;
name = newName;
//Display name bos ise doldur.
if(this.getDisplayName() == null || this.getDisplayName().equals("")){
this.setDisplayName(name);
}
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ContentPackage.CONTENT_UNIT__NAME, oldName, name));
}
Best Regards,
[Updated on: Thu, 23 May 2013 12:02] Report message to a moderator
|
|
|
Re: EMF changes do not reflect Xtext Document [message #1060260 is a reply to message #1060170] |
Thu, 23 May 2013 17:28 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
I think in general you need to serialize the document and reparse it to
reflect such changes, but you don't really want to do that... Better you
manipulate the source directly (like refactoring changes do).
On 23/05/2013 1:45 PM, junior developer wrote:
> Hi all ,
> I changed EMF ,I write code in the public abstract class
> ContentUnitImpl extends MinimalEObjectImpl.Container implements
> ContentUnit.
> I did debug ,entered in the debug but changes not reflect in the Xtext
> Editor.Why this changes reflected in the Xtext Document(Editor) ?
>
> My code is below :
>
>
>
> public void setName(String newName)
> {
> String oldName = name;
> name = newName;
> //Display name bos ise doldur.
> if(this.getDisplayName() == null || this.getDisplayName().equals("")){
> this.setDisplayName(name);
> }
> if (eNotificationRequired())
> eNotify(new ENotificationImpl(this, Notification.SET,
> ContentPackage.CONTENT_UNIT__NAME, oldName, name));
> }
>
>
>
>
> Best Regards,
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Re: EMF changes do not reflect Xtext Document [message #1060319 is a reply to message #1060273] |
Fri, 24 May 2013 06:53 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
You generally do that by using the IXtextDocument and the node model
with help from org.eclipse.xtext.nodemodel.util.NodeModelUtils for
mapping your semantic model back to the node model.
On 23/05/2013 9:03 PM, junior developer wrote:
> Hi Ed,
>
> Sorry I do not understand .How can I manipulate the source directly?
> Best Regards,
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03134 seconds