cleanup — deprecate ModuleRootAdapter

This commit is contained in:
Vladimir Krivosheev
2016-11-29 11:24:16 +01:00
parent 75376c7551
commit 00c58fd4a8
37 changed files with 100 additions and 100 deletions
@@ -1518,7 +1518,7 @@ public class BuildManager implements Disposable {
if (ApplicationManager.getApplication().isUnitTestMode()) return;
final MessageBusConnection conn = project.getMessageBus().connect();
myConnections.put(project, conn);
conn.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
conn.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(final ModuleRootEvent event) {
final Object source = event.getSource();
@@ -66,7 +66,7 @@ public abstract class BaseCompilerTestCase extends ModuleTestCase {
@Override
protected void setUp() throws Exception {
super.setUp();
myProject.getMessageBus().connect(getTestRootDisposable()).subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
myProject.getMessageBus().connect(getTestRootDisposable()).subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(ModuleRootEvent event) {
//todo[nik] projectOpened isn't called in tests so we need to add this listener manually
@@ -63,7 +63,10 @@ import javax.swing.*;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.IOException;
import java.util.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
/**
* @author Dmitry Avdeev
@@ -78,7 +81,7 @@ public class AttachSourcesNotificationProvider extends EditorNotifications.Provi
public AttachSourcesNotificationProvider(Project project, final EditorNotifications notifications) {
myProject = project;
myProject.getMessageBus().connect(project).subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
myProject.getMessageBus().connect(project).subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(ModuleRootEvent event) {
notifications.updateAllNotifications();
@@ -24,8 +24,8 @@ import com.intellij.openapi.fileEditor.OpenFileDescriptor
import com.intellij.openapi.fileTypes.LanguageFileType
import com.intellij.openapi.project.Project
import com.intellij.openapi.project.ProjectBundle
import com.intellij.openapi.roots.ModuleRootAdapter
import com.intellij.openapi.roots.ModuleRootEvent
import com.intellij.openapi.roots.ModuleRootListener
import com.intellij.openapi.roots.ProjectRootManager
import com.intellij.openapi.util.Key
import com.intellij.openapi.vfs.VirtualFile
@@ -45,7 +45,7 @@ class LibrarySourceNotificationProvider(private val project: Project, notificati
}
init {
project.messageBus.connect(project).subscribe(ProjectTopics.PROJECT_ROOTS, object : ModuleRootAdapter() {
project.messageBus.connect(project).subscribe(ProjectTopics.PROJECT_ROOTS, object : ModuleRootListener {
override fun rootsChanged(event: ModuleRootEvent) = notifications.updateAllNotifications()
})
}
@@ -89,11 +89,11 @@ class LibrarySourceNotificationProvider(private val project: Project, notificati
private fun differs(list1: List<PsiMember>, list2: List<PsiMember>): Boolean =
list1.size != list2.size || list1.map { it.name ?: "" }.sorted() != list2.map { it.name ?: "" }.sorted()
private fun fields(clazz: PsiClass) = if (clazz is PsiExtensibleClass) clazz.ownFields else clazz.fields.asList()
private fun fields(clazz: PsiClass) = (clazz as? PsiExtensibleClass)?.ownFields ?: clazz.fields.asList()
private fun methods(clazz: PsiClass): List<PsiMethod> =
(if (clazz is PsiExtensibleClass) clazz.ownMethods else clazz.methods.asList())
((clazz as? PsiExtensibleClass)?.ownMethods ?: clazz.methods.asList())
.filter { !(it.isConstructor && it.parameterList.parametersCount == 0) }
private fun inners(clazz: PsiClass) = if (clazz is PsiExtensibleClass) clazz.ownInnerClasses else clazz.innerClasses.asList()
private fun inners(clazz: PsiClass) = (clazz as? PsiExtensibleClass)?.ownInnerClasses ?: clazz.innerClasses.asList()
}
private class ColoredNotificationPanel(private val color: Color?) : EditorNotificationPanel() {
@@ -130,10 +130,6 @@ public class ClasspathEditor extends ModuleElementsEditor implements ModuleRootL
}
}
@Override
public void beforeRootsChange(ModuleRootEvent event) {
}
@Override
public void rootsChanged(ModuleRootEvent event) {
if (myPanel != null) {
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 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.
@@ -24,8 +24,8 @@ import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleType;
import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.project.DumbAwareAction;
import com.intellij.openapi.roots.ModuleRootAdapter;
import com.intellij.openapi.roots.ModuleRootEvent;
import com.intellij.openapi.roots.ModuleRootListener;
import com.intellij.openapi.roots.ModuleSourceOrderEntry;
import com.intellij.openapi.roots.OrderEntry;
import com.intellij.openapi.roots.ui.CellAppearanceEx;
@@ -94,7 +94,7 @@ public class AnalyzeDependenciesComponent extends MasterDetailsComponent {
init();
getSplitter().setProportion(0.3f);
myMessageBusConnection = myModule.getProject().getMessageBus().connect();
myMessageBusConnection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
myMessageBusConnection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(ModuleRootEvent event) {
myClasspaths.clear();
@@ -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.
@@ -101,7 +101,7 @@ public class ExternalAnnotationsManagerImpl extends ReadableExternalAnnotationsM
super(psiManager);
myBus = project.getMessageBus();
final MessageBusConnection connection = myBus.connect(project);
connection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
connection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(ModuleRootEvent event) {
dropCache();
@@ -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.
@@ -40,7 +40,7 @@ public class PackagePrefixIndex {
public PackagePrefixIndex(Project project) {
myProject = project;
project.getMessageBus().connect(project).subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
project.getMessageBus().connect(project).subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(final ModuleRootEvent event) {
synchronized (LOCK) {
@@ -56,7 +56,7 @@ public class JavaFileManagerImpl implements JavaFileManager, Disposable {
public JavaFileManagerImpl(Project project) {
myManager = PsiManagerEx.getInstanceEx(project);
myPackageIndex = PackageIndex.getInstance(myManager.getProject());
project.getMessageBus().connect().subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
project.getMessageBus().connect().subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(final ModuleRootEvent event) {
myNontrivialPackagePrefixes = null;
@@ -23,7 +23,7 @@ import java.util.concurrent.TimeUnit
* Implement [WebServerRootsProvider] to add your provider
*/
class WebServerPathToFileManager(application: Application, private val project: Project) {
val pathToInfoCache = CacheBuilder.newBuilder().maximumSize(512).expireAfterAccess(10, TimeUnit.MINUTES).build<String, PathInfo>()
val pathToInfoCache = CacheBuilder.newBuilder().maximumSize(512).expireAfterAccess(10, TimeUnit.MINUTES).build<String, PathInfo>()!!
// time to expire should be greater than pathToFileCache
private val virtualFileToPathInfo = CacheBuilder.newBuilder().maximumSize(512).expireAfterAccess(11, TimeUnit.MINUTES).build<VirtualFile, PathInfo>()
@@ -55,7 +55,7 @@ class WebServerPathToFileManager(application: Application, private val project:
}
companion object {
@JvmStatic fun getInstance(project: Project) = ServiceManager.getService(project, WebServerPathToFileManager::class.java)
@JvmStatic fun getInstance(project: Project) = ServiceManager.getService(project, WebServerPathToFileManager::class.java)!!
}
private fun clearCache() {
@@ -52,8 +52,8 @@ import com.intellij.openapi.module.ModuleUtilCore;
import com.intellij.openapi.project.DumbService;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectUtil;
import com.intellij.openapi.roots.ModuleRootAdapter;
import com.intellij.openapi.roots.ModuleRootEvent;
import com.intellij.openapi.roots.ModuleRootListener;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.UserDataHolderEx;
@@ -255,7 +255,7 @@ public class DaemonListeners implements Disposable {
Disposer.register(this, changeHandler);
psiManager.addPsiTreeChangeListener(changeHandler, changeHandler);
connection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
connection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(ModuleRootEvent event) {
stopDaemonAndRestartAllFiles("Project roots changed");
@@ -22,8 +22,8 @@ import com.intellij.openapi.fileEditor.FileEditor;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectBundle;
import com.intellij.openapi.roots.ModuleRootAdapter;
import com.intellij.openapi.roots.ModuleRootEvent;
import com.intellij.openapi.roots.ModuleRootListener;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.ui.EditorNotificationPanel;
@@ -40,7 +40,7 @@ public class SdkSetupNotificationProvider extends EditorNotifications.Provider<E
public SdkSetupNotificationProvider(Project project, final EditorNotifications notifications) {
myProject = project;
myProject.getMessageBus().connect(project).subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
myProject.getMessageBus().connect(project).subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(ModuleRootEvent event) {
notifications.updateAllNotifications();
@@ -31,8 +31,8 @@ import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.project.DumbService;
import com.intellij.openapi.project.IndexNotReadyException;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ModuleRootAdapter;
import com.intellij.openapi.roots.ModuleRootEvent;
import com.intellij.openapi.roots.ModuleRootListener;
import com.intellij.openapi.updateSettings.impl.pluginsAdvertisement.UnknownFeaturesCollector;
import com.intellij.openapi.util.*;
import com.intellij.openapi.util.registry.Registry;
@@ -104,7 +104,7 @@ public class RunManagerImpl extends RunManagerEx implements PersistentStateCompo
myProject = project;
initializeConfigurationTypes(ConfigurationType.CONFIGURATION_TYPE_EP.getExtensions());
myProject.getMessageBus().connect(myProject).subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
myProject.getMessageBus().connect(myProject).subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(ModuleRootEvent event) {
RunnerAndConfigurationSettings configuration = getSelectedConfiguration();
@@ -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.
@@ -26,8 +26,8 @@ import com.intellij.openapi.editor.event.DocumentEvent;
import com.intellij.openapi.fileEditor.*;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.GeneratedSourcesFilter;
import com.intellij.openapi.roots.ModuleRootAdapter;
import com.intellij.openapi.roots.ModuleRootEvent;
import com.intellij.openapi.roots.ModuleRootListener;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.ui.EditorNotifications;
import com.intellij.util.Alarm;
@@ -94,7 +94,7 @@ public class GeneratedSourceFileChangeTrackerImpl extends GeneratedSourceFileCha
myEditedGeneratedFiles.remove(file);
}
});
connection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
connection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(ModuleRootEvent event) {
myFilesToCheck.addAll(myEditedGeneratedFiles);
@@ -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.
@@ -28,8 +28,8 @@ import com.intellij.ide.util.treeView.NodeDescriptor;
import com.intellij.openapi.fileTypes.StdFileTypes;
import com.intellij.openapi.ide.CopyPasteManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ModuleRootAdapter;
import com.intellij.openapi.roots.ModuleRootEvent;
import com.intellij.openapi.roots.ModuleRootListener;
import com.intellij.openapi.util.ActionCallback;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.vcs.FileStatusListener;
@@ -89,7 +89,7 @@ public class FavoritesViewTreeBuilder extends BaseProjectTreeBuilder {
}
}
};
bus.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
bus.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(ModuleRootEvent event) {
queueUpdate(true);
@@ -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.
@@ -377,9 +377,6 @@ public class NavBarListener extends WolfTheProblemSolver.ProblemListener
@Override
public void beforeEditorTyping(char c, DataContext dataContext) {}
@Override
public void beforeRootsChange(ModuleRootEvent event) {}
@Override
public void beforeChildAddition(@NotNull PsiTreeChangeEvent event) {}
@@ -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.
@@ -29,8 +29,8 @@ import com.intellij.ide.util.treeView.NodeDescriptor;
import com.intellij.openapi.application.ModalityState;
import com.intellij.openapi.ide.CopyPasteManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ModuleRootAdapter;
import com.intellij.openapi.roots.ModuleRootEvent;
import com.intellij.openapi.roots.ModuleRootListener;
import com.intellij.openapi.vcs.FileStatusListener;
import com.intellij.openapi.vcs.FileStatusManager;
import com.intellij.openapi.vfs.VirtualFile;
@@ -62,7 +62,7 @@ public class ProjectTreeBuilder extends BaseProjectTreeBuilder {
final MessageBusConnection connection = project.getMessageBus().connect(this);
connection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
connection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(ModuleRootEvent event) {
queueUpdate();
@@ -197,7 +197,7 @@ public class ProjectViewImpl extends ProjectView implements PersistentStateCompo
myFileEditorManager = fileEditorManager;
myConnection = project.getMessageBus().connect();
myConnection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
myConnection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(ModuleRootEvent event) {
refresh();
@@ -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.
@@ -51,11 +51,10 @@ import com.intellij.openapi.ide.CopyPasteManager;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.IndexNotReadyException;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ModuleRootAdapter;
import com.intellij.openapi.roots.ModuleRootEvent;
import com.intellij.openapi.roots.ModuleRootListener;
import com.intellij.openapi.roots.ui.configuration.actions.ModuleDeleteProvider;
import com.intellij.openapi.util.ActionCallback;
import com.intellij.openapi.util.Condition;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.vcs.FileStatusListener;
import com.intellij.openapi.vcs.FileStatusManager;
@@ -121,7 +120,7 @@ public class ScopeTreeViewPanel extends JPanel implements Disposable {
return null;
}
return ProjectViewTree.getColorForObject(((PackageDependenciesNode)node).getPsiElement(), myProject,
FunctionUtil.<PsiElement>id());
FunctionUtil.id());
}
};
@NotNull
@@ -321,7 +320,6 @@ public class ScopeTreeViewPanel extends JPanel implements Disposable {
if (scope == null) { //was deleted
scope = CustomScopesProviderEx.getAllScope();
}
LOG.assertTrue(scope != null);
final NamedScopesHolder holder = NamedScopesHolder.getHolder(myProject, scope.getName(), myDependencyValidationManager);
final PackageSet packageSet = scope.getValue() != null ? scope.getValue() : new InvalidPackageSet("");
final DependenciesPanel.DependencyPanelSettings settings = new DependenciesPanel.DependencyPanelSettings();
@@ -359,7 +357,6 @@ public class ScopeTreeViewPanel extends JPanel implements Disposable {
if (scope == null) {
scope = CustomScopesProviderEx.getAllScope();
}
LOG.assertTrue(scope != null);
return scope;
}
@@ -500,7 +497,7 @@ public class ScopeTreeViewPanel extends JPanel implements Disposable {
private WolfTheProblemSolver myWolfTheProblemSolver = WolfTheProblemSolver.getInstance(myProject);
@Override
public void customizeCellRenderer(JTree tree,
public void customizeCellRenderer(@NotNull JTree tree,
Object value,
boolean selected,
boolean expanded,
@@ -615,7 +612,7 @@ public class ScopeTreeViewPanel extends JPanel implements Disposable {
if (child instanceof PsiFileSystemItem && (!(child instanceof PsiFile) || !isInjected((PsiFile)child))) {
queueUpdate(() -> {
final DefaultMutableTreeNode rootToReload =
myBuilder.removeNode(child, child instanceof PsiDirectory ? (PsiDirectory)child : (PsiDirectory)oldParent);
myBuilder.removeNode(child, (PsiDirectory)(child instanceof PsiDirectory ? child : oldParent));
if (rootToReload != null) {
reload(rootToReload);
}
@@ -771,7 +768,7 @@ public class ScopeTreeViewPanel extends JPanel implements Disposable {
}
}
private class MyModuleRootListener extends ModuleRootAdapter {
private class MyModuleRootListener implements ModuleRootListener {
@Override
public void rootsChanged(ModuleRootEvent event) {
myUpdateQueue.cancelAllUpdates();
@@ -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.
@@ -30,8 +30,8 @@ import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.module.ModuleType;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ModuleRootAdapter;
import com.intellij.openapi.roots.ModuleRootEvent;
import com.intellij.openapi.roots.ModuleRootListener;
import com.intellij.openapi.roots.ui.configuration.ProjectSettingsService;
import com.intellij.openapi.ui.Splitter;
import com.intellij.openapi.util.Comparing;
@@ -40,7 +40,6 @@ import com.intellij.pom.NavigatableWithText;
import com.intellij.ui.*;
import com.intellij.ui.content.Content;
import com.intellij.ui.treeStructure.Tree;
import com.intellij.util.Function;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.containers.Convertor;
import com.intellij.util.graph.DFSTBuilder;
@@ -130,7 +129,7 @@ public class ModulesDependenciesPanel extends JPanel implements Disposable {
myPathField.setEditable(false);
add(createNorthPanel(), BorderLayout.NORTH);
project.getMessageBus().connect(this).subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
project.getMessageBus().connect(this).subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(ModuleRootEvent event) {
updateModuleGraph();
@@ -23,8 +23,8 @@ import com.intellij.openapi.fileTypes.FileTypeListener;
import com.intellij.openapi.fileTypes.FileTypeManager;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ModuleRootAdapter;
import com.intellij.openapi.roots.ModuleRootEvent;
import com.intellij.openapi.roots.ModuleRootListener;
import com.intellij.openapi.roots.OrderEntry;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.vfs.VirtualFile;
@@ -73,7 +73,7 @@ public class DirectoryIndexImpl extends DirectoryIndex {
}
});
myConnection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
myConnection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(ModuleRootEvent event) {
myRootIndex = null;
@@ -76,7 +76,7 @@ public class PushedFilePropertiesUpdaterImpl extends PushedFilePropertiesUpdater
myFilePushers = ContainerUtil.findAllAsArray(myPushers, pusher -> !pusher.pushDirectoriesOnly());
StartupManager.getInstance(project).registerPreStartupActivity(
() -> project.getMessageBus().connect().subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
() -> project.getMessageBus().connect().subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(final ModuleRootEvent event) {
for (FilePropertyPusher pusher : myPushers) {
@@ -177,7 +177,7 @@ public class PushedFilePropertiesUpdaterImpl extends PushedFilePropertiesUpdater
performPushTasks();
}
};
myProject.getMessageBus().connect(task).subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
myProject.getMessageBus().connect(task).subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(ModuleRootEvent event) {
DumbService.getInstance(myProject).cancelTask(task);
@@ -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.
@@ -22,8 +22,8 @@ import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.module.ModuleUtil;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ModuleRootAdapter;
import com.intellij.openapi.roots.ModuleRootEvent;
import com.intellij.openapi.roots.ModuleRootListener;
import com.intellij.openapi.roots.ModuleRootManager;
import com.intellij.openapi.util.MultiValuesMap;
import com.intellij.openapi.vfs.VfsUtil;
@@ -59,7 +59,7 @@ public class LogicalRootsManagerImpl extends LogicalRootsManager {
//updateCache(moduleManager);
}
});
connection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
connection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(ModuleRootEvent event) {
bus.asyncPublisher(LOGICAL_ROOTS).logicalRootsChanged();
@@ -28,8 +28,8 @@ import com.intellij.openapi.project.DumbModeTask;
import com.intellij.openapi.project.DumbService;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.CollectingContentIterator;
import com.intellij.openapi.roots.ModuleRootAdapter;
import com.intellij.openapi.roots.ModuleRootEvent;
import com.intellij.openapi.roots.ModuleRootListener;
import com.intellij.openapi.roots.impl.PushedFilePropertiesUpdater;
import com.intellij.openapi.startup.StartupManager;
import com.intellij.openapi.vfs.VirtualFile;
@@ -49,7 +49,7 @@ public class UnindexedFilesUpdater extends DumbModeTask {
public UnindexedFilesUpdater(final Project project) {
myProject = project;
project.getMessageBus().connect(this).subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
project.getMessageBus().connect(this).subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(ModuleRootEvent event) {
DumbService.getInstance(project).cancelTask(UnindexedFilesUpdater.this);
@@ -51,8 +51,8 @@ import com.intellij.openapi.preview.PreviewManager;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.project.*;
import com.intellij.openapi.project.impl.ProjectImpl;
import com.intellij.openapi.roots.ModuleRootAdapter;
import com.intellij.openapi.roots.ModuleRootEvent;
import com.intellij.openapi.roots.ModuleRootListener;
import com.intellij.openapi.startup.StartupManager;
import com.intellij.openapi.util.*;
import com.intellij.openapi.util.io.FileUtil;
@@ -1799,7 +1799,7 @@ public class FileEditorManagerImpl extends FileEditorManagerEx implements Persis
}
}
private class MyRootsListener extends ModuleRootAdapter {
private class MyRootsListener implements ModuleRootListener {
private boolean myScheduled;
@Override
@@ -1,3 +1,18 @@
/*
* 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.openapi.wm.impl;
import com.intellij.ProjectTopics;
@@ -6,7 +21,6 @@ import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.project.DumbService;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ModuleRootAdapter;
import com.intellij.openapi.roots.ModuleRootEvent;
import com.intellij.openapi.roots.ModuleRootListener;
import com.intellij.openapi.startup.StartupManager;
@@ -27,7 +41,7 @@ public class LibraryDependentToolWindowManager extends AbstractProjectComponent
@Override
public void projectOpened() {
final ModuleRootListener rootListener = new ModuleRootAdapter() {
final ModuleRootListener rootListener = new ModuleRootListener() {
public void rootsChanged(ModuleRootEvent event) {
if (!myProject.isDisposed()) {
checkToolWindowStatuses(myProject);
@@ -16,7 +16,7 @@
package com.intellij.openapi.roots;
/**
* @author nik
*/
* @deprecated Please useModuleRootListener
*/
public abstract class ModuleRootAdapter implements ModuleRootListener {
}
@@ -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.
@@ -21,8 +21,8 @@ import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.ModalityState;
import com.intellij.openapi.components.AbstractProjectComponent;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ModuleRootAdapter;
import com.intellij.openapi.roots.ModuleRootEvent;
import com.intellij.openapi.roots.ModuleRootListener;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.problems.WolfTheProblemSolver;
import com.intellij.util.messages.MessageBusConnection;
@@ -40,7 +40,7 @@ public class VcsEventWatcher extends AbstractProjectComponent {
@Override
public void projectOpened() {
MessageBusConnection connection = myProject.getMessageBus().connect(myProject);
connection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
connection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(ModuleRootEvent event) {
ApplicationManager.getApplication().invokeLater(new Runnable() {
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 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.
@@ -73,10 +73,6 @@ public class VcsRootScanner implements BulkFileListener, ModuleRootListener, Vcs
}
}
@Override
public void beforeRootsChange(ModuleRootEvent event) {
}
@Override
public void rootsChanged(ModuleRootEvent event) {
scheduleScan();
@@ -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,8 +27,8 @@ import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.IndexNotReadyException;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ModuleRootAdapter;
import com.intellij.openapi.roots.ModuleRootEvent;
import com.intellij.openapi.roots.ModuleRootListener;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.LocalFileSystem;
@@ -72,7 +72,7 @@ public class UseDistributionWithSourcesNotificationProvider extends EditorNotifi
public UseDistributionWithSourcesNotificationProvider(Project project, final EditorNotifications notifications) {
myProject = project;
project.getMessageBus().connect(project).subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
project.getMessageBus().connect(project).subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(ModuleRootEvent event) {
notifications.updateAllNotifications();
@@ -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,13 +20,12 @@ import com.intellij.openapi.compiler.CompilerManager;
import com.intellij.openapi.fileEditor.FileEditor;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleUtil;
import com.intellij.openapi.module.ModuleUtilCore;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.project.IndexNotReadyException;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ModuleRootAdapter;
import com.intellij.openapi.roots.ModuleRootEvent;
import com.intellij.openapi.roots.ModuleRootListener;
import com.intellij.openapi.roots.ModuleRootManager;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.text.StringUtil;
@@ -53,7 +52,7 @@ public class ConfigureGroovyLibraryNotificationProvider extends EditorNotificati
public ConfigureGroovyLibraryNotificationProvider(Project project, final EditorNotifications notifications) {
myProject = project;
project.getMessageBus().connect(project).subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
project.getMessageBus().connect(project).subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(ModuleRootEvent event) {
notifications.updateAllNotifications();
@@ -83,7 +83,7 @@ public class MvcModuleStructureSynchronizer extends AbstractProjectComponent {
@Override
public void initComponent() {
final MessageBusConnection connection = myProject.getMessageBus().connect();
connection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
connection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(ModuleRootEvent event) {
myModificationTracker.incModificationCount();
@@ -28,8 +28,8 @@ import com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.ModuleAdapter;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ModuleRootAdapter;
import com.intellij.openapi.roots.ModuleRootEvent;
import com.intellij.openapi.roots.ModuleRootListener;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.Key;
@@ -324,7 +324,7 @@ public class MavenProjectsManagerWatcher {
// onSettingsChange() will be called indirectly by pathsChanged listener on GeneralSettings object
}
private class MyRootChangesListener extends ModuleRootAdapter {
private class MyRootChangesListener implements ModuleRootListener {
@Override
public void rootsChanged(ModuleRootEvent event) {
// todo is this logic necessary?
@@ -22,7 +22,6 @@ import com.intellij.openapi.roots.*;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.vcs.changes.ChangeListManager;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.Consumer;
import org.jetbrains.idea.maven.MavenImportingTestCase;
import org.jetbrains.idea.maven.importing.MavenFoldersImporter;
import org.jetbrains.idea.maven.importing.MavenRootModelAdapter;
@@ -189,7 +188,7 @@ public class MavenFoldersImporterTest extends MavenImportingTestCase {
"<version>1</version>");
final int[] count = new int[]{0};
myProject.getMessageBus().connect().subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
myProject.getMessageBus().connect().subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(ModuleRootEvent event) {
count[0]++;
@@ -225,7 +224,7 @@ public class MavenFoldersImporterTest extends MavenImportingTestCase {
importProject();
final int[] count = new int[]{0};
myProject.getMessageBus().connect().subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
myProject.getMessageBus().connect().subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(ModuleRootEvent event) {
count[0]++;
@@ -21,8 +21,8 @@ import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleUtil;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ModuleRootAdapter;
import com.intellij.openapi.roots.ModuleRootEvent;
import com.intellij.openapi.roots.ModuleRootListener;
import com.intellij.openapi.roots.OrderEnumerator;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.vfs.JarFileSystem;
@@ -63,7 +63,7 @@ public final class LoaderFactory {
myProject = project;
myModule2ClassLoader = ContainerUtil.createConcurrentWeakMap();
myConnection = myProject.getMessageBus().connect();
myConnection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
myConnection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
public void rootsChanged(final ModuleRootEvent event) {
clearClassLoaderCache();
}
@@ -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.
@@ -22,8 +22,8 @@ import com.intellij.lang.properties.PropertiesUtilBase;
import com.intellij.lang.properties.psi.PropertiesFile;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleServiceManager;
import com.intellij.openapi.roots.ModuleRootAdapter;
import com.intellij.openapi.roots.ModuleRootEvent;
import com.intellij.openapi.roots.ModuleRootListener;
import com.intellij.openapi.util.Pair;
import com.intellij.uiDesigner.lw.StringDescriptor;
import com.intellij.uiDesigner.radComponents.RadComponent;
@@ -45,7 +45,7 @@ public class StringDescriptorManager {
public StringDescriptorManager(final Module module, MessageBus bus) {
myModule = module;
bus.connect().subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
bus.connect().subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
public void rootsChanged(final ModuleRootEvent event) {
synchronized(myPropertiesFileCache) {
myPropertiesFileCache.clear();
@@ -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,8 +20,8 @@ import com.intellij.openapi.Disposable;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleServiceManager;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.roots.ModuleRootAdapter;
import com.intellij.openapi.roots.ModuleRootEvent;
import com.intellij.openapi.roots.ModuleRootListener;
import com.intellij.openapi.vfs.VirtualFileManager;
import com.jetbrains.python.sdk.PythonSdkType;
@@ -35,7 +35,7 @@ public class PythonModulePathCache extends PythonPathCache implements Disposable
@SuppressWarnings({"UnusedDeclaration"})
public PythonModulePathCache(final Module module) {
module.getMessageBus().connect().subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
module.getMessageBus().connect().subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
public void rootsChanged(ModuleRootEvent event) {
updateCacheForSdk(module);
clearCache();