diff --git a/platform/core-impl/src/com/intellij/openapi/components/impl/ComponentManagerImpl.java b/platform/core-impl/src/com/intellij/openapi/components/impl/ComponentManagerImpl.java index 0281fc36d661..c40d395f5d42 100644 --- a/platform/core-impl/src/com/intellij/openapi/components/impl/ComponentManagerImpl.java +++ b/platform/core-impl/src/com/intellij/openapi/components/impl/ComponentManagerImpl.java @@ -67,7 +67,7 @@ public abstract class ComponentManagerImpl extends UserDataHolderBase implements private final ComponentManagerConfigurator myConfigurator = new ComponentManagerConfigurator(this); private final ComponentManager myParentComponentManager; private Boolean myHeadless; - private ComponentsRegistry myComponentsRegistry = new ComponentsRegistry(); + protected ComponentsRegistry myComponentsRegistry = new ComponentsRegistry(); private final Condition myDisposedCondition = new Condition() { public boolean value(final Object o) { return isDisposed(); @@ -395,7 +395,7 @@ public abstract class ComponentManagerImpl extends UserDataHolderBase implements return LOG.isDebugEnabled(); } - private class ComponentsRegistry { + protected class ComponentsRegistry { private final Map myInterfaceToLockMap = new HashMap(); private final Map myInterfaceToClassMap = new HashMap(); private final ArrayList myComponentInterfaces = new ArrayList(); // keeps order of component's registration diff --git a/platform/platform-impl/src/com/intellij/ide/plugins/PluginManager.java b/platform/platform-impl/src/com/intellij/ide/plugins/PluginManager.java index f799c3507e3f..5986cb85b4b4 100644 --- a/platform/platform-impl/src/com/intellij/ide/plugins/PluginManager.java +++ b/platform/platform-impl/src/com/intellij/ide/plugins/PluginManager.java @@ -95,7 +95,7 @@ public class PluginManager { public static long startupStart; - public static final float PLUGINS_PROGRESS_MAX_VALUE = 0.8f; + public static final float PLUGINS_PROGRESS_MAX_VALUE = 0.5f; public static class Facade extends PluginsFacade { public IdeaPluginDescriptor getPlugin(PluginId id) { @@ -254,6 +254,7 @@ public class PluginManager { ourId2Index.put(result.get(i).getPluginId(), i); } + int i = 0; for (final IdeaPluginDescriptorImpl pluginDescriptor : result) { if (pluginDescriptor.getPluginId().getIdString().equals(CORE_PLUGIN_ID) || pluginDescriptor.isUseCoreClassLoader()) { pluginDescriptor.setLoader(parentLoader, true); @@ -270,6 +271,7 @@ public class PluginManager { } pluginDescriptor.registerExtensions(); + progress.showProgress("", 0.5f + (i++/(float )result.size()) * 0.25f); } ourPlugins = pluginDescriptors; @@ -548,9 +550,6 @@ public class PluginManager { loadDescriptorsFromProperty(result); - if (!fromSources && progress != null) { - progress.showProgress("Loading core...", PLUGINS_PROGRESS_MAX_VALUE); - } loadDescriptorsFromClassPath(result, fromSources ? progress : null); IdeaPluginDescriptorImpl[] pluginDescriptors = result.toArray(new IdeaPluginDescriptorImpl[result.size()]); diff --git a/platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationImpl.java b/platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationImpl.java index 8dd73bb617c6..712c853cd97f 100644 --- a/platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationImpl.java @@ -380,23 +380,19 @@ public class ApplicationImpl extends ComponentManagerImpl implements Application private void loadApplicationComponents() { PluginManager.initPlugins(mySplash); final IdeaPluginDescriptor[] plugins = PluginManager.getPlugins(); - int pluginCount = 0; - for (IdeaPluginDescriptor plugin : plugins) { - if (!PluginManager.shouldSkipPlugin(plugin)) pluginCount++; - } - int i = 0; for (IdeaPluginDescriptor plugin : plugins) { if (PluginManager.shouldSkipPlugin(plugin)) continue; - if (mySplash != null) { - final float p = (float)++i / pluginCount; - final float progress = p + (1 - p) * PluginManager.PLUGINS_PROGRESS_MAX_VALUE; - mySplash.showProgress(plugin.getName(), progress); - } loadComponentsConfiguration(plugin.getAppComponents(), plugin, false); } + } + + @Override + protected synchronized Object createComponent(Class componentInterface) { + Object component = super.createComponent(componentInterface); if (mySplash != null) { - mySplash.showProgress("Loading project...", 1.0f); + mySplash.showProgress("", (float)(0.75f + myComponentsRegistry.getPercentageOfComponentsLoaded() * 0.25f)); } + return component; } protected MutablePicoContainer createPicoContainer() {