Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Using the e4 dependency injection implementation outside e4
Using the e4 dependency injection implementation outside e4 [message #507831] Thu, 14 January 2010 15:00 Go to next message
Lars Vogel is currently offline Lars Vogel
Messages: 1048
Registered: July 2009
Senior Member

Hello,

I would like to use the DI implementation of e4 outside of e4 (similar to Google Guice).

Is that possible? If yes, any pointer how to do this?

Best regards, Lars
Re: Using the e4 dependency injection implementation outside e4 [message #508350 is a reply to message #507831] Mon, 18 January 2010 09:05 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Lars Vogel wrote:
> Hello,
>
> I would like to use the DI implementation of e4 outside of e4 (similar
> to Google Guice).
> Is that possible? If yes, any pointer how to do this?

Pointers, probably not :-)

But it should be usable with 3 plugins: org.eclipse.e4.core.services,
org.eclipse.e4.core.services.annotations, and javax.inject

org.eclipse.e4.core.services.context.spi.ContextInjectionFac tory to
inject and make (instantiate and then inject) an object. It also
supports an "invoke" (allows you to call a method with inject
parameters). Then all you need is an IEclipseContext full of values
from org.eclipse.e4.core.services.context.EclipseContextFactory :-)

Later,
PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: Using the e4 dependency injection implementation outside e4 [message #508470 is a reply to message #508350] Mon, 18 January 2010 18:38 Go to previous messageGo to next message
Lars Vogel is currently offline Lars Vogel
Messages: 1048
Registered: July 2009
Senior Member

Thanks for the tips. :-)

On 18.01.2010 06:05, Paul Webster wrote:
> Lars Vogel wrote:
>> Hello,
>>
>> I would like to use the DI implementation of e4 outside of e4 (similar
>> to Google Guice).
>> Is that possible? If yes, any pointer how to do this?
>
> Pointers, probably not :-)
>
> But it should be usable with 3 plugins: org.eclipse.e4.core.services,
> org.eclipse.e4.core.services.annotations, and javax.inject
>
> org.eclipse.e4.core.services.context.spi.ContextInjectionFac tory to
> inject and make (instantiate and then inject) an object. It also
> supports an "invoke" (allows you to call a method with inject
> parameters). Then all you need is an IEclipseContext full of values from
> org.eclipse.e4.core.services.context.EclipseContextFactory :-)
>
> Later,
> PW
>
>
Re: Using the e4 dependency injection implementation outside e4 [message #567673 is a reply to message #507831] Mon, 18 January 2010 09:05 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Lars Vogel wrote:
> Hello,
>
> I would like to use the DI implementation of e4 outside of e4 (similar
> to Google Guice).
> Is that possible? If yes, any pointer how to do this?

Pointers, probably not :-)

But it should be usable with 3 plugins: org.eclipse.e4.core.services,
org.eclipse.e4.core.services.annotations, and javax.inject

org.eclipse.e4.core.services.context.spi.ContextInjectionFac tory to
inject and make (instantiate and then inject) an object. It also
supports an "invoke" (allows you to call a method with inject
parameters). Then all you need is an IEclipseContext full of values
from org.eclipse.e4.core.services.context.EclipseContextFactory :-)

Later,
PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: Using the e4 dependency injection implementation outside e4 [message #567767 is a reply to message #508350] Mon, 18 January 2010 23:12 Go to previous message
Lars Vogel is currently offline Lars Vogel
Messages: 1048
Registered: July 2009
Senior Member

Thanks for the tips. :-)

On 18.01.2010 06:05, Paul Webster wrote:
> Lars Vogel wrote:
>> Hello,
>>
>> I would like to use the DI implementation of e4 outside of e4 (similar
>> to Google Guice).
>> Is that possible? If yes, any pointer how to do this?
>
> Pointers, probably not :-)
>
> But it should be usable with 3 plugins: org.eclipse.e4.core.services,
> org.eclipse.e4.core.services.annotations, and javax.inject
>
> org.eclipse.e4.core.services.context.spi.ContextInjectionFac tory to
> inject and make (instantiate and then inject) an object. It also
> supports an "invoke" (allows you to call a method with inject
> parameters). Then all you need is an IEclipseContext full of values from
> org.eclipse.e4.core.services.context.EclipseContextFactory :-)
>
> Later,
> PW
>
>
Previous Topic:Where is the ShowView-dialog in the e4 photo demo?
Next Topic:How to create a new Part Dynamically
Goto Forum:
  


Current Time: Mon Jul 28 04:20:23 EDT 2014

Powered by FUDForum. Page generated in 0.01701 seconds