DESCRIPTION

Bug 489382 - [Databinding] Provide a composite ISideEffect

Change-Id: Ia10cc2baf6f978a3d6a41e3a54338615236a5338
Signed-off-by: Krista Shepherd xxx@xxx.xxx

COMMENTS

author: Krista Shepherd
date: 2016-03-14 02:52:15.000000000

Uploaded patch set 5.

-------------------------------------
author: Brenden Conley
date: 2016-03-14 02:52:22.000000000

Patch Set 5:

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/8617/

-------------------------------------
author: Krista Shepherd
date: 2016-03-14 03:00:58.000000000

Patch Set 5:

(1 comment)

Thank you for the review, Stefan.

Please have a look at the update and my comments in the code about the new package and the one 0-argument method.

Line:37, bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/ISideEffectFactory.java -> This 0-argument version does not provide a way to access the ICompositeSideEffect, so calling method on the ICompositeSideEffect will not be possible. So for me this currently makes no sense.

-------------------------------------
author: Brenden Conley
date: 2016-03-14 03:15:17.000000000

Patch Set 5: Verified+1

Build Successful 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/8617/ : SUCCESS

-------------------------------------
author: Kelly Potter
date: 2016-03-14 05:55:10.000000000

Patch Set 5: Code-Review-1

(4 comments)

Line:44, bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/ICompositeSideEffect.java -> "instance to the composite." should have been "instance from the composite."

Add the text:

This has no effect if the given side-effect is not part of the composite.

Line:26, bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/CompositeSideEffect.java -> Not necessary for this patch, but it might make sense to still attach a Realm to CompositeSideEffect at some point. We could use it for error-checking. If you attempt to insert an ISideEffect belonging to a different realm, it could throw an IllegalArgumentException in the add method. That would also mean we could make this an IObservableList in the future without API breakage.

Line:37, bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/ISideEffectFactory.java -> Oh, I was thinking that the 0-argument version shouldn't create an ICompositeSideEffect at all. You'd use the 0-arg one to obtain an ISideEffectFactory that does exactly the same thing as the static methods on ISideEffect.

I'd suggest calling the default constructor on SideEffectFactory here.

Line:45, bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/swt/WidgetSideEffects.java -> This should first use disposableWidget.getData(ICompositeSideEffect.class.getName()) to check if there is already a composite side effect attached to the widget before it tries to create and attach a new one.

-------------------------------------
author: Kelly Potter
date: 2016-03-14 05:57:46.000000000

Patch Set 5:

For some reason, Gerrit isn't letting me send my remaining drafts.

I like the idea of moving all the ISideEffect-related code to a new package, but this would be a breaking change. We should run it by Danny and Lars before doing this.

-------------------------------------
author: Krista Shepherd
date: 2016-03-14 21:50:59.000000000

Patch Set 5:

(2 comments)

Thanks for the quick replay, Stefan.

Line:26, bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/CompositeSideEffect.java -> In case we add the Realm constructor again afterwards, we won't break API either. The ISideEffect has no getRealm() method like usual observables do. So the check for the realm cannot be done.

Line:45, bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/swt/WidgetSideEffects.java -> Sure that was what I intended to do. Must have been tired due to the EclipseCon jetlag. ;)

-------------------------------------
author: Gerrit Code Review
date: 2016-04-20 22:10:47.000000000

Change has been successfully merged into the git repository by Krista Shepherd

-------------------------------------
