diff --git a/java/java-impl/src/META-INF/JavaPlugin.xml b/java/java-impl/src/META-INF/JavaPlugin.xml
index 3927b5f2e500..266ca8412025 100644
--- a/java/java-impl/src/META-INF/JavaPlugin.xml
+++ b/java/java-impl/src/META-INF/JavaPlugin.xml
@@ -980,7 +980,6 @@
-
diff --git a/java/java-impl/src/com/intellij/ide/scopeView/ClassesScopeTreeStructureExpander.java b/java/java-impl/src/com/intellij/ide/scopeView/ClassesScopeTreeStructureExpander.java
deleted file mode 100644
index 55c64982527d..000000000000
--- a/java/java-impl/src/com/intellij/ide/scopeView/ClassesScopeTreeStructureExpander.java
+++ /dev/null
@@ -1,140 +0,0 @@
-// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
-package com.intellij.ide.scopeView;
-
-import com.intellij.ide.projectView.ProjectView;
-import com.intellij.ide.projectView.PsiClassChildrenSource;
-import com.intellij.ide.scopeView.nodes.ClassNode;
-import com.intellij.ide.scopeView.nodes.FieldNode;
-import com.intellij.ide.scopeView.nodes.MethodNode;
-import com.intellij.openapi.fileTypes.StdFileTypes;
-import com.intellij.openapi.project.Project;
-import com.intellij.openapi.vfs.VirtualFile;
-import com.intellij.packageDependencies.ui.DependencyNodeComparator;
-import com.intellij.packageDependencies.ui.DirectoryNode;
-import com.intellij.packageDependencies.ui.FileNode;
-import com.intellij.psi.*;
-import com.intellij.util.ui.tree.TreeUtil;
-
-import javax.swing.*;
-import javax.swing.event.TreeExpansionEvent;
-import javax.swing.tree.*;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-public class ClassesScopeTreeStructureExpander implements ScopeTreeStructureExpander {
-
- private final Project myProject;
-
- public ClassesScopeTreeStructureExpander(final Project project) {
- myProject = project;
- }
-
- @Override
- public void treeWillExpand(TreeExpansionEvent event) throws ExpandVetoException {
- if (myProject.isDisposed()) return;
- ProjectView projectView = ProjectView.getInstance(myProject);
- final TreePath path = event.getPath();
- if (path == null) return;
- final DefaultMutableTreeNode node = (DefaultMutableTreeNode)path.getLastPathComponent();
- if (node instanceof DirectoryNode) {
- Set classNodes = null;
- for (int i = node.getChildCount() - 1; i >= 0; i--) {
- final TreeNode childNode = node.getChildAt(i);
- if (childNode instanceof FileNode) {
- final FileNode fileNode = (FileNode)childNode;
- final PsiElement file = fileNode.getPsiElement();
- if (file instanceof PsiJavaFile) {
- final VirtualFile virtualFile = ((PsiJavaFile)file).getVirtualFile();
- if (virtualFile == null || (virtualFile.getFileType() != StdFileTypes.JAVA && virtualFile.getFileType() != StdFileTypes.CLASS)) {
- return;
- }
- final PsiClass[] psiClasses = ((PsiJavaFile)file).getClasses();
- if (psiClasses.length > 0) {
- if (classNodes == null) {
- classNodes = new HashSet<>();
- }
-
- for (final PsiClass psiClass : psiClasses) {
- if (psiClass != null && psiClass.isValid()) {
- final ClassNode classNode = new ClassNode(psiClass);
- classNodes.add(classNode);
- if (projectView.isShowMembers(ScopeViewPane.ID)) {
- final List result = new ArrayList<>();
- PsiClassChildrenSource.DEFAULT_CHILDREN.addChildren(psiClass, result);
- for (PsiElement psiElement : result) {
- psiElement.accept(new JavaElementVisitor() {
- @Override public void visitClass(PsiClass aClass) {
- classNode.add(new ClassNode(aClass));
- }
-
- @Override public void visitMethod(PsiMethod method) {
- classNode.add(new MethodNode(method));
- }
-
- @Override public void visitField(PsiField field) {
- classNode.add(new FieldNode(field));
- }
- });
- }
- }
- }
- }
- node.remove(fileNode);
- }
- }
- }
- }
- if (classNodes != null) {
- for (ClassNode classNode : classNodes) {
- node.add(classNode);
- }
- }
- TreeUtil.sort(node, getNodeComparator());
- final Object source = event.getSource();
- if (source instanceof JTree) {
- ((DefaultTreeModel)((JTree)source).getModel()).reload(node);
- }
- }
- }
-
- @Override
- public void treeWillCollapse(TreeExpansionEvent event) throws ExpandVetoException {
- final TreePath path = event.getPath();
- if (path == null) return;
- final DefaultMutableTreeNode node = (DefaultMutableTreeNode)path.getLastPathComponent();
- if (node instanceof DirectoryNode) {
- Set fileNodes = null;
- for (int i = node.getChildCount() - 1; i >= 0; i--) {
- final TreeNode childNode = node.getChildAt(i);
- if (childNode instanceof ClassNode) {
- final ClassNode classNode = (ClassNode)childNode;
- final PsiFile containingFile = classNode.getContainingFile();
- if (containingFile != null && containingFile.isValid()) {
- if (fileNodes == null) {
- fileNodes = new HashSet<>();
- }
- fileNodes.add(new FileNode(containingFile.getVirtualFile(), myProject, true));
- }
- node.remove(classNode);
- }
- }
- if (fileNodes != null) {
- for (FileNode fileNode : fileNodes) {
- node.add(fileNode);
- }
- }
- TreeUtil.sort(node, getNodeComparator());
- final Object source = event.getSource();
- if (source instanceof JTree) {
- ((DefaultTreeModel)((JTree)source).getModel()).reload(node);
- }
- }
- }
-
- private DependencyNodeComparator getNodeComparator() {
- return new DependencyNodeComparator(ProjectView.getInstance(myProject).isSortByType(ScopeViewPane.ID));
- }
-
-}
diff --git a/platform/lang-impl/src/com/intellij/ide/scopeView/ScopeTreeStructureExpander.java b/platform/lang-impl/src/com/intellij/ide/scopeView/ScopeTreeStructureExpander.java
deleted file mode 100644
index 9d061082e5b0..000000000000
--- a/platform/lang-impl/src/com/intellij/ide/scopeView/ScopeTreeStructureExpander.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2000-2009 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.ide.scopeView;
-
-import com.intellij.openapi.extensions.ExtensionPointName;
-
-import javax.swing.event.TreeWillExpandListener;
-
-public interface ScopeTreeStructureExpander extends TreeWillExpandListener {
- ExtensionPointName EP_NAME = ExtensionPointName.create("com.intellij.scopeTreeExpander");
-}
\ No newline at end of file
diff --git a/platform/lang-impl/src/com/intellij/ide/scopeView/ScopeTreeViewPanel.java b/platform/lang-impl/src/com/intellij/ide/scopeView/ScopeTreeViewPanel.java
index b5f8cddfaa16..5b2d4ebc02e8 100644
--- a/platform/lang-impl/src/com/intellij/ide/scopeView/ScopeTreeViewPanel.java
+++ b/platform/lang-impl/src/com/intellij/ide/scopeView/ScopeTreeViewPanel.java
@@ -64,6 +64,7 @@ import com.intellij.util.ui.tree.TreeUtil;
import com.intellij.util.ui.update.MergingUpdateQueue;
import com.intellij.util.ui.update.UiNotifyConnector;
import com.intellij.util.ui.update.Update;
+import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -80,6 +81,11 @@ import java.lang.ref.WeakReference;
import java.util.List;
import java.util.*;
+/**
+ * @deprecated This class is no longer used in IntelliJ IDEA and will be removed. The Scope view is implemented via the ScopeViewPane class.
+ */
+@Deprecated
+@ApiStatus.ScheduledForRemoval(inVersion = "2021.2")
public class ScopeTreeViewPanel extends JPanel implements Disposable {
private static final Logger LOG = Logger.getInstance(ScopeTreeViewPanel.class);
@@ -231,13 +237,7 @@ public class ScopeTreeViewPanel extends JPanel implements Disposable {
new TreeSpeedSearch(myTree);
myCopyPasteDelegator = new CopyPasteDelegator(myProject, this);
myTreeExpansionMonitor = PackageTreeExpansionMonitor.install(myTree, myProject);
- final ScopeTreeStructureExpander[] extensions = ScopeTreeStructureExpander.EP_NAME.getExtensions(myProject);
- for (ScopeTreeStructureExpander expander : extensions) {
- myTree.addTreeWillExpandListener(expander);
- }
- if (extensions.length == 0) {
- myTree.addTreeWillExpandListener(new SortingExpandListener());
- }
+ myTree.addTreeWillExpandListener(new SortingExpandListener());
myTree.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
diff --git a/platform/platform-resources/src/META-INF/LangExtensionPoints.xml b/platform/platform-resources/src/META-INF/LangExtensionPoints.xml
index 553e6032078e..f39e573ffb07 100644
--- a/platform/platform-resources/src/META-INF/LangExtensionPoints.xml
+++ b/platform/platform-resources/src/META-INF/LangExtensionPoints.xml
@@ -275,7 +275,6 @@
-