Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » EMF changes do not reflect Xtext Document
EMF changes do not reflect Xtext Document [message #1060170] Thu, 23 May 2013 07:45 Go to next message
junior developer is currently offline junior developer
Messages: 159
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 08: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 13:28 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 24570
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,
Re: EMF changes do not reflect Xtext Document [message #1060273 is a reply to message #1060260] Thu, 23 May 2013 15:03 Go to previous messageGo to next message
junior developer is currently offline junior developer
Messages: 159
Registered: January 2013
Senior Member
Hi Ed,

Sorry I do not understand .How can I manipulate the source directly? I synchronize Xtext and GMF.such as above changes reflect in the diagram but not reflect in the Xtext document .

Best Regards,

[Updated on: Thu, 23 May 2013 15:11]

Report message to a moderator

Re: EMF changes do not reflect Xtext Document [message #1060319 is a reply to message #1060273] Fri, 24 May 2013 02:53 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 24570
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,
>
>
Previous Topic:Whitespace without newlines
Next Topic:XtextEditor manipulation
Goto Forum:
  


Current Time: Tue May 28 17:12:38 EDT 2013

Powered by FUDForum. Page generated in 0.02909 seconds