use of com.intellij.util.pico.DefaultPicoContainer in project intellij-community by JetBrains.
the class EditorTypedHandlerBean method getHandler.
public TypedActionHandler getHandler(TypedActionHandler originalHandler) {
if (myHandler == null) {
try {
DefaultPicoContainer container = new DefaultPicoContainer(ApplicationManager.getApplication().getPicoContainer());
container.registerComponentInstance(originalHandler);
myHandler = instantiate(implementationClass, container);
} catch (Exception e) {
LOG.error(e);
return null;
}
}
return myHandler;
}
use of com.intellij.util.pico.DefaultPicoContainer in project intellij-community by JetBrains.
the class EditorActionHandlerBean method getHandler.
public EditorActionHandler getHandler(EditorActionHandler originalHandler) {
if (myHandler == null) {
try {
DefaultPicoContainer container = new DefaultPicoContainer(ApplicationManager.getApplication().getPicoContainer());
container.registerComponentInstance(originalHandler);
myHandler = instantiate(implementationClass, container);
} catch (Exception e) {
LOG.error(e);
return null;
}
}
return myHandler;
}
use of com.intellij.util.pico.DefaultPicoContainer in project android by JetBrains.
the class IdeComponents method doReplaceService.
private static <T> void doReplaceService(@NotNull ComponentManager componentManager, @NotNull Class<T> serviceType, @NotNull T newServiceInstance) {
DefaultPicoContainer picoContainer = (DefaultPicoContainer) componentManager.getPicoContainer();
String componentKey = serviceType.getName();
ComponentAdapter componentAdapter = picoContainer.unregisterComponent(componentKey);
assert componentAdapter != null;
picoContainer.registerComponentInstance(componentKey, newServiceInstance);
assertSame(newServiceInstance, picoContainer.getComponentInstance(componentKey));
}
Aggregations