use of com.intellij.openapi.extensions.PluginAware in project intellij-community by JetBrains.
the class ExtensionComponentAdapter method getComponentInstance.
@Override
public Object getComponentInstance(final PicoContainer container) throws PicoException, ProcessCanceledException {
if (myComponentInstance == null) {
try {
if (Element.class.equals(getComponentImplementation())) {
myComponentInstance = myExtensionElement;
} else {
Object componentInstance = getDelegate().getComponentInstance(container);
if (myDeserializeInstance) {
try {
XmlSerializer.deserializeInto(componentInstance, myExtensionElement);
} catch (Exception e) {
throw new PicoInitializationException(e);
}
}
myComponentInstance = componentInstance;
}
} catch (ProcessCanceledException e) {
throw e;
} catch (Throwable t) {
PluginId pluginId = myPluginDescriptor != null ? myPluginDescriptor.getPluginId() : null;
throw new PicoPluginExtensionInitializationException(t.getMessage(), t, pluginId);
}
if (myComponentInstance instanceof PluginAware) {
PluginAware pluginAware = (PluginAware) myComponentInstance;
pluginAware.setPluginDescriptor(myPluginDescriptor);
}
}
return myComponentInstance;
}
Aggregations