mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
get rid of InspectionProfileManager — part 1
This commit is contained in:
+2
-2
@@ -19,7 +19,7 @@ import com.intellij.JavaTestUtil;
|
||||
import com.intellij.codeInspection.ex.InspectionProfileImpl;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.JDOMUtil;
|
||||
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
|
||||
import com.intellij.profile.codeInspection.ProjectInspectionProfileManagerImpl;
|
||||
import com.intellij.testFramework.LightIdeaTestCase;
|
||||
import com.intellij.testFramework.PlatformTestUtil;
|
||||
import org.jdom.Element;
|
||||
@@ -46,7 +46,7 @@ public class InspectionProfilesConverterTest extends LightIdeaTestCase {
|
||||
final File projectFile = new File(JavaTestUtil.getJavaTestDataPath() + relativePath + dirName + "/options.ipr");
|
||||
for (Element element : JDOMUtil.load(projectFile).getChildren("component")) {
|
||||
if (Comparing.strEqual(element.getAttributeValue("name"), "InspectionProjectProfileManager")) {
|
||||
final InspectionProjectProfileManager profileManager = InspectionProjectProfileManager.getInstance(getProject());
|
||||
final ProjectInspectionProfileManagerImpl profileManager = ProjectInspectionProfileManagerImpl.getInstanceImpl(getProject());
|
||||
profileManager.loadState(element);
|
||||
|
||||
Element configElement = profileManager.getState();
|
||||
|
||||
+2
-2
@@ -27,7 +27,7 @@ package org.jetbrains.lang.manifest.highlighting;
|
||||
import com.intellij.codeInspection.*;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.profile.codeInspection.InspectionProfileManager;
|
||||
import com.intellij.profile.ApplicationProfileManager;
|
||||
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiElementVisitor;
|
||||
@@ -185,7 +185,7 @@ public class MisspelledHeaderInspection extends LocalInspectionTool {
|
||||
myHeaders.add(myHeaderName);
|
||||
|
||||
InspectionProfile profile = InspectionProjectProfileManager.getInstance(project).getInspectionProfile();
|
||||
InspectionProfileManager.getInstance().fireProfileChanged(profile);
|
||||
ApplicationProfileManager.getInstance().fireProfileChanged(profile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -25,7 +25,7 @@ import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.JDOMUtil;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.profile.ApplicationProfileManager;
|
||||
import com.intellij.profile.codeInspection.InspectionProfileManager;
|
||||
import com.intellij.profile.codeInspection.SeverityProvider;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.JDOMException;
|
||||
@@ -61,9 +61,9 @@ public class InspectionProfileConvertor {
|
||||
@NonNls private static final String DEFAULT_XML = "Default.xml";
|
||||
@NonNls private static final String XML_EXTENSION = ".xml";
|
||||
@NonNls public static final String LEVEL_ATT = "level";
|
||||
private final InspectionProfileManager myManager;
|
||||
private final SeverityProvider myManager;
|
||||
|
||||
public InspectionProfileConvertor(InspectionProfileManager manager) {
|
||||
public InspectionProfileConvertor(@NotNull SeverityProvider manager) {
|
||||
myManager = manager;
|
||||
renameOldDefaultsProfile();
|
||||
}
|
||||
|
||||
+29
-29
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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.
|
||||
@@ -27,7 +27,7 @@ import com.intellij.openapi.editor.colors.EditorColors;
|
||||
import com.intellij.openapi.editor.colors.TextAttributesKey;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.WriteExternalException;
|
||||
import com.intellij.profile.codeInspection.InspectionProfileManager;
|
||||
import com.intellij.profile.ApplicationProfileManager;
|
||||
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jdom.Element;
|
||||
@@ -68,168 +68,168 @@ public interface HighlightInfoType {
|
||||
HighlightSeverity SYMBOL_TYPE_SEVERITY = new HighlightSeverity("SYMBOL_TYPE_SEVERITY", HighlightSeverity.INFORMATION.myVal-2);
|
||||
|
||||
/**
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.LOCAL_VARIABLE or create a language-specific HighlightInfoType.
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.LOCAL_VARIABLE or create a language-specific HighlightInfoType.
|
||||
* The field will be removed in version 17.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Deprecated
|
||||
HighlightInfoType LOCAL_VARIABLE = new HighlightInfoTypeImpl(SYMBOL_TYPE_SEVERITY, CodeInsightColors.LOCAL_VARIABLE_ATTRIBUTES);
|
||||
/**
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.INSTANCE_FIELD or create a language-specific HighlightInfoType.
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.INSTANCE_FIELD or create a language-specific HighlightInfoType.
|
||||
* The field will be removed in version 17.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Deprecated
|
||||
HighlightInfoType INSTANCE_FIELD = new HighlightInfoTypeImpl(SYMBOL_TYPE_SEVERITY, CodeInsightColors.INSTANCE_FIELD_ATTRIBUTES);
|
||||
/**
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.INSTANCE_FINAL_FIELD or create a language-specific HighlightInfoType.
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.INSTANCE_FINAL_FIELD or create a language-specific HighlightInfoType.
|
||||
* The field will be removed in version 17.
|
||||
*/
|
||||
@SuppressWarnings({"deprecation", "unused"})
|
||||
@Deprecated
|
||||
HighlightInfoType INSTANCE_FINAL_FIELD = new HighlightInfoTypeImpl(SYMBOL_TYPE_SEVERITY, CodeInsightColors.INSTANCE_FINAL_FIELD_ATTRIBUTES);
|
||||
/**
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.STATIC_FIELD or create a language-specific HighlightInfoType.
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.STATIC_FIELD or create a language-specific HighlightInfoType.
|
||||
* The field will be removed in version 17.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Deprecated
|
||||
HighlightInfoType STATIC_FIELD = new HighlightInfoTypeImpl(SYMBOL_TYPE_SEVERITY, CodeInsightColors.STATIC_FIELD_ATTRIBUTES);
|
||||
/**
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.STATIC_FINAL_FIELD or create a language-specific HighlightInfoType.
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.STATIC_FINAL_FIELD or create a language-specific HighlightInfoType.
|
||||
* The field will be removed in version 17.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Deprecated
|
||||
HighlightInfoType STATIC_FINAL_FIELD = new HighlightInfoTypeImpl(SYMBOL_TYPE_SEVERITY, CodeInsightColors.STATIC_FINAL_FIELD_ATTRIBUTES);
|
||||
/**
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.PARAMETER or create a language-specific HighlightInfoType.
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.PARAMETER or create a language-specific HighlightInfoType.
|
||||
* The field will be removed in version 17.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Deprecated
|
||||
HighlightInfoType PARAMETER = new HighlightInfoTypeImpl(SYMBOL_TYPE_SEVERITY, CodeInsightColors.PARAMETER_ATTRIBUTES);
|
||||
/**
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.METHOD_CALL or create a language-specific HighlightInfoType.
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.METHOD_CALL or create a language-specific HighlightInfoType.
|
||||
* The field will be removed in version 17.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Deprecated
|
||||
HighlightInfoType METHOD_CALL = new HighlightInfoTypeImpl(SYMBOL_TYPE_SEVERITY, CodeInsightColors.METHOD_CALL_ATTRIBUTES);
|
||||
/**
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.METHOD_DECLARATION or create a language-specific HighlightInfoType.
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.METHOD_DECLARATION or create a language-specific HighlightInfoType.
|
||||
* The field will be removed in version 17.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Deprecated
|
||||
HighlightInfoType METHOD_DECLARATION = new HighlightInfoTypeImpl(SYMBOL_TYPE_SEVERITY, CodeInsightColors.METHOD_DECLARATION_ATTRIBUTES);
|
||||
/**
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.CONSTRUCTOR_CALL or create a language-specific HighlightInfoType.
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.CONSTRUCTOR_CALL or create a language-specific HighlightInfoType.
|
||||
* The field will be removed in version 17.
|
||||
*/
|
||||
@SuppressWarnings({"deprecation", "unused"})
|
||||
@Deprecated
|
||||
HighlightInfoType CONSTRUCTOR_CALL = new HighlightInfoTypeImpl(SYMBOL_TYPE_SEVERITY, CodeInsightColors.CONSTRUCTOR_CALL_ATTRIBUTES);
|
||||
/**
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.CONSTRUCTOR_DECLARATION or create a language-specific HighlightInfoType.
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.CONSTRUCTOR_DECLARATION or create a language-specific HighlightInfoType.
|
||||
* The field will be removed in version 17.
|
||||
*/
|
||||
@SuppressWarnings({"deprecation", "unused"})
|
||||
@Deprecated
|
||||
HighlightInfoType CONSTRUCTOR_DECLARATION = new HighlightInfoTypeImpl(SYMBOL_TYPE_SEVERITY, CodeInsightColors.CONSTRUCTOR_DECLARATION_ATTRIBUTES);
|
||||
/**
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.STATIC_METHOD or create a language-specific HighlightInfoType.
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.STATIC_METHOD or create a language-specific HighlightInfoType.
|
||||
* The field will be removed in version 17.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Deprecated
|
||||
HighlightInfoType STATIC_METHOD = new HighlightInfoTypeImpl(SYMBOL_TYPE_SEVERITY, CodeInsightColors.STATIC_METHOD_ATTRIBUTES);
|
||||
/**
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.ABSTRACT_METHOD or create a language-specific HighlightInfoType.
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.ABSTRACT_METHOD or create a language-specific HighlightInfoType.
|
||||
* The field will be removed in version 17.
|
||||
*/
|
||||
@SuppressWarnings({"deprecation", "unused"})
|
||||
@Deprecated
|
||||
HighlightInfoType ABSTRACT_METHOD = new HighlightInfoTypeImpl(SYMBOL_TYPE_SEVERITY, CodeInsightColors.ABSTRACT_METHOD_ATTRIBUTES);
|
||||
/**
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.INHERITED_METHOD or create a language-specific HighlightInfoType.
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.INHERITED_METHOD or create a language-specific HighlightInfoType.
|
||||
* The field will be removed in version 17.
|
||||
*/
|
||||
@SuppressWarnings({"deprecation", "unused"})
|
||||
@Deprecated
|
||||
HighlightInfoType INHERITED_METHOD = new HighlightInfoTypeImpl(SYMBOL_TYPE_SEVERITY, CodeInsightColors.INHERITED_METHOD_ATTRIBUTES);
|
||||
/**
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.CLASS_NAME or create a language-specific HighlightInfoType.
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.CLASS_NAME or create a language-specific HighlightInfoType.
|
||||
* The field will be removed in version 17.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Deprecated
|
||||
HighlightInfoType CLASS_NAME = new HighlightInfoTypeImpl(SYMBOL_TYPE_SEVERITY, CodeInsightColors.CLASS_NAME_ATTRIBUTES);
|
||||
/**
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.ANONYMOUS_CLASS_NAME or create a language-specific HighlightInfoType.
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.ANONYMOUS_CLASS_NAME or create a language-specific HighlightInfoType.
|
||||
* The field will be removed in version 17.
|
||||
*/
|
||||
@SuppressWarnings({"deprecation", "unused"})
|
||||
@Deprecated
|
||||
HighlightInfoType ANONYMOUS_CLASS_NAME = new HighlightInfoTypeImpl(SYMBOL_TYPE_SEVERITY, CodeInsightColors.ANONYMOUS_CLASS_NAME_ATTRIBUTES);
|
||||
/**
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.INTERFACE_NAME or create a language-specific HighlightInfoType.
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.INTERFACE_NAME or create a language-specific HighlightInfoType.
|
||||
* The field will be removed in version 17.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Deprecated
|
||||
HighlightInfoType INTERFACE_NAME = new HighlightInfoTypeImpl(SYMBOL_TYPE_SEVERITY, CodeInsightColors.INTERFACE_NAME_ATTRIBUTES);
|
||||
/**
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.ENUM_NAME or create a language-specific HighlightInfoType.
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.ENUM_NAME or create a language-specific HighlightInfoType.
|
||||
* The field will be removed in version 17.
|
||||
*/
|
||||
@SuppressWarnings({"deprecation", "unused"})
|
||||
@Deprecated
|
||||
HighlightInfoType ENUM_NAME = new HighlightInfoTypeImpl(SYMBOL_TYPE_SEVERITY, CodeInsightColors.ENUM_NAME_ATTRIBUTES);
|
||||
/**
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.TYPE_PARAMETER_NAME or create a language-specific HighlightInfoType.
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.TYPE_PARAMETER_NAME or create a language-specific HighlightInfoType.
|
||||
* The field will be removed in version 17.
|
||||
*/
|
||||
@SuppressWarnings({"deprecation", "unused"})
|
||||
@Deprecated
|
||||
HighlightInfoType TYPE_PARAMETER_NAME = new HighlightInfoTypeImpl(SYMBOL_TYPE_SEVERITY, CodeInsightColors.TYPE_PARAMETER_NAME_ATTRIBUTES);
|
||||
/**
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.ABSTRACT_CLASS_NAME or create a language-specific HighlightInfoType.
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.ABSTRACT_CLASS_NAME or create a language-specific HighlightInfoType.
|
||||
* The field will be removed in version 17.
|
||||
*/
|
||||
@SuppressWarnings({"deprecation", "unused"})
|
||||
@Deprecated
|
||||
HighlightInfoType ABSTRACT_CLASS_NAME = new HighlightInfoTypeImpl(SYMBOL_TYPE_SEVERITY, CodeInsightColors.ABSTRACT_CLASS_NAME_ATTRIBUTES);
|
||||
/**
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.ANNOTATION_NAME or create a language-specific HighlightInfoType.
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.ANNOTATION_NAME or create a language-specific HighlightInfoType.
|
||||
* The field will be removed in version 17.
|
||||
*/
|
||||
@SuppressWarnings({"deprecation", "unused"})
|
||||
@Deprecated
|
||||
HighlightInfoType ANNOTATION_NAME = new HighlightInfoTypeImpl(SYMBOL_TYPE_SEVERITY, CodeInsightColors.ANNOTATION_NAME_ATTRIBUTES);
|
||||
/**
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.ANNOTATION_ATTRIBUTE_NAME or create a language-specific HighlightInfoType.
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.ANNOTATION_ATTRIBUTE_NAME or create a language-specific HighlightInfoType.
|
||||
* The field will be removed in version 17.
|
||||
*/
|
||||
@SuppressWarnings({"deprecation", "unused"})
|
||||
@Deprecated
|
||||
HighlightInfoType ANNOTATION_ATTRIBUTE_NAME = new HighlightInfoTypeImpl(SYMBOL_TYPE_SEVERITY, CodeInsightColors.ANNOTATION_ATTRIBUTE_NAME_ATTRIBUTES);
|
||||
/**
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.REASSIGNED_LOCAL_VARIABLE or create a language-specific HighlightInfoType.
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.REASSIGNED_LOCAL_VARIABLE or create a language-specific HighlightInfoType.
|
||||
* The field will be removed in version 17.
|
||||
*/
|
||||
@SuppressWarnings({"deprecation", "unused"})
|
||||
@Deprecated
|
||||
HighlightInfoType REASSIGNED_LOCAL_VARIABLE = new HighlightInfoTypeImpl(SYMBOL_TYPE_SEVERITY, CodeInsightColors.REASSIGNED_LOCAL_VARIABLE_ATTRIBUTES);
|
||||
/**
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.REASSIGNED_PARAMETER or create a language-specific HighlightInfoType.
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.REASSIGNED_PARAMETER or create a language-specific HighlightInfoType.
|
||||
* The field will be removed in version 17.
|
||||
*/
|
||||
@SuppressWarnings({"deprecation", "unused"})
|
||||
@Deprecated
|
||||
HighlightInfoType REASSIGNED_PARAMETER = new HighlightInfoTypeImpl(SYMBOL_TYPE_SEVERITY, CodeInsightColors.REASSIGNED_PARAMETER_ATTRIBUTES);
|
||||
/**
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.IMPLICIT_ANONYMOUS_CLASS_PARAMETER or create a language-specific HighlightInfoType.
|
||||
* @deprecated For Java use JavaHighlightInfoTypes.IMPLICIT_ANONYMOUS_CLASS_PARAMETER or create a language-specific HighlightInfoType.
|
||||
* The field will be removed in version 17.
|
||||
*/
|
||||
@SuppressWarnings({"deprecation", "unused"})
|
||||
@@ -266,7 +266,7 @@ public interface HighlightInfoType {
|
||||
public HighlightInfoTypeImpl(@NotNull HighlightSeverity severity, TextAttributesKey attributesKey) {
|
||||
this(severity, attributesKey, true);
|
||||
}
|
||||
|
||||
|
||||
public HighlightInfoTypeImpl(@NotNull HighlightSeverity severity, TextAttributesKey attributesKey, boolean needsUpdateOnTyping) {
|
||||
mySeverity = severity;
|
||||
myAttributesKey = attributesKey;
|
||||
@@ -341,7 +341,7 @@ public interface HighlightInfoType {
|
||||
@NotNull
|
||||
public HighlightSeverity getSeverity(final PsiElement psiElement) {
|
||||
InspectionProfile profile = psiElement == null
|
||||
? (InspectionProfile)InspectionProfileManager.getInstance().getRootProfile()
|
||||
? (InspectionProfile)ApplicationProfileManager.getInstance().getRootProfile()
|
||||
: InspectionProjectProfileManager.getInstance(psiElement.getProject()).getInspectionProfile();
|
||||
HighlightDisplayLevel level = profile.getErrorLevel(myToolKey, psiElement);
|
||||
LOG.assertTrue(level != HighlightDisplayLevel.DO_NOT_SHOW);
|
||||
@@ -363,7 +363,7 @@ public interface HighlightInfoType {
|
||||
return myToolKey;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
interface Iconable {
|
||||
Icon getIcon();
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ package com.intellij.codeInspection;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.profile.codeInspection.InspectionProfileManager;
|
||||
import com.intellij.profile.ApplicationProfileManager;
|
||||
import com.intellij.profile.codeInspection.ProjectInspectionProfileManagerImpl;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
@@ -177,7 +177,7 @@ public abstract class InspectionManagerBase extends InspectionManager {
|
||||
if (myCurrentProfileName == null) {
|
||||
myCurrentProfileName = ProjectInspectionProfileManagerImpl.getInstanceImpl(getProject()).getProjectProfile();
|
||||
if (myCurrentProfileName == null) {
|
||||
myCurrentProfileName = InspectionProfileManager.getInstance().getRootProfile().getName();
|
||||
myCurrentProfileName = ApplicationProfileManager.getInstance().getRootProfile().getName();
|
||||
}
|
||||
}
|
||||
return myCurrentProfileName;
|
||||
|
||||
+2
-2
@@ -33,8 +33,8 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Computable;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.UserDataHolderBase;
|
||||
import com.intellij.profile.ApplicationProfileManager;
|
||||
import com.intellij.profile.Profile;
|
||||
import com.intellij.profile.codeInspection.InspectionProfileManager;
|
||||
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.search.LocalSearchScope;
|
||||
@@ -113,7 +113,7 @@ public class GlobalInspectionContextBase extends UserDataHolderBase implements G
|
||||
final InspectionProjectProfileManager inspectionProfileManager = InspectionProjectProfileManager.getInstance(myProject);
|
||||
Profile profile = inspectionProfileManager.getProfile(currentProfile, false);
|
||||
if (profile == null) {
|
||||
profile = InspectionProfileManager.getInstance().getProfile(currentProfile);
|
||||
profile = ApplicationProfileManager.getInstance().getProfile(currentProfile);
|
||||
if (profile != null) return (InspectionProfile)profile;
|
||||
|
||||
final String[] availableProfileNames = inspectionProfileManager.getAvailableProfileNames();
|
||||
|
||||
+7
-7
@@ -32,9 +32,9 @@ import com.intellij.openapi.options.ExternalizableScheme;
|
||||
import com.intellij.openapi.progress.ProcessCanceledException;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.*;
|
||||
import com.intellij.profile.ApplicationProfileManager;
|
||||
import com.intellij.profile.ProfileEx;
|
||||
import com.intellij.profile.ProfileManager;
|
||||
import com.intellij.profile.codeInspection.InspectionProfileManager;
|
||||
import com.intellij.profile.codeInspection.ProjectInspectionProfileManagerImplKt;
|
||||
import com.intellij.profile.codeInspection.SeverityProvider;
|
||||
import com.intellij.psi.PsiElement;
|
||||
@@ -110,7 +110,7 @@ public class InspectionProfileImpl extends ProfileEx implements ModifiableModel,
|
||||
}
|
||||
|
||||
public InspectionProfileImpl(@NotNull @NonNls String profileName) {
|
||||
this(profileName, InspectionToolRegistrar.getInstance(), InspectionProfileManager.getInstance(), null, null);
|
||||
this(profileName, InspectionToolRegistrar.getInstance(), ApplicationProfileManager.getInstance(), null, null);
|
||||
}
|
||||
|
||||
public InspectionProfileImpl(@NotNull String profileName,
|
||||
@@ -148,7 +148,7 @@ public class InspectionProfileImpl extends ProfileEx implements ModifiableModel,
|
||||
return Arrays.asList(toolWrappers);
|
||||
}
|
||||
};
|
||||
final InspectionProfileImpl profile = new InspectionProfileImpl(name, registrar, InspectionProfileManager.getInstance());
|
||||
final InspectionProfileImpl profile = new InspectionProfileImpl(name, registrar, ApplicationProfileManager.getInstance());
|
||||
initAndDo((Computable)() -> {
|
||||
profile.initInspectionTools(project);
|
||||
return null;
|
||||
@@ -454,8 +454,8 @@ public class InspectionProfileImpl extends ProfileEx implements ModifiableModel,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save() throws IOException {
|
||||
InspectionProfileManager.getInstance().fireProfileChanged(this);
|
||||
public void save() {
|
||||
ApplicationProfileManager.getInstance().fireProfileChanged(this);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -480,7 +480,7 @@ public class InspectionProfileImpl extends ProfileEx implements ModifiableModel,
|
||||
for (ScopeToolState toolState : getAllTools(null)) {
|
||||
toolState.scopesChanged();
|
||||
}
|
||||
InspectionProfileManager.getInstance().fireProfileChanged(this);
|
||||
ApplicationProfileManager.getInstance().fireProfileChanged(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -818,7 +818,7 @@ public class InspectionProfileImpl extends ProfileEx implements ModifiableModel,
|
||||
myTools = model.myTools;
|
||||
myProfileManager = model.getProfileManager();
|
||||
|
||||
InspectionProfileManager.getInstance().fireProfileChanged(model);
|
||||
ApplicationProfileManager.getInstance().fireProfileChanged(model);
|
||||
}
|
||||
|
||||
@Tag
|
||||
|
||||
+11
-5
@@ -15,24 +15,30 @@
|
||||
*/
|
||||
package com.intellij.profile;
|
||||
|
||||
import com.intellij.openapi.components.ServiceManager;
|
||||
import com.intellij.profile.codeInspection.SeverityProvider;
|
||||
import com.intellij.psi.search.scope.packageSet.NamedScope;
|
||||
import com.intellij.psi.search.scope.packageSet.NamedScopesHolder;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* User: anna
|
||||
* Date: 29-Nov-2005
|
||||
*/
|
||||
public interface ApplicationProfileManager extends ProfileManager {
|
||||
public interface ApplicationProfileManager extends ProfileManager, SeverityProvider {
|
||||
String INSPECTION_DIR = "inspection";
|
||||
|
||||
@NotNull
|
||||
static ApplicationProfileManager getInstance() {
|
||||
return ServiceManager.getService(ApplicationProfileManager.class);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@SuppressWarnings("unused")
|
||||
Profile createProfile();
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
void addProfileChangeListener(@NotNull ProfileChangeAdapter listener);
|
||||
|
||||
@Deprecated
|
||||
@SuppressWarnings("unused")
|
||||
void removeProfileChangeListener(@NotNull ProfileChangeAdapter listener);
|
||||
|
||||
void fireProfileChanged(Profile profile);
|
||||
+3
-15
@@ -15,22 +15,10 @@
|
||||
*/
|
||||
package com.intellij.profile.codeInspection;
|
||||
|
||||
import com.intellij.openapi.components.ServiceManager;
|
||||
import com.intellij.profile.ApplicationProfileManager;
|
||||
import com.intellij.profile.Profile;
|
||||
import org.jdom.JDOMException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* User: anna
|
||||
* Date: 29-Nov-2005
|
||||
*/
|
||||
public interface InspectionProfileManager extends SeverityProvider, ApplicationProfileManager {
|
||||
public interface InspectionProfileManager extends ApplicationProfileManager {
|
||||
static InspectionProfileManager getInstance() {
|
||||
return ServiceManager.getService(InspectionProfileManager.class);
|
||||
return (InspectionProfileManager)ApplicationProfileManager.getInstance();
|
||||
}
|
||||
|
||||
Profile loadProfile(@NotNull String path) throws IOException, JDOMException;
|
||||
}
|
||||
}
|
||||
+2
-9
@@ -16,21 +16,18 @@
|
||||
package com.intellij.profile.codeInspection;
|
||||
|
||||
import com.intellij.codeInspection.InspectionProfile;
|
||||
import com.intellij.openapi.components.PersistentStateComponent;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.profile.Profile;
|
||||
import com.intellij.profile.ProfileManager;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jdom.Element;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* User: anna
|
||||
* Date: 30-Nov-2005
|
||||
*/
|
||||
public interface InspectionProjectProfileManager extends ProfileManager, SeverityProvider, PersistentStateComponent<Element> {
|
||||
static InspectionProjectProfileManager getInstance(Project project){
|
||||
public interface InspectionProjectProfileManager extends ProfileManager, SeverityProvider {
|
||||
static InspectionProjectProfileManager getInstance(@NotNull Project project){
|
||||
return project.getComponent(InspectionProjectProfileManager.class);
|
||||
}
|
||||
|
||||
@@ -55,12 +52,8 @@ public interface InspectionProjectProfileManager extends ProfileManager, Severit
|
||||
|
||||
boolean isProfileLoaded();
|
||||
|
||||
void initProfileWrapper(@NotNull Profile profile);
|
||||
|
||||
@Override
|
||||
default Profile getProfile(@NotNull final String name) {
|
||||
return getProfile(name, true);
|
||||
}
|
||||
|
||||
void setProjectProfile(@Nullable String projectProfile);
|
||||
}
|
||||
|
||||
+4
-5
@@ -32,7 +32,6 @@ import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.project.ProjectManager
|
||||
import com.intellij.openapi.project.ProjectManagerListener
|
||||
import com.intellij.openapi.startup.StartupActivity
|
||||
import com.intellij.openapi.util.Comparing
|
||||
import com.intellij.openapi.util.Disposer
|
||||
import com.intellij.packageDependencies.DependencyValidationManager
|
||||
import com.intellij.profile.Profile
|
||||
@@ -188,7 +187,7 @@ class ProjectInspectionProfileManagerImpl(private val project: Project,
|
||||
}
|
||||
}
|
||||
|
||||
override fun initProfileWrapper(profile: Profile) {
|
||||
fun initProfileWrapper(profile: Profile) {
|
||||
val wrapper = InspectionProfileWrapper(profile as InspectionProfile)
|
||||
if (profile is InspectionProfileImpl) {
|
||||
profile.initInspectionTools(project)
|
||||
@@ -287,8 +286,8 @@ class ProjectInspectionProfileManagerImpl(private val project: Project,
|
||||
val projectProfile: String?
|
||||
get() = state.projectProfile
|
||||
|
||||
@Synchronized override fun setProjectProfile(newProfile: String?) {
|
||||
if (Comparing.strEqual(newProfile, state.projectProfile)) {
|
||||
@Synchronized fun setProjectProfile(newProfile: String?) {
|
||||
if (newProfile == state.projectProfile) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -336,7 +335,7 @@ class ProjectInspectionProfileManagerImpl(private val project: Project,
|
||||
}
|
||||
}
|
||||
|
||||
@Synchronized override fun getProfile(name: String, returnRootProfileIfNamedIsAbsent: Boolean): Profile {
|
||||
@Synchronized override fun getProfile(name: String, returnRootProfileIfNamedIsAbsent: Boolean): Profile? {
|
||||
val profile = profiles.get(name)
|
||||
return profile ?: applicationProfileManager.getProfile(name, returnRootProfileIfNamedIsAbsent)
|
||||
}
|
||||
|
||||
+4
-5
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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.
|
||||
@@ -21,8 +21,7 @@ import com.intellij.codeInspection.ex.InspectionToolWrapper;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.options.ShowSettingsUtil;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.profile.codeInspection.InspectionProfileManager;
|
||||
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
|
||||
import com.intellij.profile.codeInspection.ProjectInspectionProfileManagerImpl;
|
||||
import com.intellij.profile.codeInspection.ui.ProjectInspectionToolsConfigurable;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
@@ -54,9 +53,9 @@ class EditCleanupProfileIntentionAction implements IntentionAction {
|
||||
|
||||
@Override
|
||||
public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
|
||||
final InspectionProjectProfileManager profileManager = InspectionProjectProfileManager.getInstance(project);
|
||||
final ProjectInspectionProfileManagerImpl profileManager = ProjectInspectionProfileManagerImpl.getInstanceImpl(project);
|
||||
final ProjectInspectionToolsConfigurable configurable =
|
||||
new ProjectInspectionToolsConfigurable(InspectionProfileManager.getInstance(), profileManager) {
|
||||
new ProjectInspectionToolsConfigurable(profileManager) {
|
||||
@Override
|
||||
protected boolean acceptTool(InspectionToolWrapper entry) {
|
||||
return super.acceptTool(entry) && entry.isCleanupTool();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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.
|
||||
@@ -13,7 +13,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.intellij.codeInspection;
|
||||
|
||||
import com.intellij.analysis.AnalysisScope;
|
||||
@@ -37,7 +36,6 @@ import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.VirtualFileManager;
|
||||
import com.intellij.profile.Profile;
|
||||
import com.intellij.profile.codeInspection.InspectionProfileManager;
|
||||
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
|
||||
import com.intellij.psi.PsiDirectory;
|
||||
import com.intellij.psi.PsiManager;
|
||||
@@ -101,7 +99,7 @@ public class InspectionApplication {
|
||||
application.doNotSave();
|
||||
logMessageLn(1, InspectionsBundle.message("inspection.done"));
|
||||
|
||||
InspectionApplication.this.run();
|
||||
this.run();
|
||||
}
|
||||
catch (Exception e) {
|
||||
LOG.error(e);
|
||||
@@ -163,7 +161,7 @@ public class InspectionApplication {
|
||||
if (mySourceDirectory == null) {
|
||||
final String scopeName = System.getProperty("idea.analyze.scope");
|
||||
final NamedScope namedScope = scopeName != null ? NamedScopesHolder.getScope(myProject, scopeName) : null;
|
||||
scope = namedScope != null ? new AnalysisScope(GlobalSearchScopesCore.filterScope(myProject, namedScope), myProject)
|
||||
scope = namedScope != null ? new AnalysisScope(GlobalSearchScopesCore.filterScope(myProject, namedScope), myProject)
|
||||
: new AnalysisScope(myProject);
|
||||
}
|
||||
else {
|
||||
@@ -347,7 +345,7 @@ public class InspectionApplication {
|
||||
|
||||
@Nullable
|
||||
private Profile loadProfileByPath(final String profilePath) throws IOException, JDOMException {
|
||||
Profile inspectionProfile = InspectionProfileManager.getInstance().loadProfile(profilePath);
|
||||
Profile inspectionProfile = ApplicationInspectionProfileManagerImpl.getInstanceImpl().loadProfile(profilePath);
|
||||
if (inspectionProfile != null) {
|
||||
logMessageLn(1, "Loaded profile \'" + inspectionProfile.getName() + "\' from file \'" + profilePath + "\'");
|
||||
}
|
||||
@@ -377,7 +375,7 @@ public class InspectionApplication {
|
||||
|
||||
|
||||
@Nullable
|
||||
private InspectionsReportConverter getReportConverter(@Nullable final String outputFormat) {
|
||||
private static InspectionsReportConverter getReportConverter(@Nullable final String outputFormat) {
|
||||
for (InspectionsReportConverter converter : InspectionsReportConverter.EP_NAME.getExtensions()) {
|
||||
if (converter.getFormatName().equals(outputFormat)) {
|
||||
return converter;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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.
|
||||
@@ -13,7 +13,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.intellij.codeInspection.actions;
|
||||
|
||||
import com.intellij.analysis.AnalysisScope;
|
||||
@@ -22,8 +21,8 @@ import com.intellij.codeInspection.InspectionProfile;
|
||||
import com.intellij.codeInspection.ex.GlobalInspectionContextBase;
|
||||
import com.intellij.codeInspection.ex.InspectionToolWrapper;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.profile.codeInspection.InspectionProfileManager;
|
||||
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
|
||||
import com.intellij.profile.codeInspection.ProjectInspectionProfileManagerImpl;
|
||||
import com.intellij.profile.codeInspection.ui.header.InspectionToolsConfigurable;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -50,10 +49,8 @@ public class CodeCleanupAction extends CodeInspectionAction {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected InspectionToolsConfigurable createConfigurable(InspectionProjectProfileManager projectProfileManager,
|
||||
InspectionProfileManager profileManager,
|
||||
JComboBox profilesCombo) {
|
||||
return new ExternalProfilesComboboxAwareInspectionToolsConfigurable(projectProfileManager, profileManager, profilesCombo) {
|
||||
protected InspectionToolsConfigurable createConfigurable(ProjectInspectionProfileManagerImpl projectProfileManager, JComboBox profilesCombo) {
|
||||
return new ExternalProfilesComboboxAwareInspectionToolsConfigurable(projectProfileManager, profilesCombo) {
|
||||
@Override
|
||||
protected boolean acceptTool(InspectionToolWrapper entry) {
|
||||
return super.acceptTool(entry) && entry.isCleanupTool();
|
||||
|
||||
+11
-15
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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.
|
||||
@@ -29,10 +29,11 @@ import com.intellij.icons.AllIcons;
|
||||
import com.intellij.openapi.fileEditor.FileDocumentManager;
|
||||
import com.intellij.openapi.options.ex.SingleConfigurableEditor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.profile.ApplicationProfileManager;
|
||||
import com.intellij.profile.Profile;
|
||||
import com.intellij.profile.ProfileManager;
|
||||
import com.intellij.profile.codeInspection.InspectionProfileManager;
|
||||
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
|
||||
import com.intellij.profile.codeInspection.ProjectInspectionProfileManagerImpl;
|
||||
import com.intellij.profile.codeInspection.ui.ErrorsConfigurable;
|
||||
import com.intellij.profile.codeInspection.ui.header.InspectionToolsConfigurable;
|
||||
import com.intellij.ui.ComboboxWithBrowseButton;
|
||||
@@ -113,13 +114,13 @@ public class CodeInspectionAction extends BaseAnalysisAction {
|
||||
}
|
||||
}
|
||||
});
|
||||
final InspectionProfileManager profileManager = InspectionProfileManager.getInstance();
|
||||
final InspectionProjectProfileManager projectProfileManager = InspectionProjectProfileManager.getInstance(project);
|
||||
final ApplicationProfileManager profileManager = ApplicationProfileManager.getInstance();
|
||||
final ProjectInspectionProfileManagerImpl projectProfileManager = ProjectInspectionProfileManagerImpl.getInstanceImpl(project);
|
||||
reloadProfiles(profiles, profileManager, projectProfileManager, manager);
|
||||
panel.myBrowseProfilesCombo.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
final InspectionToolsConfigurable errorConfigurable = createConfigurable(projectProfileManager, profileManager, profiles);
|
||||
final InspectionToolsConfigurable errorConfigurable = createConfigurable(projectProfileManager, profiles);
|
||||
final MySingleConfigurableEditor editor = new MySingleConfigurableEditor(project, errorConfigurable, manager);
|
||||
if (editor.showAndGet()) {
|
||||
reloadProfiles(profiles, profileManager, projectProfileManager, manager);
|
||||
@@ -148,19 +149,15 @@ public class CodeInspectionAction extends BaseAnalysisAction {
|
||||
return panel.myAdditionalPanel;
|
||||
}
|
||||
|
||||
protected InspectionToolsConfigurable createConfigurable(InspectionProjectProfileManager projectProfileManager,
|
||||
InspectionProfileManager profileManager,
|
||||
final JComboBox profilesCombo) {
|
||||
return new ExternalProfilesComboboxAwareInspectionToolsConfigurable(projectProfileManager, profileManager, profilesCombo);
|
||||
protected InspectionToolsConfigurable createConfigurable(ProjectInspectionProfileManagerImpl projectProfileManager, JComboBox profilesCombo) {
|
||||
return new ExternalProfilesComboboxAwareInspectionToolsConfigurable(projectProfileManager, profilesCombo);
|
||||
}
|
||||
|
||||
protected static class ExternalProfilesComboboxAwareInspectionToolsConfigurable extends InspectionToolsConfigurable {
|
||||
private final JComboBox myProfilesCombo;
|
||||
|
||||
public ExternalProfilesComboboxAwareInspectionToolsConfigurable(@NotNull InspectionProjectProfileManager projectProfileManager,
|
||||
InspectionProfileManager profileManager,
|
||||
JComboBox profilesCombo) {
|
||||
super(projectProfileManager, profileManager);
|
||||
public ExternalProfilesComboboxAwareInspectionToolsConfigurable(@NotNull ProjectInspectionProfileManagerImpl projectProfileManager, JComboBox profilesCombo) {
|
||||
super(projectProfileManager);
|
||||
myProfilesCombo = profilesCombo;
|
||||
}
|
||||
|
||||
@@ -189,7 +186,7 @@ public class CodeInspectionAction extends BaseAnalysisAction {
|
||||
|
||||
|
||||
private void reloadProfiles(JComboBox profiles,
|
||||
InspectionProfileManager inspectionProfileManager,
|
||||
ApplicationProfileManager inspectionProfileManager,
|
||||
InspectionProjectProfileManager inspectionProjectProfileManager,
|
||||
InspectionManagerEx inspectionManager) {
|
||||
final InspectionProfile selectedProfile = getGlobalInspectionContext(inspectionManager.getProject()).getCurrentProfile();
|
||||
@@ -207,7 +204,6 @@ public class CodeInspectionAction extends BaseAnalysisAction {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static class AdditionalPanel {
|
||||
public ComboboxWithBrowseButton myBrowseProfilesCombo;
|
||||
public JPanel myAdditionalPanel;
|
||||
|
||||
+1
-2
@@ -184,7 +184,6 @@ public class ApplicationInspectionProfileManagerImpl extends BaseInspectionProfi
|
||||
addProfile(createSampleProfile(InspectionProfileImpl.DEFAULT_PROFILE_NAME, getDefaultProfile()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Profile loadProfile(@NotNull String path) throws IOException, JDOMException {
|
||||
final File file = new File(path);
|
||||
if (file.exists()) {
|
||||
@@ -211,7 +210,7 @@ public class ApplicationInspectionProfileManagerImpl extends BaseInspectionProfi
|
||||
|
||||
private static void updateProfileImpl(@NotNull Profile profile) {
|
||||
for (Project project : ProjectManager.getInstance().getOpenProjects()) {
|
||||
InspectionProjectProfileManager.getInstance(project).initProfileWrapper(profile);
|
||||
ProjectInspectionProfileManagerImpl.getInstanceImpl(project).initProfileWrapper(profile);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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.
|
||||
@@ -28,8 +28,8 @@ import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.options.ShowSettingsUtil;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Iconable;
|
||||
import com.intellij.profile.codeInspection.InspectionProfileManager;
|
||||
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
|
||||
import com.intellij.profile.codeInspection.ProjectInspectionProfileManagerImpl;
|
||||
import com.intellij.profile.codeInspection.ui.ErrorsConfigurable;
|
||||
import com.intellij.profile.codeInspection.ui.ProjectInspectionToolsConfigurable;
|
||||
import com.intellij.psi.PsiFile;
|
||||
@@ -103,8 +103,7 @@ public class EditInspectionToolsSettingsAction implements IntentionAction, Icona
|
||||
final ShowSettingsUtil settingsUtil = ShowSettingsUtil.getInstance();
|
||||
final ErrorsConfigurable errorsConfigurable;
|
||||
if (!canChooseDifferentProfile) {
|
||||
errorsConfigurable = new ProjectInspectionToolsConfigurable(InspectionProfileManager.getInstance(),
|
||||
InspectionProjectProfileManager.getInstance(project));
|
||||
errorsConfigurable = new ProjectInspectionToolsConfigurable(ProjectInspectionProfileManagerImpl.getInstanceImpl(project));
|
||||
}
|
||||
else {
|
||||
errorsConfigurable = ErrorsConfigurable.SERVICE.createConfigurable(project);
|
||||
|
||||
+4
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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.
|
||||
@@ -23,13 +23,14 @@ import com.intellij.openapi.project.DumbAwareAction;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.profile.Profile;
|
||||
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
|
||||
import com.intellij.profile.codeInspection.ProjectInspectionProfileManagerImpl;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class QuickChangeInspectionProfileAction extends QuickSwitchSchemeAction {
|
||||
@Override
|
||||
protected void fillActions(Project project, @NotNull DefaultActionGroup group, @NotNull DataContext dataContext) {
|
||||
final InspectionProjectProfileManager projectProfileManager = InspectionProjectProfileManager.getInstance(project);
|
||||
final ProjectInspectionProfileManagerImpl projectProfileManager = ProjectInspectionProfileManagerImpl.getInstanceImpl(project);
|
||||
InspectionProfile current = projectProfileManager.getInspectionProfile();
|
||||
for (Profile profile : projectProfileManager.getProfiles()) {
|
||||
addScheme(group, projectProfileManager, current, profile);
|
||||
@@ -37,7 +38,7 @@ public class QuickChangeInspectionProfileAction extends QuickSwitchSchemeAction
|
||||
}
|
||||
|
||||
private static void addScheme(final DefaultActionGroup group,
|
||||
final InspectionProjectProfileManager projectProfileManager,
|
||||
final ProjectInspectionProfileManagerImpl projectProfileManager,
|
||||
final Profile current,
|
||||
final Profile scheme) {
|
||||
group.add(new DumbAwareAction(scheme.getName(), "", scheme == current ? ourCurrentAction : ourNotCurrentAction) {
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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.
|
||||
@@ -19,7 +19,7 @@ import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
|
||||
import com.intellij.profile.codeInspection.ProjectInspectionProfileManagerImpl;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@@ -28,6 +28,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
public class PlatformInspectionProfileConfigurator implements DirectoryProjectConfigurator {
|
||||
@Override
|
||||
public void configureProject(Project project, @NotNull VirtualFile baseDir, Ref<Module> moduleRef) {
|
||||
InspectionProjectProfileManager.getInstance(project).setProjectProfile(null);
|
||||
ProjectInspectionProfileManagerImpl.getInstanceImpl(project).setProjectProfile(null);
|
||||
}
|
||||
}
|
||||
|
||||
+3
-4
@@ -22,14 +22,13 @@ package com.intellij.profile.codeInspection.ui;
|
||||
|
||||
import com.intellij.codeInspection.ex.ApplicationInspectionProfileManagerImpl;
|
||||
import com.intellij.codeInspection.ex.InspectionProfileImpl;
|
||||
import com.intellij.profile.codeInspection.InspectionProfileManager;
|
||||
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
|
||||
import com.intellij.profile.codeInspection.ProjectInspectionProfileManagerImpl;
|
||||
import com.intellij.profile.codeInspection.ui.header.InspectionToolsConfigurable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class ProjectInspectionToolsConfigurable extends InspectionToolsConfigurable {
|
||||
public ProjectInspectionToolsConfigurable(InspectionProfileManager profileManager, InspectionProjectProfileManager projectProfileManager) {
|
||||
super(projectProfileManager, profileManager);
|
||||
public ProjectInspectionToolsConfigurable(@NotNull ProjectInspectionProfileManagerImpl projectProfileManager) {
|
||||
super(projectProfileManager);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+6
-9
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2010 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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.
|
||||
@@ -15,24 +15,21 @@
|
||||
*/
|
||||
package com.intellij.profile.codeInspection.ui;
|
||||
|
||||
import com.intellij.profile.codeInspection.InspectionProfileManager;
|
||||
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
|
||||
import com.intellij.profile.codeInspection.ProjectInspectionProfileManagerImpl;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author nik
|
||||
*/
|
||||
public class ProjectInspectionToolsConfigurableProvider extends ErrorsConfigurableProvider {
|
||||
private final InspectionProfileManager myProfileManager;
|
||||
private final InspectionProjectProfileManager myProjectProfileManager;
|
||||
private final ProjectInspectionProfileManagerImpl myProjectProfileManager;
|
||||
|
||||
public ProjectInspectionToolsConfigurableProvider(InspectionProfileManager profileManager,
|
||||
InspectionProjectProfileManager projectProfileManager) {
|
||||
myProfileManager = profileManager;
|
||||
public ProjectInspectionToolsConfigurableProvider(@NotNull ProjectInspectionProfileManagerImpl projectProfileManager) {
|
||||
myProjectProfileManager = projectProfileManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ErrorsConfigurable createConfigurable() {
|
||||
return new ProjectInspectionToolsConfigurable(myProfileManager, myProjectProfileManager);
|
||||
return new ProjectInspectionToolsConfigurable(myProjectProfileManager);
|
||||
}
|
||||
}
|
||||
|
||||
+7
-8
@@ -46,10 +46,10 @@ import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.profile.ApplicationProfileManager;
|
||||
import com.intellij.profile.Profile;
|
||||
import com.intellij.profile.ProfileManager;
|
||||
import com.intellij.profile.codeInspection.InspectionProfileManager;
|
||||
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
|
||||
import com.intellij.profile.codeInspection.ProjectInspectionProfileManagerImpl;
|
||||
import com.intellij.profile.codeInspection.ui.ErrorsConfigurable;
|
||||
import com.intellij.profile.codeInspection.ui.SingleInspectionProfilePanel;
|
||||
import com.intellij.ui.IdeBorderFactory;
|
||||
@@ -79,8 +79,8 @@ public abstract class InspectionToolsConfigurable extends BaseConfigurable
|
||||
|
||||
private static final Logger LOG = Logger.getInstance(InspectionToolsConfigurable.class);
|
||||
private static final String COPY_SUFFIX = "copy";
|
||||
protected final InspectionProfileManager myApplicationProfileManager;
|
||||
protected final InspectionProjectProfileManager myProjectProfileManager;
|
||||
protected final ApplicationProfileManager myApplicationProfileManager;
|
||||
protected final ProjectInspectionProfileManagerImpl myProjectProfileManager;
|
||||
private final CardLayout myLayout = new CardLayout();
|
||||
private final Map<Profile, SingleInspectionProfilePanel> myPanels =
|
||||
new HashMap<Profile, SingleInspectionProfilePanel>();
|
||||
@@ -90,10 +90,9 @@ public abstract class InspectionToolsConfigurable extends BaseConfigurable
|
||||
private AuxiliaryRightPanel myAuxiliaryRightPanel;
|
||||
private Alarm mySelectionAlarm;
|
||||
|
||||
public InspectionToolsConfigurable(@NotNull InspectionProjectProfileManager projectProfileManager,
|
||||
InspectionProfileManager profileManager) {
|
||||
public InspectionToolsConfigurable(@NotNull ProjectInspectionProfileManagerImpl projectProfileManager) {
|
||||
myProjectProfileManager = projectProfileManager;
|
||||
myApplicationProfileManager = profileManager;
|
||||
myApplicationProfileManager = ApplicationProfileManager.getInstance();
|
||||
}
|
||||
|
||||
private static JComponent withBorderOnTop(final JComponent component) {
|
||||
@@ -442,7 +441,7 @@ public abstract class InspectionToolsConfigurable extends BaseConfigurable
|
||||
}
|
||||
|
||||
public static InspectionProfileImpl importInspectionProfile(@NotNull Element rootElement,
|
||||
@NotNull InspectionProfileManager profileManager,
|
||||
@NotNull ApplicationProfileManager profileManager,
|
||||
@NotNull Project project,
|
||||
@Nullable JPanel anchorPanel)
|
||||
throws JDOMException, IOException, InvalidDataException {
|
||||
|
||||
@@ -77,7 +77,7 @@ import com.intellij.openapi.vfs.impl.VirtualFilePointerManagerImpl;
|
||||
import com.intellij.openapi.vfs.newvfs.persistent.PersistentFS;
|
||||
import com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl;
|
||||
import com.intellij.openapi.vfs.pointers.VirtualFilePointerManager;
|
||||
import com.intellij.profile.codeInspection.InspectionProfileManager;
|
||||
import com.intellij.profile.ApplicationProfileManager;
|
||||
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
|
||||
import com.intellij.psi.PsiDocumentManager;
|
||||
import com.intellij.psi.PsiFile;
|
||||
@@ -453,7 +453,7 @@ public abstract class LightPlatformTestCase extends UsefulTestCase implements Da
|
||||
lookupManager.hideActiveLookup();
|
||||
}
|
||||
((StartupManagerImpl)StartupManager.getInstance(project)).prepareForNextTest();
|
||||
InspectionProfileManager.getInstance().deleteProfile(PROFILE);
|
||||
ApplicationProfileManager.getInstance().deleteProfile(PROFILE);
|
||||
if (ProjectManager.getInstance() == null) {
|
||||
exceptions.add(new AssertionError("Application components damaged"));
|
||||
}
|
||||
|
||||
+2
-2
@@ -84,8 +84,8 @@ import com.intellij.openapi.util.*;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.*;
|
||||
import com.intellij.profile.ApplicationProfileManager;
|
||||
import com.intellij.profile.Profile;
|
||||
import com.intellij.profile.codeInspection.InspectionProfileManager;
|
||||
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
|
||||
import com.intellij.profile.codeInspection.ProjectInspectionProfileManagerImpl;
|
||||
import com.intellij.psi.*;
|
||||
@@ -202,7 +202,7 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
|
||||
final InspectionProfileImpl profile = InspectionProfileImpl.createSimple(LightPlatformTestCase.PROFILE, project, wrapped);
|
||||
profile.disableToolByDefault(new ArrayList<String>(disabledInspections), project);
|
||||
|
||||
final InspectionProfileManager inspectionProfileManager = InspectionProfileManager.getInstance();
|
||||
final ApplicationProfileManager inspectionProfileManager = ApplicationProfileManager.getInstance();
|
||||
final Profile oldRootProfile = inspectionProfileManager.getRootProfile();
|
||||
inspectionProfileManager.addProfile(profile);
|
||||
Disposer.register(parentDisposable, new Disposable() {
|
||||
|
||||
+3
-6
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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.
|
||||
@@ -21,7 +21,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.LabeledComponent;
|
||||
import com.intellij.openapi.util.JDOMExternalizableStringList;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.profile.codeInspection.InspectionProfileManager;
|
||||
import com.intellij.profile.ApplicationProfileManager;
|
||||
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.ui.DocumentAdapter;
|
||||
@@ -40,9 +40,6 @@ import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @author Hani Suleiman Date: Aug 3, 2005 Time: 3:34:56 AM
|
||||
*/
|
||||
public class DependsOnGroupsInspection extends BaseJavaLocalInspectionTool {
|
||||
private static final Logger LOGGER = Logger.getInstance("TestNG Runner");
|
||||
private static final Pattern PATTERN = Pattern.compile("\"([a-zA-Z0-9_\\-\\(\\)]*)\"");
|
||||
@@ -168,7 +165,7 @@ public class DependsOnGroupsInspection extends BaseJavaLocalInspectionTool {
|
||||
final InspectionProfile inspectionProfile =
|
||||
InspectionProjectProfileManager.getInstance(project).getInspectionProfile();
|
||||
//correct save settings
|
||||
InspectionProfileManager.getInstance().fireProfileChanged(inspectionProfile);
|
||||
ApplicationProfileManager.getInstance().fireProfileChanged(inspectionProfile);
|
||||
//TODO lesya
|
||||
/*
|
||||
try {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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.
|
||||
@@ -20,7 +20,7 @@ import com.intellij.codeInspection.InspectionProfile;
|
||||
import com.intellij.codeInspection.LocalQuickFix;
|
||||
import com.intellij.codeInspection.ProblemDescriptor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.profile.codeInspection.InspectionProfileManager;
|
||||
import com.intellij.profile.ApplicationProfileManager;
|
||||
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
|
||||
import com.jetbrains.rest.RestBundle;
|
||||
import com.jetbrains.rest.inspections.RestRoleInspection;
|
||||
@@ -55,7 +55,7 @@ public class AddIgnoredRoleFix implements LocalQuickFix, LowPriorityAction {
|
||||
if (!myInspection.ignoredRoles.contains(myRole)) {
|
||||
myInspection.ignoredRoles.add(myRole);
|
||||
final InspectionProfile profile = InspectionProjectProfileManager.getInstance(project).getInspectionProfile();
|
||||
InspectionProfileManager.getInstance().fireProfileChanged(profile);
|
||||
ApplicationProfileManager.getInstance().fireProfileChanged(profile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-9
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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.
|
||||
@@ -26,7 +26,6 @@ import com.intellij.lang.annotation.HighlightSeverity;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.ProjectRootManager;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.profile.Profile;
|
||||
import com.intellij.profile.ProfileChangeAdapter;
|
||||
@@ -124,12 +123,6 @@ public class DomElementAnnotationsManagerImpl extends DomElementAnnotationsManag
|
||||
|
||||
final InspectionProfileManager inspectionProfileManager = InspectionProfileManager.getInstance();
|
||||
inspectionProfileManager.addProfileChangeListener(profileChangeAdapter, project);
|
||||
Disposer.register(project, new Disposable() {
|
||||
@Override
|
||||
public void dispose() {
|
||||
inspectionProfileManager.removeProfileChangeListener(profileChangeAdapter);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -158,7 +151,8 @@ public class DomElementAnnotationsManagerImpl extends DomElementAnnotationsManag
|
||||
holder = new DomElementsProblemsHolderImpl(element);
|
||||
rootTag.putUserData(DOM_PROBLEM_HOLDER_KEY, holder);
|
||||
final CachedValue<Boolean> cachedValue = CachedValuesManager.getManager(myProject).createCachedValue(
|
||||
() -> new CachedValueProvider.Result<Boolean>(Boolean.FALSE, element, PsiModificationTracker.OUT_OF_CODE_BLOCK_MODIFICATION_COUNT, DomElementAnnotationsManagerImpl.this, ProjectRootManager.getInstance(myProject)), false);
|
||||
() -> new CachedValueProvider.Result<Boolean>(Boolean.FALSE, element, PsiModificationTracker.OUT_OF_CODE_BLOCK_MODIFICATION_COUNT,
|
||||
this, ProjectRootManager.getInstance(myProject)), false);
|
||||
cachedValue.getValue();
|
||||
element.getFile().putUserData(CACHED_VALUE_KEY, cachedValue);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user