Bug 263714 - [DataBinding] IListProperty.lists(IListProperty)
Summary: [DataBinding] IListProperty.lists(IListProperty)
Status: REOPENED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 normal with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Jens Lideström CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks: 258967
  Show dependency tree
 
Reported: 2009-02-04 17:59 EST by Matthew Hall CLA
Modified: 2021-12-30 05:36 EST (History)
10 users (show)

See Also:


Attachments
Unfinished draft (6.21 KB, patch)
2009-02-04 18:32 EST, Matthew Hall CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Hall CLA 2009-02-04 17:59:44 EST
It might be useful to add a method IListProperty.lists(IListProperty) to string together a list of lists into one giant list.

e.g.

IListProperty children = BeanProperties.list("children");
IObservableList grandChildren = children.lists(children).observe(person);
Comment 1 Matthew Hall CLA 2009-02-04 18:01:59 EST
MultiList(IObservableList<IObservableList>) would be a good start..
Comment 2 Matthew Hall CLA 2009-02-04 18:32:40 EST
Created attachment 124740 [details]
Unfinished draft

Need to implement a value property to IObservableList<element> master to IObservableList<IObservableList for element> detail in such a way that when the first list removes/replaces an element that the IObservableList that was removed/replaced is disposed.  Once this is done we can move on to adding the MultiList(IObservableList<IObservableList>) constructor
Comment 3 Matthew Hall CLA 2009-03-08 11:35:17 EDT
Ran out of time for 3.5
Comment 4 John Conlon CLA 2010-02-09 17:19:47 EST
(In reply to comment #0)
> It might be useful to add a method IListProperty.lists(IListProperty) to string
> together a list of lists into one giant list.
> 
> e.g.
> 
> IListProperty children = BeanProperties.list("children");
> IObservableList grandChildren = children.lists(children).observe(person);

Would one be able to observe deeper levels of ancestors?

like: 
IObservableList greatGrandChildren = children.lists(children).lists(children).observe(person);
Comment 5 Matthew Hall CLA 2010-02-09 23:52:56 EST
Yes, that's the general idea.
Comment 6 John Arthorne CLA 2010-04-30 13:35:09 EDT
Removing obsolete target milestone.
Comment 7 Jens Lideström CLA 2019-05-31 06:08:35 EDT
This is something I have been wanting to do every now and then. I have not found a way to do it with the current databinding component.

I will provide an implementation of this relatively shortly, using Matthews code as a starting point.
Comment 8 Eclipse Genie CLA 2019-05-31 17:47:30 EDT
New Gerrit change created: https://git.eclipse.org/r/143157
Comment 9 Eclipse Genie CLA 2019-05-31 17:47:33 EDT
New Gerrit change created: https://git.eclipse.org/r/143156
Comment 10 Eclipse Genie CLA 2019-05-31 17:47:36 EDT
New Gerrit change created: https://git.eclipse.org/r/143155
Comment 11 Jens Lideström CLA 2019-05-31 18:04:22 EDT
The following Gerrit change contains an almost finished implementation of this feature (together with some tests):

https://git.eclipse.org/r/#/c/143157/

Remaining work:

* Think about is there is a better way to dispose nested lists. See:
https://git.eclipse.org/r/#/c/143157/1/bundles/org.eclipse.core.databinding.property/src/org/eclipse/core/databinding/property/list/ListProperty.java@184
* Update staleness tracking.
* Write a few more tests.
* Finish documentation.
Comment 13 Dani Megert CLA 2019-06-13 08:55:07 EDT
(In reply to Eclipse Genie from comment #12)
> Gerrit change https://git.eclipse.org/r/143156 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=ac2f11f0e50fcba8ead9fd4c0cbf4ff3a77e89e8
> 
-1

1. Start new workspace
2. Set 4.12 RC2 as API Baseline
3. Import the org.eclipse.core.databinding.observable
==> API Tools error

Please fix, thanks.
Comment 14 Dani Megert CLA 2019-06-13 08:55:35 EDT
(In reply to Dani Megert from comment #13)
> (In reply to Eclipse Genie from comment #12)
> > Gerrit change https://git.eclipse.org/r/143156 was merged to [master].
> > Commit:
> > http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=ac2f11f0e50fcba8ead9fd4c0cbf4ff3a77e89e8
> > 
> -1
> 
> 1. Start new workspace
> 2. Set 4.12 RC2 as API Baseline
> 3. Import the org.eclipse.core.databinding.observable
> ==> API Tools error
> 
> Please fix, thanks.
Also reported by the official build:
https://download.eclipse.org/eclipse/downloads/drops4/I20190613-0210/apitools/analysis/html/org.eclipse.core.databinding.observable/report.html
Comment 15 Eclipse Genie CLA 2019-06-13 10:16:35 EDT
New Gerrit change created: https://git.eclipse.org/r/143973
Comment 16 Lars Vogel CLA 2019-06-13 12:11:14 EDT
Reported the potential API tooling issue via https://bugs.eclipse.org/bugs/show_bug.cgi?id=548249
Comment 17 Lars Vogel CLA 2019-06-13 15:23:15 EDT
(In reply to Dani Megert from comment #14)
> > Please fix, thanks.

Workaround currently blocked by Danis -1 See https://git.eclipse.org/r/#/c/143973/
Comment 18 Dani Megert CLA 2019-06-14 05:18:24 EDT
(In reply to Lars Vogel from comment #17)
> (In reply to Dani Megert from comment #14)
> > > Please fix, thanks.
> 
> Workaround currently blocked by Danis -1 See
> https://git.eclipse.org/r/#/c/143973/
Please see my comment in the Gerrit and bug 548249 comment 7.
Comment 20 Eclipse Genie CLA 2019-07-30 10:34:21 EDT
New Gerrit change created: https://git.eclipse.org/r/146797
Comment 21 Eclipse Genie CLA 2019-07-30 17:53:40 EDT
New Gerrit change created: https://git.eclipse.org/r/146828
Comment 22 Eclipse Genie CLA 2019-07-31 09:54:30 EDT
New Gerrit change created: https://git.eclipse.org/r/146859
Comment 23 Jens Lideström CLA 2019-07-31 10:11:43 EDT
This change is basically finished. I think this will be a useful addition to the databinding framework. It makes a pretty common task much simpler, prettier and more efficient.

I have not removed the WIP flag yet, because I want to think through the solution for a while, to hopefully catch mistakes or misunderstandings if there are any.

This change is divided into a number of sub-gerrits, where 4. contains the main implementation:

1. Cleanup MultiList (merged): https://git.eclipse.org/r/#/c/143156/
2. Cleanup tests: https://git.eclipse.org/r/#/c/143155/
3. Rename fields in MultiList: https://git.eclipse.org/r/#/c/146859/
4. Add ListProperty#list: https://git.eclipse.org/r/#/c/143157/
5. Add ListProperty#list overloads to Beans databinding: https://git.eclipse.org/r/#/c/146797/

Optional work that remains to do:
* Create a databinding snipped which demonstrates this feature.
* Update EMF databinding with specialised overloads for ListProperty#list (in the same way as for Beans databinding).
Comment 24 Eclipse Genie CLA 2021-07-21 06:18:08 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 25 Jens Lideström CLA 2021-12-30 05:35:49 EST
This feature would still be useful, I some day I hope to finish the implementation. I'm reopening.