Skip to main content


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 11:45 Go to next message
junior developer is currently offline junior developerFriend
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 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
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 #1060273 is a reply to message #1060260] Thu, 23 May 2013 19:03 Go to previous messageGo to next message
junior developer is currently offline junior developerFriend
Messages: 354
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 19: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 06:53 Go to previous message
Ed Merks is currently offline Ed MerksFriend
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/
Previous Topic:Xtext 2.4 referencing UML
Next Topic:Getting bean properties from JvmGenericType
Goto Forum:
  


Current Time: Thu Apr 25 05:00:05 GMT 2024

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

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

Back to the top