Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » data binding beteen xtext and swt(data binding between xtext and swt)
data binding beteen xtext and swt [message #1048338] Wed, 24 April 2013 10:23 Go to next message
Dana Klein is currently offline Dana KleinFriend
Messages: 63
Registered: October 2012
Member
I am building a plugin for eclipse that provides a graphical editor.
In this editor, I want to bind some data between an XText model and the SWT widgets. How can I do this while updating the XTextDocument automatically?
Are there existing tools that help with this, or do code generation for this?

By now, I have created with window builder plugin JFace Automatic Databinding with controller class.
it seem that whenever I change the text field which the xtext data model (JString) is bind to, the binding put null/new instance of JString into the JString instance.
so the document isn't familiar with the new JString instance and it is not updated with the new data.
Re: data binding beteen xtext and swt [message #1049682 is a reply to message #1048338] Fri, 26 April 2013 06:36 Go to previous messageGo to next message
Benjamin Schwertfeger is currently offline Benjamin SchwertfegerFriend
Messages: 53
Registered: July 2009
Member
Hi Dana,
the emf model of xtext should only be accessed in a IUnitOfWork while inside the XtextDocument.modify or XtextDocument.readOnly. For Databinding the binding should be against the URI of the EObject and read and write inside the unitOfWork. As far as I know, there is no implementation for the eclipse databinding and xtext yet. Implementation could be similar to those of EMFEditProperties with XtextDocument instead of editing domain.

Benjamin
Re: data binding beteen xtext and swt [message #1052942 is a reply to message #1048338] Wed, 01 May 2013 13:55 Go to previous message
Dana Klein is currently offline Dana KleinFriend
Messages: 63
Registered: October 2012
Member
I extended AbstractObservableValue to work with simple xtext models as string boolean and numbers. which help me to bind between swt model and my xtext models
Previous Topic:Make an executable of my DSL once its complete?
Next Topic:UI model validation
Goto Forum:
  


Current Time: Thu Apr 25 01:36:56 GMT 2024

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

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

Back to the top