Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 263868 - [DataBinding] Self-properties implementations for IValueProperty, IListProperty, ISetProperty, IMapProperty
Summary: [DataBinding] Self-properties implementations for IValueProperty, IListProper...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.5 M6   Edit
Assignee: Matthew Hall CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-05 16:28 EST by Matthew Hall CLA
Modified: 2009-02-06 18:21 EST (History)
2 users (show)

See Also:


Attachments
Patch (13.60 KB, patch)
2009-02-05 18:14 EST, Matthew Hall CLA
no flags Details | Diff
mylyn/context/zip (869 bytes, application/octet-stream)
2009-02-05 18:14 EST, Matthew Hall CLA
no flags Details
Fixed copy-paste errors (13.60 KB, patch)
2009-02-06 18:20 EST, Matthew Hall CLA
no flags Details | Diff
mylyn/context/zip (871 bytes, application/octet-stream)
2009-02-06 18:20 EST, Matthew Hall CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Hall CLA 2009-02-05 16:28:14 EST
Self-properties would make it easy to observe a List as a mutable IObservableList, a Set as an IObservableSet, and a Map as an IObservableMap.  Additionally we could make a self-property IValueProperty for observing an Object as an unmodifiable IObservableValue.

In the former 3 cases, doSet<List|Set|Map> methods would just cast the property source to a List, Set or Map, and apply the diff to it.  In the latter, doSetValue() would be silently ignored.

The doGet<List|Set|Map> methods should clone the source object so that diffs can be computed appropriately (since the observables just cache whatever collection is returned instead of cloning it--otherwise we end up computing an empty diff every time).

Something like this would also satisfy the use case in bug 213848, I think
Comment 1 Matthew Hall CLA 2009-02-05 18:14:48 EST
Created attachment 124903 [details]
Patch
Comment 2 Matthew Hall CLA 2009-02-05 18:14:49 EST
Created attachment 124904 [details]
mylyn/context/zip
Comment 3 Boris Bokowski CLA 2009-02-06 17:20:39 EST
The JavaDoc in Properties.java has copy/paste errors. Otherwise, +1
Comment 4 Matthew Hall CLA 2009-02-06 18:20:36 EST
Created attachment 125021 [details]
Fixed copy-paste errors
Comment 5 Matthew Hall CLA 2009-02-06 18:20:38 EST
Created attachment 125022 [details]
mylyn/context/zip
Comment 6 Matthew Hall CLA 2009-02-06 18:21:21 EST
Released to HEAD > 20090206