On 7-Mar-2013, at 1:54 PM, Wim Jongman wrote:
> If the adapter framework is active in this scenario then it would save even 
> more boilerplate code.
> 
>        @Inject
>        public void someMethod(@Optional @Adapt 
> @Named(IServiceConstants.Active_Selection)  Person person)

Great minds think alike :-)  I said something to that effect on the E4 IRC last 
night:

http://echelog.com/logs/browse/eclipse-e4/1362697200
> [00:41:37] <bsd> It would be cool if the DI injector could use the 
> Adapter/IAdapterManager to do type coercion


It's totally doable as an @Adapt + ExtendedObjectSupplier.  And since the 
IRequestor provides the typing details of the request location, we could even 
do Array <—> Collection remaps and more.

Bug 398728 might present a problem here, if the adapted-to type is already in 
the context.

Brian.

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=398728
_______________________________________________
e4-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/e4-dev

Reply via email to