mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
revert: remove addProfileChangeListener from ProfileManager
This commit is contained in:
@@ -15,9 +15,22 @@
|
||||
*/
|
||||
package com.intellij.profile;
|
||||
|
||||
import com.intellij.openapi.Disposable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* User: anna
|
||||
* Date: 09-Dec-2005
|
||||
*/
|
||||
public interface ProfileManager {
|
||||
Profile getProfile(@NotNull String name, boolean returnRootProfileIfNamedIsAbsent);
|
||||
|
||||
default Profile getProfile(@NotNull String name) {
|
||||
return getProfile(name, true);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
String[] getAvailableProfileNames();
|
||||
|
||||
void addProfileChangeListener(@NotNull ProfileChangeAdapter listener, @NotNull Disposable parent);
|
||||
}
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ abstract class BaseInspectionProfileManager(messageBus: MessageBus) : Inspectio
|
||||
|
||||
override final fun getOwnSeverityRegistrar() = severityRegistrar
|
||||
|
||||
fun addProfileChangeListener(listener: ProfileChangeAdapter, parentDisposable: Disposable) {
|
||||
override final fun addProfileChangeListener(listener: ProfileChangeAdapter, parentDisposable: Disposable) {
|
||||
ContainerUtil.add(listener, profileListeners, parentDisposable)
|
||||
}
|
||||
|
||||
|
||||
-9
@@ -60,13 +60,4 @@ public interface InspectionProfileManager extends ProfileManager, SeverityProvid
|
||||
|
||||
@NotNull
|
||||
InspectionProfile getCurrentProfile();
|
||||
|
||||
Profile getProfile(@NotNull String name, boolean returnRootProfileIfNamedIsAbsent);
|
||||
|
||||
default Profile getProfile(@NotNull String name) {
|
||||
return getProfile(name, true);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
String[] getAvailableProfileNames();
|
||||
}
|
||||
@@ -21,7 +21,6 @@ import com.intellij.codeHighlighting.Pass;
|
||||
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer;
|
||||
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzerSettings;
|
||||
import com.intellij.codeInsight.hint.TooltipController;
|
||||
import com.intellij.codeInspection.ex.ApplicationInspectionProfileManager;
|
||||
import com.intellij.ide.AppLifecycleListener;
|
||||
import com.intellij.ide.IdeTooltipManager;
|
||||
import com.intellij.ide.PowerSaveMode;
|
||||
@@ -71,7 +70,8 @@ import com.intellij.openapi.wm.impl.status.TogglePopupHintsPanel;
|
||||
import com.intellij.packageDependencies.DependencyValidationManager;
|
||||
import com.intellij.profile.Profile;
|
||||
import com.intellij.profile.ProfileChangeAdapter;
|
||||
import com.intellij.profile.codeInspection.ProjectInspectionProfileManager;
|
||||
import com.intellij.profile.codeInspection.InspectionProfileManager;
|
||||
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.PsiDocumentManagerImpl;
|
||||
import com.intellij.psi.impl.PsiManagerEx;
|
||||
@@ -126,8 +126,8 @@ public class DaemonListeners implements Disposable {
|
||||
@NotNull CommandProcessor commandProcessor,
|
||||
@NotNull EditorColorsManager editorColorsManager,
|
||||
@NotNull final Application application,
|
||||
@NotNull ApplicationInspectionProfileManager inspectionProfileManager,
|
||||
@NotNull ProjectInspectionProfileManager inspectionProjectProfileManager,
|
||||
@NotNull InspectionProfileManager inspectionProfileManager,
|
||||
@NotNull InspectionProjectProfileManager inspectionProjectProfileManager,
|
||||
@NotNull TodoConfiguration todoConfiguration,
|
||||
@NotNull ActionManagerEx actionManagerEx,
|
||||
@NotNull VirtualFileManager virtualFileManager,
|
||||
|
||||
+3
-3
@@ -32,7 +32,7 @@ import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.ProperTextRange;
|
||||
import com.intellij.profile.Profile;
|
||||
import com.intellij.profile.ProfileChangeAdapter;
|
||||
import com.intellij.profile.codeInspection.ProjectInspectionProfileManager;
|
||||
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.PsiManager;
|
||||
@@ -50,11 +50,11 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
public class WholeFileLocalInspectionsPassFactory extends AbstractProjectComponent implements TextEditorHighlightingPassFactory {
|
||||
private final Map<PsiFile, Boolean> myFileToolsCache = ContainerUtil.createConcurrentWeakMap();
|
||||
private final ProjectInspectionProfileManager myProfileManager;
|
||||
private final InspectionProjectProfileManager myProfileManager;
|
||||
private final Map<PsiFile, Long> myPsiModificationCount = ContainerUtil.createConcurrentWeakMap();
|
||||
|
||||
public WholeFileLocalInspectionsPassFactory(Project project, TextEditorHighlightingPassRegistrar highlightingPassRegistrar,
|
||||
@NotNull ProjectInspectionProfileManager profileManager) {
|
||||
final InspectionProjectProfileManager profileManager) {
|
||||
super(project);
|
||||
// can run in the same time with LIP, but should start after it, since I believe whole-file inspections would run longer
|
||||
highlightingPassRegistrar.registerTextEditorHighlightingPass(this, null, new int[]{Pass.LOCAL_INSPECTIONS}, true, Pass.WHOLE_FILE_LOCAL_INSPECTIONS);
|
||||
|
||||
@@ -59,7 +59,7 @@ import com.intellij.openapi.wm.ToolWindowManager;
|
||||
import com.intellij.pom.Navigatable;
|
||||
import com.intellij.profile.Profile;
|
||||
import com.intellij.profile.ProfileChangeAdapter;
|
||||
import com.intellij.profile.codeInspection.ProjectInspectionProfileManager;
|
||||
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.util.PsiUtilCore;
|
||||
import com.intellij.ui.*;
|
||||
@@ -253,7 +253,7 @@ public class InspectionResultsView extends JPanel implements Disposable, Occuren
|
||||
createActionsToolbar();
|
||||
PsiManager.getInstance(myProject).addPsiTreeChangeListener(new InspectionViewPsiTreeChangeAdapter(this), this);
|
||||
|
||||
ProjectInspectionProfileManager profileManager = ProjectInspectionProfileManager.getInstanceImpl(myProject);
|
||||
final InspectionProjectProfileManager profileManager = InspectionProjectProfileManager.getInstance(myProject);
|
||||
profileManager.addProfileChangeListener(new ProfileChangeAdapter() {
|
||||
@Override
|
||||
public void profileChanged(Profile profile) {
|
||||
@@ -414,7 +414,7 @@ public class InspectionResultsView extends JPanel implements Disposable, Occuren
|
||||
return createToolbar(group);
|
||||
}
|
||||
|
||||
private static JComponent createToolbar(final DefaultActionGroup specialGroup) {
|
||||
private JComponent createToolbar(final DefaultActionGroup specialGroup) {
|
||||
final ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.CODE_INSPECTION, specialGroup, false);
|
||||
//toolbar.setTargetComponent(this);
|
||||
return toolbar.getComponent();
|
||||
|
||||
+2
-2
@@ -21,7 +21,6 @@ import com.intellij.codeInspection.InspectionManager;
|
||||
import com.intellij.codeInspection.InspectionProfile;
|
||||
import com.intellij.codeInspection.InspectionProfileEntry;
|
||||
import com.intellij.codeInspection.ProblemDescriptor;
|
||||
import com.intellij.codeInspection.ex.ApplicationInspectionProfileManager;
|
||||
import com.intellij.codeInspection.ex.InspectionToolWrapper;
|
||||
import com.intellij.lang.annotation.HighlightSeverity;
|
||||
import com.intellij.openapi.Disposable;
|
||||
@@ -30,6 +29,7 @@ import com.intellij.openapi.roots.ProjectRootManager;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.profile.Profile;
|
||||
import com.intellij.profile.ProfileChangeAdapter;
|
||||
import com.intellij.profile.codeInspection.InspectionProfileManager;
|
||||
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
|
||||
import com.intellij.psi.util.CachedValue;
|
||||
import com.intellij.psi.util.CachedValueProvider;
|
||||
@@ -121,7 +121,7 @@ public class DomElementAnnotationsManagerImpl extends DomElementAnnotationsManag
|
||||
}
|
||||
};
|
||||
|
||||
ApplicationInspectionProfileManager.getInstanceImpl().addProfileChangeListener(profileChangeAdapter, project);
|
||||
InspectionProfileManager.getInstance().addProfileChangeListener(profileChangeAdapter, project);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user