dependency injection for menu / AnAction Konstantinos Kougios Created July 24, 2014 21:23 How can I inject a component into an AnAction instance and how does DI work for plugin development?
(I can inject dependencies to Components but not to AnAction)
Dependency injection is unfortunately not supported for AnAction instances. You need to use getComponent() or getService() to get your dependencies.
thanks, but which object has those methods? AnAction doesn't have them and I can't find them
see com.intellij.openapi.components.ServiceManager and Module/Project/Application to obtain Component from corresponding scope
Thanks, found it