Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341302 - Add Support to observe an element inside a List
Summary: Add Support to observe an element inside a List
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: Edit (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Thomas Schindl CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-29 23:00 EDT by Thomas Schindl CLA
Modified: 2011-05-10 11:57 EDT (History)
4 users (show)

See Also:


Attachments
Patch (13.47 KB, patch)
2011-03-29 23:01 EDT, Thomas Schindl CLA
no flags Details | Diff
Patch (12.42 KB, text/plain)
2011-03-30 20:49 EDT, Thomas Schindl CLA
no flags Details
Patch (18.60 KB, patch)
2011-03-31 18:02 EDT, Thomas Schindl CLA
no flags Details | Diff
Patch (18.78 KB, patch)
2011-04-11 16:26 EDT, Thomas Schindl CLA
no flags Details | Diff
Patch (19.98 KB, patch)
2011-04-15 06:08 EDT, Thomas Schindl CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Schindl CLA 2011-03-29 23:00:00 EDT
It would be nice if one could cross multi-valued features in a master detail scenario. Currently the only possibility is to create an volatile, transient, derived feature.
Comment 1 Thomas Schindl CLA 2011-03-29 23:01:01 EDT
Created attachment 192154 [details]
Patch

Work in Progress ;-)
Comment 2 Thomas Schindl CLA 2011-03-29 23:07:38 EDT
Matt if you have a second you might want to take a look at my work in progress here. I think we could maybe move this feature upwards if you think it is a good idea.
Comment 3 Thomas Schindl CLA 2011-03-30 20:49:35 EDT
Created attachment 192242 [details]
Patch

The first approach was completely bogus stuff and so I've reworked it
Comment 4 Thomas Schindl CLA 2011-03-30 20:52:49 EDT
There are still areas to improve:
a) The diff calculation could be improved currently we fire a change whenever an 
   element is added but this might not make sense
b) I need to see how I can implement MultiList Support
Comment 5 Thomas Schindl CLA 2011-03-31 18:02:55 EDT
Created attachment 192330 [details]
Patch
Comment 6 Ed Merks CLA 2011-04-11 15:30:17 EDT
I think it would be more consistent for IElementAccess to be responsible for both getting and setting the value though I guess the problem there is that you want the editing domain to do the changes.  Perhaps IElementAccess should return the index of the object so you don't have to do an indexOf, which is going to cause a problem if the list has duplicates...
Comment 7 Thomas Schindl CLA 2011-04-11 16:26:50 EDT
Created attachment 192979 [details]
Patch

ok. This patch:
a) Makes IElementAccess return an index
b) Has a 2 argument informing the element access if it is called for a write 
   operation
Comment 8 Thomas Schindl CLA 2011-04-11 16:28:25 EDT
(In reply to comment #6)
> I think it would be more consistent for IElementAccess to be responsible for
> both getting and setting the value though I guess the problem there is that you
> want the editing domain to do the changes.  Perhaps IElementAccess should

Correct. The last patch has a flag which at least informs the write implementor if it is a write operation

> return the index of the object so you don't have to do an indexOf, which is
> going to cause a problem if the list has duplicates...

Good idea. The last patch returns an index.
Comment 9 Thomas Schindl CLA 2011-04-15 06:08:18 EDT
Created attachment 193342 [details]
Patch

This patch adds support for inserting/replacing a current value
Comment 10 Thomas Schindl CLA 2011-04-18 03:27:53 EDT
Ed, can you take a look once more? I think I'm close to releasing this feature
Comment 11 Ed Merks CLA 2011-04-21 11:30:29 EDT
It would be good if the formatting matched...

http://wiki.eclipse.org/EMF/Getting_Source#Configuring_Code_Templates.2C_Code_Formatter.2C_and_Import_Order

New files should include the copyright header with EPL.

Otherwise it looks reasonable.
Comment 12 Thomas Schindl CLA 2011-04-22 03:26:17 EDT
Thanks - I addressed your comments, added JavaDoc a BIG warning that this API is highly experimental and released it to HEAD but i've no idea which target i should have selected.

Do I need to do something special to trigger a build?
Comment 13 Ed Merks CLA 2011-04-22 09:45:17 EDT
Kenn triggers builds manually.
Comment 14 Ed Merks CLA 2011-05-10 11:57:48 EDT
The changes are available in EMF 2.7 M7 or an earlier build.