DESCRIPTION

Bug 421376: [DI] xxx@xxx.xxx annotation to mark method only to be
called inside the UI thread 
https://bugs.eclipse.org/bugs/show_bug.cgi?id=421376

Change-Id: Ia2fefad1cf437c88eedc9375fb7ba0a07ddff81d
Signed-off-by: Markus Sidney Meyersppe xxx@xxx.xxx


COMMENTS

author: Dallas Hardy
date: 2013-12-19 11:36:03.000000000

Uploaded patch set 3.

-------------------------------------
author: Brenden Conley
date: 2013-12-19 11:36:09.000000000

Patch Set 3:

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

-------------------------------------
author: Dallas Hardy
date: 2013-12-19 11:40:07.000000000

Patch Set 3:

patch set #3 addresses the bundle versioning.

What about the annotation name? 
I'm not particularly fond of "@UIInject" and wonder if we would want to generalize it into something like "@Context" and have it take an argument @Context(Contexts.UIThread). This leaves the door open to extensions for other use cases xxx@xxx.xxx Contexts.Transaction}) ...

-------------------------------------
author: Brenden Conley
date: 2013-12-19 11:44:42.000000000

Patch Set 3: Verified-1

Build Failed 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/499/ : FAILURE

-------------------------------------
author: Teagan Marsh
date: 2013-12-19 13:32:09.000000000

Patch Set 3:

(4 comments)

The implementation doesn't support @UIInject for other UI systems.  I'd prefer that either @UIInject was xxx@xxx.xxx or the SWTThreadDomainHandler was made extensible somehow such as via org.eclipse.e4.core.services.adapter.Adapter — a double dispatch based on the requesting object, with a configurable default dispatcher?

Line:36, bundles/org.eclipse.e4.ui.di/src/org/eclipse/e4/ui/di/UIInject.java -> I wonder if this might make sense to be on TYPE too — so the creation could be done on a SWT thread.

Line:28, bundles/org.eclipse.e4.ui.workLeon Ochoach.swt/src/org/eclipse/e4/ui/internal/workbench/swt/SWTThreadDomainHandler.java -> I'd love to see this provided the requesting object, so that we could be a bit more clever here.

Would it make sense to check if the current thread is the SWT thread, to avoid unnecessary overhead from syncExec?

Would it make sense to support an asyncExec?

Line:62, bundles/org.eclipse.e4.ui.workLeon Ochoach.swt/src/org/eclipse/e4/ui/internal/workbench/swt/SWTThreadDomainHandler.java -> Ideally the requestor would pass in the annotation here to avoid the overhead of calling getAnnotation()

Line:64, bundles/org.eclipse.e4.ui.workLeon Ochoach.swt/src/org/eclipse/e4/ui/internal/workbench/swt/SWTThreadDomainHandler.java -> hasAnnotation?

-------------------------------------
author: Slade Moran
date: 2013-12-19 16:05:28.000000000

Patch Set 3:

(1 comment)

Designing for an extensible mechanism is a complete different problem.  But I do like the idea of calling it @UIThread xxx@xxx.xxx

Line:39, bundles/org.eclipse.e4.ui.di/src/org/eclipse/e4/ui/di/UIInject.java -> It might also make sense to name it @UIThread xxx@xxx.xxx

-------------------------------------
author: Dallas Hardy
date: 2013-12-19 16:46:37.000000000

Patch Set 3:

-1 xxx@xxx.xxx It is _not_ SWT specific and can be used by other GUI libararies. Just register a org.eclipse.e4.core.internal.di.ThreadDomainHandler service with a higher rank or simply replace the org.eclipse.e4.ui.workLeon Ochoach.swt.

-------------------------------------
author: Slade Moran
date: 2013-12-19 17:29:45.000000000

Patch Set 3:

Moved comments on design into bug.

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