Community
Participate
Working Groups
Generally the context hierarchy in DI application who use Eclipse DI is: IEclipseContext (EclipseContextOSGi) + IEclipseContext (the one bound to MApplication) In a multi user env IEclipseContext (EclipseContextOSGi) + IEclipseContext (the one bound to MApplication) + IEclipseContext (the one bound to MApplication) + ... Now one can easily retrieve what I call "ApplicationContext" using context.get(MApplication.class).getContext() which has the draw back that one has to have an dependency on the application model which is totally unnecessary Having access to this information is required to fix bug 458029
+1
gerrit review https://git.eclipse.org/r/40069
The patch simply introduces a constant so one can now write @Inject @Named(IEclipseContext.APPLICATION_CONTEXT_KEY) IEclipseContext context; and one gets the context the application bootstrap code has identified as the the application context. The following review fixes this for SWT e4 application including the Eclipse IDE https://git.eclipse.org/r/40071
(In reply to Thomas Schindl from comment #3) > The patch simply introduces a constant so one can now write > > @Inject > @Named(IEclipseContext.APPLICATION_CONTEXT_KEY) > IEclipseContext context; This probably wouldn't be at the IEclipseContext level, but the E4Application level. PW
If it would be "E4Application" this would work only in an e4 application - I want to have access to this without: a) adding dependency to E4Application b) make use of this in NONE E4Applications where I use Eclipse DI
(In reply to Thomas Schindl from comment #5) > If it would be "E4Application" this would work only in an e4 application - I > want to have access to this without: > a) adding dependency to E4Application > b) make use of this in NONE E4Applications where I use Eclipse DI You can always define the key directly
Tom, are you planning to finish this in M7, or should be more the item to 4.6?
Tom, do you still plan to include that in 4.5? In this case you need to seek PMC approval.
(In reply to Lars Vogel from comment #8) > Tom, do you still plan to include that in 4.5? In this case you need to seek > PMC approval. Having heard anything from Tom on this, so I move it to 4.6
New Gerrit change created: https://git.eclipse.org/r/60788
Gerrit change https://git.eclipse.org/r/60788 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=cf0d80dde17aadf4cbf7b19f39e41b43672d2de6
.