Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » WindowBuilder databinding with EMFEditObservables
WindowBuilder databinding with EMFEditObservables [message #761904] Wed, 07 December 2011 04:03 Go to next message
Eclipse UserFriend
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 04:41 Go to previous messageGo to next message
Eclipse UserFriend
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 04:54 Go to previous messageGo to next message
Eclipse UserFriend
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 05:31 Go to previous messageGo to next message
Eclipse UserFriend
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 09:25 Go to previous messageGo to next message
Eclipse UserFriend
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 10:06 Go to previous messageGo to next message
Eclipse UserFriend
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 10:10 Go to previous messageGo to next message
Eclipse UserFriend
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 10:49 Go to previous messageGo to next message
Eclipse UserFriend
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 11:08 Go to previous messageGo to next message
Eclipse UserFriend
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 12:31 Go to previous message
Eclipse UserFriend
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: Wed Jul 09 22:47:41 EDT 2025

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

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

Back to the top