Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [EMF Databinding] Need an ObservableMapContentProvider?
[EMF Databinding] Need an ObservableMapContentProvider? [message #514887] Wed, 17 February 2010 00:46 Go to next message
Stephen McCants is currently offline Stephen McCantsFriend
Messages: 92
Registered: July 2009
Member
Hello,
This may not be quite the right place to post this question, but I ran across the problem using
EMFObservables, so I thought I might be able to find some help here. I have a EMap<String, String>
that I wish to show the keys and values in a TableViewer. Since EMap is essentially a List, a
ObservableListContentProvider works great for displaying the entries. It also works very well for
adding and removing entries in the EMap.
However, editing the key or the value is where I've run into problems. I have extended the
ObservableValueEditingSupport class to create an EditingSupport object that allows me to change the
keys and the values. However, these changes are ignored by the ObservableListContentProvider, since
they are changes to the objects inside the list and not to the list itself. The result is that I
click on a value to edit it, make the change and click off of it and I see the original value. The
value is really changed inside the Map, but the ContentProvider ignored the change and didn't update
the TableViewer.
It seems to me, that I what I really need is a ContentProvider that not only observes changes to
the List, but also observes changes to the values inside the List. I've looked but haven't found
such an "ObservableMapContentProvider". Is there something like that? Is there an fairly simple
workaround that hasn't occurred to me?
Thanks for your help!

Sincerely,
Stephen McCants
Re: [EMF Databinding] Need an ObservableMapContentProvider? [message #514888 is a reply to message #514887] Wed, 17 February 2010 00:57 Go to previous message
Stephen McCants is currently offline Stephen McCantsFriend
Messages: 92
Registered: July 2009
Member
Hello,
Actually, I just found the answer I was looking for in Kai Schlamp's 3/2/2009 post.

http://www.eclipse.org/forums/index.php?t=tree&goto=4278 47&#msg_427847

Thanks Kai!

--Stephen McCants

Stephen McCants wrote:
> Hello,
> This may not be quite the right place to post this question, but I
> ran across the problem using EMFObservables, so I thought I might be
> able to find some help here. I have a EMap<String, String> that I wish
> to show the keys and values in a TableViewer. Since EMap is essentially
> a List, a ObservableListContentProvider works great for displaying the
> entries. It also works very well for adding and removing entries in the
> EMap.
> However, editing the key or the value is where I've run into
> problems. I have extended the ObservableValueEditingSupport class to
> create an EditingSupport object that allows me to change the keys and
> the values. However, these changes are ignored by the
> ObservableListContentProvider, since they are changes to the objects
> inside the list and not to the list itself. The result is that I click
> on a value to edit it, make the change and click off of it and I see the
> original value. The value is really changed inside the Map, but the
> ContentProvider ignored the change and didn't update the TableViewer.
> It seems to me, that I what I really need is a ContentProvider that
> not only observes changes to the List, but also observes changes to the
> values inside the List. I've looked but haven't found such an
> "ObservableMapContentProvider". Is there something like that? Is there
> an fairly simple workaround that hasn't occurred to me?
> Thanks for your help!
>
> Sincerely,
> Stephen McCants
Previous Topic:[CDO] CDOTransactionConflictEvent Vs ChangeSubscriptionAdapter
Next Topic:Re: Manually creating persistence.xml or hbm.xml
Goto Forum:
  


Current Time: Fri Apr 26 23:58:06 GMT 2024

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

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

Back to the top