Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 320171

Summary: [Model] Use real Java-References in the Binding-Model-Elements
Product: [Eclipse Project] e4 Reporter: Thomas Schindl <tom.schindl>
Component: UIAssignee: Paul Webster <pwebster>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bokowski, bsd, emoffatt, pwebster, remy.suen
Version: 0.9   
Target Milestone: 4.1 M6   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 324957, 337558    
Attachments:
Description Flags
Model changes
none
Model changes
none
model patch
none
model patch and update v04
none
simple ide model patch
none
make editor work (at least)
none
Reconciler patch v1
none
Reconciler and tests patch v2
none
Role model and other patches v05 none

Description Thomas Schindl CLA 2010-07-17 12:06:37 EDT
Currently they BindingTable is referencing a BindingContext using an ID. To me it looks like BindingTable is a child of BindingContext and then doesn't need the ID-Reference any more
Comment 1 Thomas Schindl CLA 2010-12-18 04:47:42 EST
Created attachment 185473 [details]
Model changes

Paul, all those String referenceing in the binding system don't look correct. I think we once defined that we should use string references as less as possible.

I think this stem from the fact that we very long had no contribution story for this which has been changed already in 4.0

This model-patch does the following:
a) it makes the BindingTable a child of BindingContext
b) it remove the BindingTable from BindingTableContainer and renamed this one 
   BindingContextContainer
c) modified Bindings to hold a list of BindingContext instead of Strings
Comment 2 Thomas Schindl CLA 2010-12-18 09:47:28 EST
Created attachment 185477 [details]
Model changes

This is less radical - it only replaces the string references through real java references.
Comment 3 Paul Webster CLA 2010-12-18 11:20:34 EST
Changes like this will have to wait until the new year.

PW
Comment 4 Thomas Schindl CLA 2010-12-20 10:40:09 EST
Agreed - if you are ok with such a change I could prepare the e4xmi-editor to work with it.
Comment 5 Thomas Schindl CLA 2011-01-29 09:30:48 EST
Created attachment 187907 [details]
model patch
Comment 6 Paul Webster CLA 2011-02-15 08:43:42 EST
Created attachment 188991 [details]
model patch and update v04

This turns most gets into getContext().getElementId() and the sets into a search for a MBindingContext from the application.getRootContext() list.

Remy, can I get you to look at ModelReconcilerBindingTableTest.java, there are 4 errors there.

Description	Resource	Path	Location	Type
The method getBindingContextId() is undefined for the type MBindingTable	ModelReconcilerBindingTableTest.java	/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/reconciler	line 46	Java Problem

That leaves errors in the ...e4.tools.emf.ui and in simpleide.

PW
Comment 7 Thomas Schindl CLA 2011-02-15 09:43:12 EST
Created attachment 189002 [details]
simple ide model patch
Comment 8 Thomas Schindl CLA 2011-02-15 09:55:05 EST
Created attachment 189004 [details]
make editor work (at least)

This patch makes the editor at least useable for everything beside the new binding story - once we have a running workbench patch (applied) I'll update the editor code which is a bit more work than I can do just now
Comment 9 Remy Suen CLA 2011-02-15 10:47:28 EST
Created attachment 189010 [details]
Reconciler patch v1
Comment 10 Remy Suen CLA 2011-02-15 12:19:50 EST
Created attachment 189019 [details]
Reconciler and tests patch v2
Comment 11 Paul Webster CLA 2011-02-15 13:01:11 EST
Created attachment 189029 [details]
Role model and other patches v05

This patches roles in the other 3 + fixes the e4xmi for contacts and e4 photo demos.

PW
Comment 12 Paul Webster CLA 2011-02-15 13:03:32 EST
Released to HEAD
PW
Comment 13 Thomas Schindl CLA 2011-02-15 16:29:21 EST
I've fixed the ModelEditor to support this new element type. The only bundle still broken is "org.eclipse.e4.ui.workbench.renderers.swt.cocoa"
Comment 14 Brian de Alwis CLA 2011-02-16 18:56:12 EST
Committed fix for CocoaUIHandler
Comment 15 Brian de Alwis CLA 2011-02-16 19:01:22 EST
Oops, I should note that I patched BindingServiceImpl #activateBinding() and #deactivateBinding() to avoid an NPE when attempting to add a binding for a binding table that does not yet exist.  BindingServiceImpl should really create a new table and corresponding model objects, but that was beyond the scope of this fix :-)  Submitted as bug 337384.