Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF databinding - Observing multiple structural features on Eobject
EMF databinding - Observing multiple structural features on Eobject [message #421911] Mon, 18 August 2008 09:39 Go to next message
Maurice O'Connor is currently offline Maurice O'ConnorFriend
Messages: 86
Registered: July 2009
Member
Hi there,

I have an EObject containing two structural features, which contain
objects of the same type. I would like to observe these two ELists in my
TableViewer via jface EMF databinding.

Is EMFObservables.observeMap the way to to this? I'm about to pursue this
now, so just want to verify that it should actually work, instead of
hammering away at a bad solution!

Something like:

observeMap(myObject, [features to observe])

Your advice would be much appreciated, thanks!

Maurice
Re: EMF databinding - Observing multiple structural features on Eobject [message #421913 is a reply to message #421911] Mon, 18 August 2008 10:01 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Maybe ComputedList could be the solution to this problem though I've
never used it for this kind of thing though so this might not work.


Can you try something like this:

-------8<-------
ComputedList l = new ComputedList() {
IObservableList l1 = /* EMFObservables.....*/null;
IObservableList l2 = /* EMFObservables.....*/null;

@Override
protected java.util.List calculate() {
ArrayList<Object> l = new ArrayList<Object>();
l.addAll(l1);
l.addAll(l2);
return l;
}
};

viewer.setInput(l);
-------8<-------

Tom

Maurice O'Connor schrieb:
> Hi there,
>
> I have an EObject containing two structural features, which contain
> objects of the same type. I would like to observe these two ELists in my
> TableViewer via jface EMF databinding.
>
> Is EMFObservables.observeMap the way to to this? I'm about to pursue
> this now, so just want to verify that it should actually work, instead
> of hammering away at a bad solution!
>
> Something like:
>
> observeMap(myObject, [features to observe])
>
> Your advice would be much appreciated, thanks!
>
> Maurice
>
>
>
>
>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: EMF databinding - Observing multiple structural features on Eobject [message #421915 is a reply to message #421913] Mon, 18 August 2008 10:30 Go to previous message
Maurice O'Connor is currently offline Maurice O'ConnorFriend
Messages: 86
Registered: July 2009
Member
Tom Schindl wrote:

> Maybe ComputedList could be the solution to this problem though I've
> never used it for this kind of thing though so this might not work.

Thanks a mil, this solution worked a treat!

Maurice
Previous Topic:How to create a HashSet with EMF?
Next Topic:Using EMF in Applets
Goto Forum:
  


Current Time: Thu Apr 25 19:50:45 GMT 2024

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

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

Back to the top