Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » WindowBuilder databinding with EMFEditObservables
WindowBuilder databinding with EMFEditObservables [message #761904] Wed, 07 December 2011 09:03 Go to next message
Ricky de Klerck is currently offline Ricky de KlerckFriend
Messages: 295
Registered: January 2011
Senior Member
Hi,

Is it allready possible that WindowBuilder makes his bindings as EMFEditObservables. This way I can connect to a EditingDomain. Hope someone can help me.?

Regards
Re: WindowBuilder databinding with EMFEditObservables [message #761921 is a reply to message #761904] Wed, 07 December 2011 09:41 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
Hi,

I would strongly advice against using EMFEditObservables which is going
to be deprecated (I hope with the upcoming release).

All *new* features are added to the EMF(Edit)Properties-API. I know
WindowBuilder does not support the properties stuff I only wanted to
speak out that this is legacy API and though we'll probably won't break
you by removing it's not in our main focus.

Tom

Am 07.12.11 10:04, schrieb Ricky de Klerck:
> Hi,
>
> Is it allready possible that WindowBuilder makes his bindings as
> EMFEditObservables. This way I can connect to a EditingDomain. Hope
> someone can help me.?
>
> Regards
Re: WindowBuilder databinding with EMFEditObservables [message #761929 is a reply to message #761921] Wed, 07 December 2011 09:54 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de KlerckFriend
Messages: 295
Registered: January 2011
Senior Member
So what would you recommend we should do? Manually add all the bindings using EMF (edit) properties?
Re: WindowBuilder databinding with EMFEditObservables [message #761945 is a reply to message #761929] Wed, 07 December 2011 10:31 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
Well because I'm not using GUI-Builders I have no suggestion I can only
tell you which API we are supporting for the future.

The best would be if someone would implement Properties-Support in
WindowBuilder but I think it's not very high on their list (just doing
guess work here) but you should ask at their forum.

Tom

Am 07.12.11 10:54, schrieb Ricky de Klerck:
> So what would you recommend we should do? Manually add all the bindings
> using EMF (edit) properties?
Re: WindowBuilder databinding with EMFEditObservables [message #762085 is a reply to message #761945] Wed, 07 December 2011 14:25 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de KlerckFriend
Messages: 295
Registered: January 2011
Senior Member
Ok, thanks for your reply. I will use EMFEditProperties.

I'm having trouble transforming my tableviewer from EMFObservables to EMFProperties. Below you see my old and new code, but the new code doesn't display any data. The second one (in comment) however displays everything correctly..

		IObservableSet set = listContentProvider.getKnownElements();

		IObservableMap[] map = new IObservableMap [2];
		map[0] = EMFProperties.value(ModelPackage.Literals.PERSON__ID).observeDetail(set);
		map[1] = EMFProperties.value(ModelPackage.Literals.PERSON__NAME).observeDetail(set);

		tableViewer.setLabelProvider(new ObservableMapLabelProvider(map));

		IEMFListProperty personsProp = EMFProperties.list(ModelPackage.Literals.PERSONS__PERSONS);
		tableViewer.setInput(personsProp.observe(persons));

//		IObservableList personsPersonObserveList = EMFObservables.observeList(persons, Literals.PERSONS__PERSONS);
//		tableViewer.setInput(personsPersonObserveList);
Re: WindowBuilder databinding with EMFEditObservables [message #762109 is a reply to message #762085] Wed, 07 December 2011 15:06 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
What value is stored in "persons"? Can you give me a bigger context?

Tom

Am 07.12.11 15:25, schrieb Ricky de Klerck:
> Ok, thanks for your reply. I will use EMFEditProperties.
>
> I'm having trouble transforming my tableviewer from EMFObservables to
> EMFProperties. Below you see my old and new code, but the new code
> doesn't display any data. The second one (in comment) however displays
> everything correctly..
>
>
> IObservableSet set = listContentProvider.getKnownElements();
>
> IObservableMap[] map = new IObservableMap [2];
> map[0] =
> EMFProperties.value(ModelPackage.Literals.PERSON__ID).observeDetail(set);
> map[1] =
> EMFProperties.value(ModelPackage.Literals.PERSON__NAME).observeDetail(set);
>
> tableViewer.setLabelProvider(new ObservableMapLabelProvider(map));
>
> IEMFListProperty personsProp =
> EMFProperties.list(ModelPackage.Literals.PERSONS__PERSONS);
> tableViewer.setInput(personsProp.observe(persons));
>
> // IObservableList personsPersonObserveList =
> EMFObservables.observeList(persons, Literals.PERSONS__PERSONS);
> // tableViewer.setInput(personsPersonObserveList);
>
Re: WindowBuilder databinding with EMFEditObservables [message #762112 is a reply to message #762109] Wed, 07 December 2011 15:10 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de KlerckFriend
Messages: 295
Registered: January 2011
Senior Member
Persons holds a collection of multiple Person objects (feature Literals.PERSONS__PERSONS). When I print out both observablelists, they both hold these objects. But one displays them in the tableviewer and the other one doesn't.
Re: WindowBuilder databinding with EMFEditObservables [message #762140 is a reply to message #762112] Wed, 07 December 2011 15:49 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
So you say:

Collection persons = ...

This would be wrong. Please show me where you populate the "persons"
variable.

Tom

Am 07.12.11 16:10, schrieb Ricky de Klerck:
> Persons holds a collection of multiple Person objects (feature
> Literals.PERSONS__PERSONS). When I print out both observablelists, they
> both hold these objects. But one displays them in the tableviewer and
> the other one doesn't.
Re: WindowBuilder databinding with EMFEditObservables [message #762150 is a reply to message #762140] Wed, 07 December 2011 16:08 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de KlerckFriend
Messages: 295
Registered: January 2011
Senior Member
They are stored in a database.

We have 2 objects in our EMF model:

- Persons (Holds a collection of Person objects)
- Person (name etc)

There is only one Persons object, so we do it like this: Resource.getContents(0), from this object we call the feature. That isn't wrong, right?
Re: WindowBuilder databinding with EMFEditObservables [message #762199 is a reply to message #762150] Wed, 07 December 2011 17:31 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
So how are you reading them, I guess you are using Teneo? If that is the
case you'll have to set an IElementComparer because Teneo lists violate
the default list contract.

See http://www.eclipse.org/forums/index.php/mv/msg/136745/431468/
unfortunately the referenced thread there does not work any more.

Tom

Am 07.12.11 17:08, schrieb Ricky de Klerck:
> They are stored in a database.
>
> We have 2 objects in our EMF model:
>
> - Persons (Holds a collection of Person objects)
> - Person (name etc)
>
> There is only one Persons object, so we do it like this:
> Resource.getContents(0), from this object we call the feature. That
> isn't wrong, right?
Previous Topic:Menu accelerators not always active
Next Topic:How to generate RCP for xxx.diagram.dawn project
Goto Forum:
  


Current Time: Mon Dec 22 18:34:55 GMT 2014

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

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