mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
delete deprecated listener API; ModuleManager -> projectModel-api
This commit is contained in:
+1
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 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,14 +23,12 @@ import com.intellij.openapi.module.ModuleManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.LanguageLevelModuleExtension;
|
||||
import com.intellij.openapi.roots.LanguageLevelProjectExtension;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.pom.java.LanguageLevel;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.containers.HashSet;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
public class LanguageLevelUsagesCollector extends AbstractApplicationUsagesCollector {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 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.
|
||||
@@ -25,7 +25,6 @@ import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.module.ModuleManager;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.psi.PsiManager;
|
||||
import com.intellij.psi.util.CachedValueProvider;
|
||||
import com.intellij.psi.util.CachedValuesManager;
|
||||
import com.intellij.psi.util.CachedValue;
|
||||
|
||||
@@ -21,7 +21,6 @@ import com.intellij.ide.highlighter.ModuleFileType;
|
||||
import com.intellij.notification.Notification;
|
||||
import com.intellij.notification.NotificationType;
|
||||
import com.intellij.notification.Notifications;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.application.Application;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.components.*;
|
||||
@@ -453,23 +452,6 @@ public class ModuleManagerImpl extends ModuleManager implements ProjectComponent
|
||||
}
|
||||
|
||||
private final Map<ModuleListener, MessageBusConnection> myAdapters = new HashMap<ModuleListener, MessageBusConnection>();
|
||||
public void addModuleListener(@NotNull ModuleListener listener) {
|
||||
final MessageBusConnection connection = myMessageBus.connect();
|
||||
connection.subscribe(ProjectTopics.MODULES, listener);
|
||||
myAdapters.put(listener, connection);
|
||||
}
|
||||
|
||||
public void addModuleListener(@NotNull ModuleListener listener, Disposable parentDisposable) {
|
||||
final MessageBusConnection connection = myMessageBus.connect(parentDisposable);
|
||||
connection.subscribe(ProjectTopics.MODULES, listener);
|
||||
}
|
||||
|
||||
public void removeModuleListener(@NotNull ModuleListener listener) {
|
||||
final MessageBusConnection adapter = myAdapters.remove(listener);
|
||||
if (adapter != null) {
|
||||
adapter.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Module newModule(@NotNull String filePath, final String moduleTypeId) {
|
||||
|
||||
-27
@@ -15,8 +15,6 @@
|
||||
*/
|
||||
package com.intellij.openapi.module;
|
||||
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.project.ModuleListener;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.InvalidDataException;
|
||||
import com.intellij.util.graph.Graph;
|
||||
@@ -140,31 +138,6 @@ public abstract class ModuleManager {
|
||||
*/
|
||||
@NotNull public abstract Graph<Module> moduleGraph(boolean includeTests);
|
||||
|
||||
/**
|
||||
* Adds a listener for receiving notifications to the module structure of the project.
|
||||
*
|
||||
* @param listener the listener instance.
|
||||
* @deprecated Subscribe to {@link com.intellij.ProjectTopics#MODULES} on project bus or lower.
|
||||
*/
|
||||
public abstract void addModuleListener(@NotNull ModuleListener listener);
|
||||
|
||||
/**
|
||||
* Adds a listener for receiving notifications to the module structure of the project.
|
||||
*
|
||||
* @param listener the listener instance.
|
||||
* @param parentDisposable object, after whose disposing the listener should be removed
|
||||
* @deprecated Subscribe to {@link com.intellij.ProjectTopics#MODULES} on project bus or lower.
|
||||
*/
|
||||
public abstract void addModuleListener(@NotNull ModuleListener listener, Disposable parentDisposable);
|
||||
|
||||
/**
|
||||
* Removes a listener for receiving notifications to the module structure of the project.
|
||||
*
|
||||
* @param listener the listener instance.
|
||||
* @deprecated Subscribe to {@link com.intellij.ProjectTopics#MODULES} on project bus or lower.
|
||||
*/
|
||||
public abstract void removeModuleListener(@NotNull ModuleListener listener);
|
||||
|
||||
/**
|
||||
* Returns the model for the list of modules in the project, which can be used to add,
|
||||
* remove or modify modules.
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 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,6 @@ package com.intellij.util.xml.model.gotosymbol;
|
||||
import com.intellij.navigation.ChooseByNameContributor;
|
||||
import com.intellij.navigation.ItemPresentation;
|
||||
import com.intellij.navigation.NavigationItem;
|
||||
import com.intellij.openapi.editor.colors.TextAttributesKey;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.module.ModuleManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
|
||||
Reference in New Issue
Block a user