Search in sources :

Example 1 with ComponentConfig

use of com.intellij.openapi.components.ComponentConfig in project intellij-community by JetBrains.

the class ComponentManagerImpl method getComponentConfigs.

@NotNull
private List<ComponentConfig> getComponentConfigs(final ProgressIndicator indicator) {
    ArrayList<ComponentConfig> componentConfigs = new ArrayList<>();
    boolean isDefaultProject = this instanceof Project && ((Project) this).isDefault();
    boolean headless = ApplicationManager.getApplication().isHeadlessEnvironment();
    for (IdeaPluginDescriptor plugin : PluginManagerCore.getPlugins((message, progress) -> indicator.setFraction(progress))) {
        if (PluginManagerCore.shouldSkipPlugin(plugin)) {
            continue;
        }
        ComponentConfig[] configs = getMyComponentConfigsFromDescriptor(plugin);
        componentConfigs.ensureCapacity(componentConfigs.size() + configs.length);
        for (ComponentConfig config : configs) {
            if ((!isDefaultProject || config.isLoadForDefaultProject()) && isComponentSuitable(config.options) && config.prepareClasses(headless)) {
                config.pluginDescriptor = plugin;
                componentConfigs.add(config);
            }
        }
    }
    return componentConfigs;
}
Also used : Project(com.intellij.openapi.project.Project) ComponentConfig(com.intellij.openapi.components.ComponentConfig) ArrayList(java.util.ArrayList) IdeaPluginDescriptor(com.intellij.ide.plugins.IdeaPluginDescriptor) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with ComponentConfig

use of com.intellij.openapi.components.ComponentConfig in project intellij-community by JetBrains.

the class ComponentManagerImpl method init.

protected final void init(@Nullable ProgressIndicator indicator, @Nullable Runnable componentsRegistered) {
    List<ComponentConfig> componentConfigs = getComponentConfigs(indicator);
    for (ComponentConfig config : componentConfigs) {
        registerComponents(config);
    }
    myComponentConfigCount = componentConfigs.size();
    if (componentsRegistered != null) {
        componentsRegistered.run();
    }
    createComponents(indicator);
    myComponentsCreated = true;
}
Also used : ComponentConfig(com.intellij.openapi.components.ComponentConfig)

Aggregations

ComponentConfig (com.intellij.openapi.components.ComponentConfig)2 IdeaPluginDescriptor (com.intellij.ide.plugins.IdeaPluginDescriptor)1 Project (com.intellij.openapi.project.Project)1 ArrayList (java.util.ArrayList)1 NotNull (org.jetbrains.annotations.NotNull)1