Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF.Edit and Databinding(Guidelines on the use of data binding with EMF)
EMF.Edit and Databinding [message #1695838] Tue, 19 May 2015 17:04 Go to next message
Nicholas Petalidis is currently offline Nicholas PetalidisFriend
Messages: 3
Registered: May 2015
Junior Member
I want to bind my UI with my model.
I have a collection of Person (s), each Person being an EMF Object.

I show the details of each person in a table, occasionally adding or removing a person from the collection.

I want to bind my model (which essentially is a list of Person) to my UI (which is just a table with two buttons - add/remove).

I have succeeded doing it, using IObservableList, ObservableListContentProvider and an ObservableMapLabelProvider.

So, I have a WritableList of Person and the content and label provider of the Table is the ObservableListContentProvider and the ObservableMapLabelProvider.
I can add a new Person in the list and the view is automatically updated. I can edit a Person in the table and my list is also automatically updated.

My question is though, is this the correct way of doing it? If yes, what is the purpose of the PersonItemProvider that was generated automatically in EMF.Edit. Can I have the same functionality using the generated code and EList instead of IObservableList, and if yes, how?

Thanks in advance
NP

[Updated on: Wed, 20 May 2015 21:12]

Report message to a moderator

Re: EMF.Edit and Databinding [message #1696008 is a reply to message #1695838] Thu, 21 May 2015 07:00 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
Nicholas,

Comments below.

On 20/05/2015 1:05 PM, Nicholas Petalidis wrote:
> I want to bind my UI with my model. I have a collection of Person (s),
> each Person being an EMF Object.
>
> I show the details of each person in a table, occasionally adding or
> removing a person from the collection.
>
> I want to bind my model (which essentially is a list of Person) to my
> UI (which is just a table with two buttons - add/remove).
>
> I have succeeded doing it, using IObservableList,
> ObservableListContentProvider and an ObservableMapLabelProvider.
> So, I have a WaitingList of Person and the content and label provider
> of the Table is the ObservableListContentProvider and the
> ObservableMapLabelProvider.
> I can add a new Person in the list and the view is automatically
> updated. I can edit a Person in the table and my list is also
> automatically updated.
>
> My question is though, is this the correct way of doing it?
If it works, it can't really be incorrect. :-P
> If yes, what is the purpose of the PersonItemProvider that was
> generated automatically in EMF.Edit.
You could use it instead to induce a tree or table view that updates as
you modify the model..
> Can I have the same functionality using the generated code and EList
> instead of IObservableList, and if yes, how?
If you use org.eclipse.emf.databinding.edit.EMFEditObservables the
changes made to the model will be done using commands and your UI will
have undo support.
>
> Thanks in advance
> NP


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Change process lifetime accordingly to eclipse editor
Next Topic:Xcore workaround for bug 89325???
Goto Forum:
  


Current Time: Fri Apr 19 03:16:32 GMT 2024

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

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

Back to the top