From 9e16569ee28b01315321e339f9e05b6c8644b10b Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Tue, 23 Aug 2011 17:23:45 +0400 Subject: [PATCH] skipForDefaultProject = true by default --- .../ProjectStructureConfigurable.java | 5 +- .../openapi/components/ComponentConfig.java | 4 +- .../impl/ComponentManagerConfigurator.java | 7 ++- .../daemon/impl/EditorTracker.java | 12 +--- .../openapi/roots/impl/DirectoryIndex.java | 2 - .../ChangeListsScopesProvider.java | 3 + .../ide/util/PropertiesComponent.java | 6 +- .../openapi/fileTypes/FileTypeManager.java | 2 +- .../ide/actions/ShowSettingsUtilImpl.java | 9 ++- .../ide/util/AppPropertiesComponentImpl.java | 8 +-- .../util/ProjectPropertiesComponentImpl.java | 14 +---- .../src/META-INF/PlatformExtensions.xml | 5 ++ .../src/META-INF/VcsExtensions.xml | 2 + .../src/componentSets/Lang.xml | 10 ++++ .../src/componentSets/Platform.xml | 13 +--- .../src/componentSets/PlatformComponents.xml | 1 + .../componentSets/PlatformLangComponents.xml | 1 + .../src/componentSets/Profiles.xml | 1 + .../src/componentSets/VCS.xml | 8 +-- .../src/componentSets/Xml.xml | 1 + .../openapi/vcs/VcsConfiguration.java | 32 +--------- .../configurable/VcsManagerConfigurable.java | 8 ++- .../vcs/impl/projectlevelman/AllVcses.java | 1 + .../AndroidDomElementDescriptorProvider.java | 5 +- plugins/copyright/src/META-INF/plugin.xml | 3 +- plugins/git4idea/src/git4idea/GitVcs.java | 11 ++-- .../idea/maven/execution/MavenRunner.java | 9 +-- .../MavenWorkspaceSettingsComponent.java | 10 +--- .../src/main/resources/META-INF/plugin.xml | 12 ++-- .../src/META-INF/SpellCheckerPlugin.xml | 22 ++----- .../state/AggregatedDictionaryState.java | 2 +- plugins/svn4idea/src/META-INF/plugin.xml | 5 +- .../jetbrains/idea/svn/SvnConfiguration.java | 59 +++++++++++-------- .../src/org/jetbrains/idea/svn/SvnVcs.java | 6 +- resources/src/META-INF/IdeaPlugin.xml | 2 + resources/src/componentSets/Compiler.xml | 1 + .../src/componentSets/IdeaComponents.xml | 2 + .../util/xml/impl/DomDescriptorProvider.java | 5 +- .../com/intellij/xml/XmlSchemaProvider.java | 2 +- 39 files changed, 141 insertions(+), 170 deletions(-) diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ProjectStructureConfigurable.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ProjectStructureConfigurable.java index cfaf748cf0ea..7779476f354b 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ProjectStructureConfigurable.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ProjectStructureConfigurable.java @@ -81,7 +81,6 @@ public class ProjectStructureConfigurable extends BaseConfigurable implements Se } private final Project myProject; - private final ModuleManager myModuleManager; private final FacetStructureConfigurable myFacetStructureConfigurable; private final ArtifactsStructureConfigurable myArtifactsStructureConfigurable; @@ -109,13 +108,13 @@ public class ProjectStructureConfigurable extends BaseConfigurable implements Se private final JLabel myEmptySelection = new JLabel("
Select a setting to view or edit its details here
", JLabel.CENTER); - public ProjectStructureConfigurable(final Project project, final ModuleManager moduleManager, final ProjectLibrariesConfigurable projectLibrariesConfigurable, + public ProjectStructureConfigurable(final Project project, + final ProjectLibrariesConfigurable projectLibrariesConfigurable, final GlobalLibrariesConfigurable globalLibrariesConfigurable, final ModuleStructureConfigurable moduleStructureConfigurable, FacetStructureConfigurable facetStructureConfigurable, ArtifactsStructureConfigurable artifactsStructureConfigurable) { myProject = project; - myModuleManager = moduleManager; myFacetStructureConfigurable = facetStructureConfigurable; myArtifactsStructureConfigurable = artifactsStructureConfigurable; diff --git a/platform/core-api/src/com/intellij/openapi/components/ComponentConfig.java b/platform/core-api/src/com/intellij/openapi/components/ComponentConfig.java index b69a9d59b4d7..25f6ae68b913 100644 --- a/platform/core-api/src/com/intellij/openapi/components/ComponentConfig.java +++ b/platform/core-api/src/com/intellij/openapi/components/ComponentConfig.java @@ -37,10 +37,12 @@ public class ComponentConfig { @Tag("headless-implementation-class") public String headlessImplementationClass; - //todo: empty tag means TRUE @Tag(value = "skipForDefaultProject", textIfEmpty="true") public boolean skipForDefaultProject; + @Tag(value = "loadForDefaultProject", textIfEmpty="true") + public boolean loadForDefaultProject; + @Property(surroundWithTag = false) @MapAnnotation(surroundWithTag = false, entryTagName = "option", keyAttributeName = "name", valueAttributeName = "value") public Map options = new HashMap(); diff --git a/platform/core-impl/src/com/intellij/openapi/components/impl/ComponentManagerConfigurator.java b/platform/core-impl/src/com/intellij/openapi/components/impl/ComponentManagerConfigurator.java index 23522e16b531..26960857e9d2 100644 --- a/platform/core-impl/src/com/intellij/openapi/components/impl/ComponentManagerConfigurator.java +++ b/platform/core-impl/src/com/intellij/openapi/components/impl/ComponentManagerConfigurator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,10 @@ class ComponentManagerConfigurator { } private void loadSingleConfig(final boolean defaultProject, final ComponentConfig config, final PluginDescriptor descriptor) { - if (defaultProject && config.skipForDefaultProject) return; + if (defaultProject) { + if (config.skipForDefaultProject || !config.loadForDefaultProject) + return; + } if (!myComponentManager.isComponentSuitable(config.options)) return; myComponentManager.registerComponent(config, descriptor); diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/EditorTracker.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/EditorTracker.java index 8495c587c270..4f8c4e3a78bd 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/EditorTracker.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/EditorTracker.java @@ -29,7 +29,6 @@ import com.intellij.openapi.fileEditor.FileEditorManagerEvent; import com.intellij.openapi.fileEditor.FileEditorManagerListener; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Disposer; -import com.intellij.openapi.wm.ToolWindowManager; import com.intellij.openapi.wm.WindowManager; import com.intellij.openapi.wm.ex.WindowManagerEx; import com.intellij.openapi.wm.impl.IdeFrameImpl; @@ -52,9 +51,6 @@ public class EditorTracker extends AbstractProjectComponent { private final WindowManager myWindowManager; private final EditorFactory myEditorFactory; - @SuppressWarnings({"FieldCanBeLocal", "UnusedDeclaration"}) - private final ToolWindowManager myToolwindowManager; - private final Map> myWindowToEditorsMap = new HashMap>(); private final Map myWindowToWindowFocusListenerMap = new HashMap(); private final Map myEditorToWindowMap = new HashMap(); @@ -65,14 +61,12 @@ public class EditorTracker extends AbstractProjectComponent { private IdeFrameImpl myIdeFrame; private Window myActiveWindow = null; - //todo: - //toolwindow manager is unfortunately needed since - //it actually initializes frame in WindowManager - public EditorTracker(Project project, final WindowManager windowManager, final EditorFactory editorFactory, ToolWindowManager toolwindowManager) { + public EditorTracker(Project project, + final WindowManager windowManager, + final EditorFactory editorFactory) { super(project); myWindowManager = windowManager; myEditorFactory = editorFactory; - myToolwindowManager = toolwindowManager; } public void projectOpened() { diff --git a/platform/lang-impl/src/com/intellij/openapi/roots/impl/DirectoryIndex.java b/platform/lang-impl/src/com/intellij/openapi/roots/impl/DirectoryIndex.java index 9361d90c6279..37207b5d085c 100644 --- a/platform/lang-impl/src/com/intellij/openapi/roots/impl/DirectoryIndex.java +++ b/platform/lang-impl/src/com/intellij/openapi/roots/impl/DirectoryIndex.java @@ -29,8 +29,6 @@ public abstract class DirectoryIndex { return ServiceManager.getService(project, DirectoryIndex.class); } - - @TestOnly public abstract void checkConsistency(); diff --git a/platform/lang-impl/src/com/intellij/packageDependencies/ChangeListsScopesProvider.java b/platform/lang-impl/src/com/intellij/packageDependencies/ChangeListsScopesProvider.java index 1588026db782..b6fdf732590a 100644 --- a/platform/lang-impl/src/com/intellij/packageDependencies/ChangeListsScopesProvider.java +++ b/platform/lang-impl/src/com/intellij/packageDependencies/ChangeListsScopesProvider.java @@ -28,6 +28,7 @@ import org.jetbrains.annotations.NotNull; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.List; /** @@ -47,6 +48,8 @@ public class ChangeListsScopesProvider implements CustomScopesProvider { @NotNull @Override public List getCustomScopes() { + + if (myProject.isDefault()) return Collections.emptyList(); final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject); final List result = new ArrayList(); diff --git a/platform/platform-api/src/com/intellij/ide/util/PropertiesComponent.java b/platform/platform-api/src/com/intellij/ide/util/PropertiesComponent.java index b737d7583ceb..71b70528b4b8 100644 --- a/platform/platform-api/src/com/intellij/ide/util/PropertiesComponent.java +++ b/platform/platform-api/src/com/intellij/ide/util/PropertiesComponent.java @@ -15,7 +15,7 @@ */ package com.intellij.ide.util; -import com.intellij.openapi.application.ApplicationManager; +import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.project.Project; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; @@ -24,11 +24,11 @@ public abstract class PropertiesComponent { public abstract void unsetValue(String name); public static PropertiesComponent getInstance(Project project) { - return project.getComponent(PropertiesComponent.class); + return ServiceManager.getService(project, PropertiesComponent.class); } public static PropertiesComponent getInstance() { - return ApplicationManager.getApplication().getComponent(PropertiesComponent.class); + return ServiceManager.getService(PropertiesComponent.class); } public final boolean isTrueValue(@NonNls String name) { diff --git a/platform/platform-api/src/com/intellij/openapi/fileTypes/FileTypeManager.java b/platform/platform-api/src/com/intellij/openapi/fileTypes/FileTypeManager.java index e5ffd641e1cf..de62986f717e 100644 --- a/platform/platform-api/src/com/intellij/openapi/fileTypes/FileTypeManager.java +++ b/platform/platform-api/src/com/intellij/openapi/fileTypes/FileTypeManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/platform/platform-impl/src/com/intellij/ide/actions/ShowSettingsUtilImpl.java b/platform/platform-impl/src/com/intellij/ide/actions/ShowSettingsUtilImpl.java index b5c530dfc65a..00ab3863f8ed 100644 --- a/platform/platform-impl/src/com/intellij/ide/actions/ShowSettingsUtilImpl.java +++ b/platform/platform-impl/src/com/intellij/ide/actions/ShowSettingsUtilImpl.java @@ -43,7 +43,12 @@ public class ShowSettingsUtilImpl extends ShowSettingsUtil { private static final String PREFER_CLASSIC_OPTIONS_EDITOR = "PREFER_CLASSIC_OPTIONS_EDITOR"; public void showSettingsDialog(Project project, ConfigurableGroup[] group) { - _showSettingsDialog(project, group, null); + try { + _showSettingsDialog(project, group, null); + } + catch (Exception e) { + LOG.error(e); + } } private static void _showSettingsDialog(final Project project, ConfigurableGroup[] group, Configurable toSelect) { @@ -144,7 +149,7 @@ public class ShowSettingsUtilImpl extends ShowSettingsUtil { return ConfigurableExtensionPointUtil.findProjectConfigurable(project, confClass); } - public boolean editConfigurable(Project project, String dimensionServiceKey, Configurable configurable) { + public boolean editConfigurable(Project project, String dimensionServiceKey, @NotNull Configurable configurable) { return editConfigurable(null, project, configurable, dimensionServiceKey, null); } diff --git a/platform/platform-impl/src/com/intellij/ide/util/AppPropertiesComponentImpl.java b/platform/platform-impl/src/com/intellij/ide/util/AppPropertiesComponentImpl.java index d73725ebbb77..b0af8c8d1e30 100644 --- a/platform/platform-impl/src/com/intellij/ide/util/AppPropertiesComponentImpl.java +++ b/platform/platform-impl/src/com/intellij/ide/util/AppPropertiesComponentImpl.java @@ -15,7 +15,6 @@ */ package com.intellij.ide.util; -import com.intellij.openapi.components.ApplicationComponent; import com.intellij.openapi.components.State; import com.intellij.openapi.components.Storage; @@ -23,10 +22,5 @@ import com.intellij.openapi.components.Storage; name = "PropertiesComponent", storages = {@Storage( file = "$APP_CONFIG$/options.xml")}) -public class AppPropertiesComponentImpl extends PropertiesComponentImpl implements ApplicationComponent { - public void disposeComponent() { - } - - public void initComponent() { - } +public class AppPropertiesComponentImpl extends PropertiesComponentImpl { } diff --git a/platform/platform-impl/src/com/intellij/ide/util/ProjectPropertiesComponentImpl.java b/platform/platform-impl/src/com/intellij/ide/util/ProjectPropertiesComponentImpl.java index fcd0fd0baba4..93c62249d299 100644 --- a/platform/platform-impl/src/com/intellij/ide/util/ProjectPropertiesComponentImpl.java +++ b/platform/platform-impl/src/com/intellij/ide/util/ProjectPropertiesComponentImpl.java @@ -15,7 +15,6 @@ */ package com.intellij.ide.util; -import com.intellij.openapi.components.ProjectComponent; import com.intellij.openapi.components.State; import com.intellij.openapi.components.Storage; @@ -23,16 +22,5 @@ import com.intellij.openapi.components.Storage; name = "PropertiesComponent", storages = {@Storage( file = "$WORKSPACE_FILE$")}) -public class ProjectPropertiesComponentImpl extends PropertiesComponentImpl implements ProjectComponent { - public void projectClosed() { - } - - public void projectOpened() { - } - - public void disposeComponent() { - } - - public void initComponent() { - } +public class ProjectPropertiesComponentImpl extends PropertiesComponentImpl { } diff --git a/platform/platform-resources/src/META-INF/PlatformExtensions.xml b/platform/platform-resources/src/META-INF/PlatformExtensions.xml index 528c4a7b0947..d2074e546c40 100644 --- a/platform/platform-resources/src/META-INF/PlatformExtensions.xml +++ b/platform/platform-resources/src/META-INF/PlatformExtensions.xml @@ -2,6 +2,11 @@ + + + diff --git a/platform/platform-resources/src/META-INF/VcsExtensions.xml b/platform/platform-resources/src/META-INF/VcsExtensions.xml index 97da1da5b67b..9e06ff7a51d6 100644 --- a/platform/platform-resources/src/META-INF/VcsExtensions.xml +++ b/platform/platform-resources/src/META-INF/VcsExtensions.xml @@ -8,6 +8,8 @@ serviceImplementation="com.intellij.openapi.vcs.IssueNavigationConfiguration"/> + + diff --git a/platform/platform-resources/src/componentSets/Lang.xml b/platform/platform-resources/src/componentSets/Lang.xml index 24f922d4b908..642d1e402a05 100644 --- a/platform/platform-resources/src/componentSets/Lang.xml +++ b/platform/platform-resources/src/componentSets/Lang.xml @@ -40,24 +40,29 @@ com.intellij.openapi.roots.ProjectRootManager com.intellij.openapi.roots.impl.ProjectRootManagerImpl + com.intellij.openapi.roots.impl.DirectoryIndex com.intellij.openapi.roots.impl.DirectoryIndexImpl + com.intellij.psi.PsiManager com.intellij.psi.impl.PsiManagerImpl + com.intellij.psi.PsiDocumentManager com.intellij.psi.impl.PsiDocumentManagerImpl + com.intellij.openapi.module.ModuleManager com.intellij.openapi.module.impl.ModuleManagerImpl + @@ -87,9 +92,11 @@ com.intellij.pom.tree.TreeAspect com.intellij.pom.tree.TreeAspect + com.intellij.psi.impl.source.PostprocessReformattingAspect + @@ -97,9 +104,11 @@ com.intellij.codeInsight.daemon.DaemonCodeAnalyzer com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl com.intellij.codeInsight.daemon.impl.EditorTracker + com.intellij.codeInsight.daemon.impl.GeneralHighlightingPassFactory @@ -176,6 +185,7 @@ com.intellij.pom.wrappers.PsiEventWrapperAspect com.intellij.pom.wrappers.PsiEventWrapperAspect + diff --git a/platform/platform-resources/src/componentSets/Platform.xml b/platform/platform-resources/src/componentSets/Platform.xml index d6fa9609b4e6..7e6c7a4c621c 100644 --- a/platform/platform-resources/src/componentSets/Platform.xml +++ b/platform/platform-resources/src/componentSets/Platform.xml @@ -5,11 +5,6 @@ com.intellij.openapi.application.impl.ApplicationInfoImpl - - com.intellij.ide.util.PropertiesComponent - com.intellij.ide.util.AppPropertiesComponentImpl - - com.intellij.openapi.fileTypes.FileTypeManager com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl @@ -132,12 +127,6 @@ - - com.intellij.ide.util.PropertiesComponent - com.intellij.ide.util.ProjectPropertiesComponentImpl - - com.intellij.notification.EventLog$ProjectTracker @@ -157,6 +146,7 @@ com.intellij.openapi.vcs.FileStatusManager com.intellij.openapi.vcs.impl.FileStatusManagerImpl + @@ -166,6 +156,7 @@ com.intellij.openapi.vfs.encoding.EncodingProjectManager com.intellij.openapi.vfs.encoding.EncodingProjectManagerImpl + diff --git a/platform/platform-resources/src/componentSets/PlatformComponents.xml b/platform/platform-resources/src/componentSets/PlatformComponents.xml index 51b1d2960dc1..1959b45082d3 100644 --- a/platform/platform-resources/src/componentSets/PlatformComponents.xml +++ b/platform/platform-resources/src/componentSets/PlatformComponents.xml @@ -27,6 +27,7 @@ com.intellij.openapi.components.impl.ServiceManagerImpl + com.intellij.platform.FilesystemToolwindowOpener diff --git a/platform/platform-resources/src/componentSets/PlatformLangComponents.xml b/platform/platform-resources/src/componentSets/PlatformLangComponents.xml index 31eee9d568f8..43a7eb66325b 100644 --- a/platform/platform-resources/src/componentSets/PlatformLangComponents.xml +++ b/platform/platform-resources/src/componentSets/PlatformLangComponents.xml @@ -27,6 +27,7 @@ com.intellij.openapi.components.impl.ServiceManagerImpl + diff --git a/platform/platform-resources/src/componentSets/Profiles.xml b/platform/platform-resources/src/componentSets/Profiles.xml index 538a092fdd86..5508f44fd6c7 100644 --- a/platform/platform-resources/src/componentSets/Profiles.xml +++ b/platform/platform-resources/src/componentSets/Profiles.xml @@ -2,6 +2,7 @@ com.intellij.profile.codeInspection.InspectionProjectProfileManager + \ No newline at end of file diff --git a/platform/platform-resources/src/componentSets/VCS.xml b/platform/platform-resources/src/componentSets/VCS.xml index b6a8aca17735..429bcee9a433 100644 --- a/platform/platform-resources/src/componentSets/VCS.xml +++ b/platform/platform-resources/src/componentSets/VCS.xml @@ -11,14 +11,11 @@ - - com.intellij.openapi.vcs.VcsConfiguration - com.intellij.openapi.vcs.ProjectLevelVcsManager com.intellij.openapi.vcs.impl.ProjectLevelVcsManagerImpl com.intellij.openapi.vcs.changes.VcsChangeDetailsManager @@ -105,9 +102,6 @@ com.intellij.openapi.vcs.impl.VcsBaseContentProvider com.intellij.openapi.vcs.impl.VcsFileStatusProvider - com.intellij.openapi.vcs.contentAnnotation.VcsContentAnnotationSettings - com.intellij.openapi.vcs.contentAnnotation.VcsContentAnnotationSettings - com.intellij.openapi.vcs.contentAnnotation.VcsContentAnnotation com.intellij.openapi.vcs.contentAnnotation.VcsContentAnnotationImpl com.intellij.openapi.vcs.contentAnnotation.ContentAnnotationCache diff --git a/platform/platform-resources/src/componentSets/Xml.xml b/platform/platform-resources/src/componentSets/Xml.xml index df907c584983..09ae81e920f9 100644 --- a/platform/platform-resources/src/componentSets/Xml.xml +++ b/platform/platform-resources/src/componentSets/Xml.xml @@ -7,6 +7,7 @@ com.intellij.pom.xml.XmlAspect com.intellij.pom.xml.impl.XmlAspectImpl + diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/VcsConfiguration.java b/platform/vcs-api/src/com/intellij/openapi/vcs/VcsConfiguration.java index 778b0d251c2a..e77508fa1364 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/VcsConfiguration.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/VcsConfiguration.java @@ -16,9 +16,8 @@ package com.intellij.openapi.vcs; import com.intellij.ide.todo.TodoPanelSettings; -import com.intellij.lifecycle.PeriodicalTasksCloser; import com.intellij.openapi.components.PersistentStateComponent; -import com.intellij.openapi.components.ProjectComponent; +import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.components.State; import com.intellij.openapi.components.Storage; import com.intellij.openapi.diagnostic.Logger; @@ -49,7 +48,7 @@ import java.util.List; ) } ) -public final class VcsConfiguration implements PersistentStateComponent, ProjectComponent { +public final class VcsConfiguration implements PersistentStateComponent { private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.vcs.VcsConfiguration"); @NonNls private static final String VALUE_ATTR = "value"; @@ -144,10 +143,6 @@ public final class VcsConfiguration implements PersistentStateComponent private final PerformInBackgroundOption myCheckoutOption = new CheckoutInBackgroundOption(); private final PerformInBackgroundOption myAddRemoveOption = new AddRemoveInBackgroundOption(); - public static VcsConfiguration createEmptyConfiguration() { - return new VcsConfiguration(); - } - private VcsConfiguration() { } @@ -219,28 +214,7 @@ public final class VcsConfiguration implements PersistentStateComponent } public static VcsConfiguration getInstance(Project project) { - return PeriodicalTasksCloser.getInstance().safeGetComponent(project, VcsConfiguration.class); - } - - public void projectOpened() { - - } - - public void projectClosed() { - - } - - @NotNull - public String getComponentName() { - return "VcsManagerConfiguration"; - } - - public void initComponent() { - - } - - public void disposeComponent() { - + return ServiceManager.getService(project, VcsConfiguration.class); } public void saveCommitMessage(final String comment) { diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/configurable/VcsManagerConfigurable.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/configurable/VcsManagerConfigurable.java index f4ecbb306b61..f631ad0a544a 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/configurable/VcsManagerConfigurable.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/configurable/VcsManagerConfigurable.java @@ -127,12 +127,16 @@ public class VcsManagerConfigurable extends SearchableConfigurable.Parent.Abstra result.add(myGeneralPanel); result.add(new VcsBackgroundOperationsConfigurationPanel(myProject)); - result.add(new IgnoredSettingsPanel(myProject)); + if (!myProject.isDefault()) { + result.add(new IgnoredSettingsPanel(myProject)); + } /*if (!myProject.isDefault()) { result.add(new CacheSettingsPanel(myProject)); }*/ result.add(new IssueNavigationConfigurationPanel(myProject)); - result.add(new ChangelistConflictConfigurable(ChangeListManagerImpl.getInstanceImpl(myProject))); + if (!myProject.isDefault()) { + result.add(new ChangelistConflictConfigurable(ChangeListManagerImpl.getInstanceImpl(myProject))); + } VcsDescriptor[] vcses = ProjectLevelVcsManager.getInstance(myProject).getAllVcss(); if (vcses.length > 0) { diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/projectlevelman/AllVcses.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/projectlevelman/AllVcses.java index 19bf3627f9a8..f357321d9a00 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/projectlevelman/AllVcses.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/projectlevelman/AllVcses.java @@ -94,6 +94,7 @@ public class AllVcses implements AllVcsesI, Disposable { final VcsEP ep = myExtensions.get(name); if (ep != null) { final AbstractVcs vcs1 = ep.getVcs(myProject); + LOG.assertTrue(vcs1 != null, name); addVcs(vcs1); return vcs1; } diff --git a/plugins/android/src/org/jetbrains/android/dom/AndroidDomElementDescriptorProvider.java b/plugins/android/src/org/jetbrains/android/dom/AndroidDomElementDescriptorProvider.java index 28975f1a75fa..4de7996cf4ad 100644 --- a/plugins/android/src/org/jetbrains/android/dom/AndroidDomElementDescriptorProvider.java +++ b/plugins/android/src/org/jetbrains/android/dom/AndroidDomElementDescriptorProvider.java @@ -16,6 +16,7 @@ package org.jetbrains.android.dom; +import com.intellij.openapi.project.Project; import com.intellij.psi.PsiClass; import com.intellij.psi.PsiElement; import com.intellij.psi.impl.source.xml.XmlElementDescriptorProvider; @@ -70,7 +71,9 @@ public class AndroidDomElementDescriptorProvider implements XmlElementDescriptor } public XmlElementDescriptor getDescriptor(XmlTag tag) { - final DomElement domElement = DomManager.getDomManager(tag.getProject()).getDomElement(tag); + Project project = tag.getProject(); + if (project.isDefault()) return null; + final DomElement domElement = DomManager.getDomManager(project).getDomElement(tag); String className = null; if (domElement instanceof LayoutViewElement) { className = AndroidUtils.VIEW_CLASS_NAME; diff --git a/plugins/copyright/src/META-INF/plugin.xml b/plugins/copyright/src/META-INF/plugin.xml index 9c1d6132c02c..37787959da56 100644 --- a/plugins/copyright/src/META-INF/plugin.xml +++ b/plugins/copyright/src/META-INF/plugin.xml @@ -23,7 +23,8 @@ - com.maddyhome.idea.copyright.CopyrightManager + com.maddyhome.idea.copyright.CopyrightManager + diff --git a/plugins/git4idea/src/git4idea/GitVcs.java b/plugins/git4idea/src/git4idea/GitVcs.java index ed077da8cfa8..8cdb3e11ccd6 100644 --- a/plugins/git4idea/src/git4idea/GitVcs.java +++ b/plugins/git4idea/src/git4idea/GitVcs.java @@ -19,6 +19,7 @@ import com.intellij.execution.ui.ConsoleViewContentType; import com.intellij.notification.NotificationGroup; import com.intellij.notification.impl.NotificationsConfiguration; import com.intellij.openapi.application.ApplicationManager; +import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.diff.impl.patch.formove.FilePathComparator; import com.intellij.openapi.editor.markup.TextAttributes; @@ -95,7 +96,7 @@ public class GitVcs extends AbstractVcs { private static final VcsKey ourKey = createKey(NAME); private final ChangeProvider myChangeProvider; - private final CheckinEnvironment myCheckinEnvironment; + private final GitCheckinEnvironment myCheckinEnvironment; private final RollbackEnvironment myRollbackEnvironment; private final GitUpdateEnvironment myUpdateEnvironment; private final GitAnnotationProvider myAnnotationProvider; @@ -137,8 +138,6 @@ public class GitVcs extends AbstractVcs { } public GitVcs(@NotNull Project project, - @NotNull final GitChangeProvider gitChangeProvider, - @NotNull final GitCheckinEnvironment gitCheckinEnvironment, @NotNull final ProjectLevelVcsManager gitVcsManager, @NotNull final GitAnnotationProvider gitAnnotationProvider, @NotNull final GitDiffProvider gitDiffProvider, @@ -149,8 +148,8 @@ public class GitVcs extends AbstractVcs { super(project, NAME); myVcsManager = gitVcsManager; myAppSettings = gitSettings; - myChangeProvider = gitChangeProvider; - myCheckinEnvironment = gitCheckinEnvironment; + myChangeProvider = project.isDefault() ? null : ServiceManager.getService(project, GitChangeProvider.class); + myCheckinEnvironment = project.isDefault() ? null : ServiceManager.getService(project, GitCheckinEnvironment.class); myAnnotationProvider = gitAnnotationProvider; myDiffProvider = gitDiffProvider; myHistoryProvider = gitHistoryProvider; @@ -163,7 +162,7 @@ public class GitVcs extends AbstractVcs { myCommittedChangeListProvider = new GitCommittedChangeListProvider(myProject); myOutgoingChangesProvider = new GitOutgoingChangesProvider(myProject); myTreeDiffProvider = new GitTreeDiffProvider(myProject); - myCommitAndPushExecutor = new GitCommitAndPushExecutor(gitCheckinEnvironment); + myCommitAndPushExecutor = new GitCommitAndPushExecutor(myCheckinEnvironment); myReferenceTracker = new GitReferenceTracker(myProject, this, myReferenceListeners.getMulticaster()); myTaskQueue = new BackgroundTaskQueue(myProject, GitBundle.getString("task.queue.title")); } diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenRunner.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenRunner.java index 094318c880ff..d8372bf7f7c8 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenRunner.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenRunner.java @@ -17,6 +17,7 @@ package org.jetbrains.idea.maven.execution; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.components.PersistentStateComponent; +import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.components.State; import com.intellij.openapi.components.Storage; import com.intellij.openapi.fileEditor.FileDocumentManager; @@ -33,20 +34,20 @@ import org.jetbrains.idea.maven.project.MavenConsoleImpl; import org.jetbrains.idea.maven.project.MavenGeneralSettings; import org.jetbrains.idea.maven.project.MavenProjectsManager; import org.jetbrains.idea.maven.utils.MavenLog; -import org.jetbrains.idea.maven.utils.SimpleProjectComponent; import java.util.List; @State(name = "MavenRunner", storages = {@Storage( file = "$WORKSPACE_FILE$")}) -public class MavenRunner extends SimpleProjectComponent implements PersistentStateComponent { +public class MavenRunner implements PersistentStateComponent { private MavenRunnerSettings mySettings = new MavenRunnerSettings(); + private final Project myProject; public static MavenRunner getInstance(Project project) { - return project.getComponent(MavenRunner.class); + return ServiceManager.getService(project, MavenRunner.class); } public MavenRunner(final Project project) { - super(project); + myProject = project; } public MavenRunnerSettings getSettings() { diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenWorkspaceSettingsComponent.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenWorkspaceSettingsComponent.java index f580cd69bcc5..d5be48998519 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenWorkspaceSettingsComponent.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenWorkspaceSettingsComponent.java @@ -16,21 +16,17 @@ package org.jetbrains.idea.maven.project; import com.intellij.openapi.components.PersistentStateComponent; +import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.components.State; import com.intellij.openapi.components.Storage; import com.intellij.openapi.project.Project; -import org.jetbrains.idea.maven.utils.SimpleProjectComponent; @State(name = "MavenImportPreferences", storages = {@Storage( file = "$WORKSPACE_FILE$")}) -public class MavenWorkspaceSettingsComponent extends SimpleProjectComponent implements PersistentStateComponent { +public class MavenWorkspaceSettingsComponent implements PersistentStateComponent { private MavenWorkspaceSettings mySettings = new MavenWorkspaceSettings(); public static MavenWorkspaceSettingsComponent getInstance(Project project) { - return project.getComponent(MavenWorkspaceSettingsComponent.class); - } - - public MavenWorkspaceSettingsComponent(Project project) { - super(project); + return ServiceManager.getService(project, MavenWorkspaceSettingsComponent.class); } public MavenWorkspaceSettings getState() { diff --git a/plugins/maven/src/main/resources/META-INF/plugin.xml b/plugins/maven/src/main/resources/META-INF/plugin.xml index 525d2c3f96ee..cb0a31872cb3 100644 --- a/plugins/maven/src/main/resources/META-INF/plugin.xml +++ b/plugins/maven/src/main/resources/META-INF/plugin.xml @@ -103,6 +103,9 @@ + + + @@ -112,16 +115,9 @@ - - org.jetbrains.idea.maven.project.MavenWorkspaceSettingsComponent - org.jetbrains.idea.maven.project.MavenProjectsManager - - - org.jetbrains.idea.maven.execution.MavenRunner - org.jetbrains.idea.maven.indices.MavenProjectIndicesManager diff --git a/plugins/spellchecker/src/META-INF/SpellCheckerPlugin.xml b/plugins/spellchecker/src/META-INF/SpellCheckerPlugin.xml index e6fa9b743999..d5fdd13d8d5d 100644 --- a/plugins/spellchecker/src/META-INF/SpellCheckerPlugin.xml +++ b/plugins/spellchecker/src/META-INF/SpellCheckerPlugin.xml @@ -1,22 +1,4 @@ - - - com.intellij.spellchecker.state.CachedDictionaryState - com.intellij.spellchecker.state.CachedDictionaryState - - - - - - com.intellij.spellchecker.state.ProjectDictionaryState - com.intellij.spellchecker.state.ProjectDictionaryState - - - com.intellij.spellchecker.state.AggregatedDictionaryState - com.intellij.spellchecker.state.AggregatedDictionaryState - - - + + + + diff --git a/plugins/spellchecker/src/com/intellij/spellchecker/state/AggregatedDictionaryState.java b/plugins/spellchecker/src/com/intellij/spellchecker/state/AggregatedDictionaryState.java index 4165513c45db..74b73ad7ce45 100644 --- a/plugins/spellchecker/src/com/intellij/spellchecker/state/AggregatedDictionaryState.java +++ b/plugins/spellchecker/src/com/intellij/spellchecker/state/AggregatedDictionaryState.java @@ -60,7 +60,7 @@ public class AggregatedDictionaryState { public void loadState() { assert project != null; - cachedDictionaryState = ServiceManager.getService(project, CachedDictionaryState.class); + cachedDictionaryState = ServiceManager.getService(CachedDictionaryState.class); projectDictionaryState = ServiceManager.getService(project, ProjectDictionaryState.class); currentUser = System.getProperty("user.name"); retrieveDictionaries(); diff --git a/plugins/svn4idea/src/META-INF/plugin.xml b/plugins/svn4idea/src/META-INF/plugin.xml index 6f54b7b0d921..27cc78249ba1 100644 --- a/plugins/svn4idea/src/META-INF/plugin.xml +++ b/plugins/svn4idea/src/META-INF/plugin.xml @@ -10,10 +10,6 @@ org.jetbrains.idea.svn.SvnBundle - - org.jetbrains.idea.svn.SvnConfiguration - org.jetbrains.idea.svn.SvnFileUrlMappingImpl