IJPL-797 intellij.platform.editor review internal API

GitOrigin-RevId: 008ab023d706e3aa8dfe71ac1d5205f04fb8e71d
This commit is contained in:
Alexandr Trushev
2024-06-11 19:55:05 +02:00
committed by intellij-monorepo-bot
parent 983e11336f
commit 4dcc88eb48
36 changed files with 100 additions and 61 deletions

View File

@@ -81,7 +81,7 @@ public final class MigrationPanel extends JPanel implements Disposable {
myRootsTree = new MyTree();
TypeMigrationTreeStructure structure = new TypeMigrationTreeStructure(project);
structure.setRoots(currentRoot);
StructureTreeModel<?> model = new StructureTreeModel<>(structure, AlphaComparator.INSTANCE, this);
StructureTreeModel<?> model = new StructureTreeModel<>(structure, AlphaComparator.getInstance(), this);
myRootsTree.setModel(new AsyncTreeModel(model, this));
initTree(myRootsTree);

View File

@@ -23,6 +23,6 @@ public final class JavaHierarchyUtil {
public static @NotNull Comparator<NodeDescriptor<?>> getComparator(@NotNull Project project) {
HierarchyBrowserManager.State state = HierarchyBrowserManager.getInstance(project).getState();
return state != null && state.SORT_ALPHABETICALLY ? AlphaComparator.INSTANCE : SourceComparator.INSTANCE;
return state != null && state.SORT_ALPHABETICALLY ? AlphaComparator.getInstance() : SourceComparator.INSTANCE;
}
}

View File

@@ -164,13 +164,13 @@ public class FileNameComparatorTest extends TestCase {
public void testOrder() {
ArrayList<String> shuffled = new ArrayList<>(PATHS);
Collections.shuffle(shuffled);
List<String> sortedPaths = ContainerUtil.sorted(shuffled, FileNameComparator.INSTANCE);
List<String> sortedPaths = ContainerUtil.sorted(shuffled, FileNameComparator.getInstance());
UsefulTestCase.assertOrderedEquals(sortedPaths, PATHS);
}
public void testTransitive1() {
PlatformTestUtil.assertComparisonContractNotViolated(PATHS,
FileNameComparator.INSTANCE,
FileNameComparator.getInstance(),
(path1, path2) -> path1.equals(path2));
}
@@ -194,7 +194,7 @@ public class FileNameComparatorTest extends TestCase {
//System.out.println("Pairs to check: " + names.size() * names.size() * names.size());
PlatformTestUtil.assertComparisonContractNotViolated(names,
FileNameComparator.INSTANCE,
FileNameComparator.getInstance(),
(path1, path2) -> path1.equals(path2));
}
}

View File

@@ -25,7 +25,6 @@ com.intellij.codeInsight.daemon.GutterMark
com.intellij.codeInsight.daemon.NonHideableIconGutterMark
- com.intellij.codeInsight.daemon.GutterMark
a:com.intellij.ide.DataManager
- <init>():V
- a:getDataContext():com.intellij.openapi.actionSystem.DataContext
- a:getDataContext(java.awt.Component):com.intellij.openapi.actionSystem.DataContext
- a:getDataContext(java.awt.Component,I,I):com.intellij.openapi.actionSystem.DataContext
@@ -48,17 +47,6 @@ f:com.intellij.ide.highlighter.HighlighterFactory
- s:createHighlighter(com.intellij.openapi.vfs.VirtualFile,com.intellij.openapi.editor.colors.EditorColorsScheme,com.intellij.openapi.project.Project):com.intellij.openapi.editor.highlighter.EditorHighlighter
f:com.intellij.ide.lightEdit.LightEdit
- s:owns(com.intellij.openapi.project.Project):Z
c:com.intellij.ide.lightEdit.LightEditFilePatterns
- sf:DEFAULT_PATTERNS:java.lang.String[]
- sf:PATTERN_SEPARATOR:java.lang.String
- <init>():V
- equals(java.lang.Object):Z
- getPatterns():java.util.List
- hashCode():I
- match(com.intellij.openapi.vfs.VirtualFile):Z
- s:parse(java.lang.String):com.intellij.ide.lightEdit.LightEditFilePatterns
- setPatterns(java.util.List):V
- toSeparatedString():java.lang.String
*:com.intellij.ide.lightEdit.LightEditService
- sf:WINDOW_NAME:java.lang.String
- a:closeEditorWindow():Z
@@ -86,7 +74,6 @@ c:com.intellij.ide.lightEdit.LightEditFilePatterns
- lightEditWindowClosed(com.intellij.openapi.project.Project):V
- lightEditWindowOpened(com.intellij.openapi.project.Project):V
*:com.intellij.ide.lightEdit.LightEditTabAttributesProvider
- sf:EP_NAME:com.intellij.openapi.extensions.ExtensionPointName
- a:calcAttributes(com.intellij.ide.lightEdit.LightEditorInfo):com.intellij.openapi.editor.markup.TextAttributes
*:com.intellij.ide.lightEdit.LightEditorInfo
- a:getFile():com.intellij.openapi.vfs.VirtualFile
@@ -163,7 +150,6 @@ com.intellij.ide.projectView.SettingsProvider
- a:getSettings():com.intellij.ide.projectView.ViewSettings
com.intellij.ide.projectView.TreeStructureProvider
- com.intellij.openapi.project.PossiblyDumbAware
- sf:EP:com.intellij.openapi.extensions.ProjectExtensionPointName
- getData(java.util.Collection,java.lang.String):java.lang.Object
- a:modify(com.intellij.ide.util.treeView.AbstractTreeNode,java.util.Collection,com.intellij.ide.projectView.ViewSettings):java.util.Collection
com.intellij.ide.projectView.ViewSettings
@@ -206,13 +192,11 @@ com.intellij.ide.structureView.StructureView
- a:restoreState():V
- a:storeState():V
com.intellij.ide.structureView.StructureViewBuilder
- sf:EP_NAME:com.intellij.openapi.extensions.ExtensionPointName
- sf:PROVIDER:com.intellij.ide.structureView.StructureViewBuilderProvider
- a:createStructureView(com.intellij.openapi.fileEditor.FileEditor,com.intellij.openapi.project.Project):com.intellij.ide.structureView.StructureView
com.intellij.ide.structureView.StructureViewBuilderProvider
- a:getStructureViewBuilder(com.intellij.openapi.fileTypes.FileType,com.intellij.openapi.vfs.VirtualFile,com.intellij.openapi.project.Project):com.intellij.ide.structureView.StructureViewBuilder
a:com.intellij.ide.structureView.StructureViewFactory
- <init>():V
- a:createStructureView(com.intellij.openapi.fileEditor.FileEditor,com.intellij.ide.structureView.StructureViewModel,com.intellij.openapi.project.Project):com.intellij.ide.structureView.StructureView
- a:createStructureView(com.intellij.openapi.fileEditor.FileEditor,com.intellij.ide.structureView.StructureViewModel,com.intellij.openapi.project.Project,Z):com.intellij.ide.structureView.StructureView
- s:getInstance(com.intellij.openapi.project.Project):com.intellij.ide.structureView.StructureViewFactory
@@ -310,10 +294,6 @@ c:com.intellij.ide.ui.ColorBlindnessSupport
- <init>():V
- s:get(com.intellij.ide.ui.ColorBlindness):com.intellij.ide.ui.ColorBlindnessSupport
- getFilter():java.awt.image.ImageFilter
f:com.intellij.ide.ui.FontSubpixelResolution
- sf:ENABLED:Z
- sf:RESOLUTION:java.awt.Dimension
- <init>():V
e:com.intellij.ide.ui.NavBarLocation
- java.lang.Enum
- sf:BOTTOM:com.intellij.ide.ui.NavBarLocation
@@ -333,8 +313,6 @@ f:com.intellij.ide.ui.NotRoamableUiOptions
- f:overrideLafFontsWasMigrated:Z
- f:presentationModeIdeScale:F
- <init>():V
- <init>(com.intellij.ide.ui.AntialiasingType,com.intellij.ide.ui.AntialiasingType,java.lang.String,F,F,F,F,Z,Z,Z):V
- b:<init>(com.intellij.ide.ui.AntialiasingType,com.intellij.ide.ui.AntialiasingType,java.lang.String,F,F,F,F,Z,Z,Z,I,kotlin.jvm.internal.DefaultConstructorMarker):V
- f:component1():com.intellij.ide.ui.AntialiasingType
- f:component10():Z
- f:component2():com.intellij.ide.ui.AntialiasingType
@@ -351,7 +329,6 @@ f:com.intellij.ide.ui.NotRoamableUiOptions
- hashCode():I
f:com.intellij.ide.ui.NotRoamableUiSettings
- com.intellij.openapi.components.SerializablePersistentStateComponent
- sf:COMPONENT_NAME:java.lang.String
- sf:Companion:com.intellij.ide.ui.NotRoamableUiSettings$Companion
- <init>():V
- f:getEditorAAType():com.intellij.ide.ui.AntialiasingType
@@ -872,20 +849,21 @@ f:com.intellij.ide.util.treeView.AlphaComparator
- java.util.Comparator
- sf:INSTANCE:com.intellij.ide.util.treeView.AlphaComparator
- compare(com.intellij.ide.util.treeView.NodeDescriptor,com.intellij.ide.util.treeView.NodeDescriptor):I
- s:getInstance():com.intellij.ide.util.treeView.AlphaComparator
c:com.intellij.ide.util.treeView.FileNameComparator
- java.util.Comparator
- sf:INSTANCE:java.util.Comparator
- <init>():V
- compare(java.lang.String,java.lang.String):I
- s:getInstance():java.util.Comparator
f:com.intellij.ide.util.treeView.IndexComparator
- java.util.Comparator
- sf:INSTANCE:com.intellij.ide.util.treeView.IndexComparator
- compare(com.intellij.ide.util.treeView.NodeDescriptor,com.intellij.ide.util.treeView.NodeDescriptor):I
- s:getInstance():com.intellij.ide.util.treeView.IndexComparator
com.intellij.ide.util.treeView.InplaceCommentAppender
- a:append(java.lang.String,com.intellij.ui.SimpleTextAttributes):V
a:com.intellij.ide.util.treeView.NodeDescriptor
- sf:DEFAULT_WEIGHT:I
- sf:EMPTY_ARRAY:com.intellij.ide.util.treeView.NodeDescriptor[]
- p:myClosedIcon:javax.swing.Icon
- p:myColor:java.awt.Color
- p:myName:java.lang.String
@@ -895,7 +873,9 @@ a:com.intellij.ide.util.treeView.NodeDescriptor
- expandOnDoubleClick():Z
- f:getChildrenSortingStamp():J
- f:getColor():java.awt.Color
- s:getDefaultWeight():I
- a:getElement():java.lang.Object
- s:getEmptyArray():com.intellij.ide.util.treeView.NodeDescriptor[]
- f:getIcon():javax.swing.Icon
- getIndex():I
- getParentDescriptor():com.intellij.ide.util.treeView.NodeDescriptor
@@ -976,7 +956,6 @@ c:com.intellij.ide.util.treeView.PresentableNodeDescriptor$ColoredFragment
- getToolTip():java.lang.String
- hashCode():I
c:com.intellij.ide.util.treeView.TreeAnchorizer
- <init>():V
- s:anchorizeList(java.util.Collection):java.util.List
- createAnchor(java.lang.Object):java.lang.Object
- freeAnchor(java.lang.Object):V

View File

@@ -1 +0,0 @@
kotlin/jvm/internal/DefaultConstructorMarker

View File

@@ -32,6 +32,10 @@ public abstract class DataManager {
private static final String CLIENT_PROPERTY_DATA_PROVIDER = "DataProvider";
@ApiStatus.Internal
protected DataManager() {
}
/**
* @return {@link DataContext} constructed by the currently focused component
* @deprecated use either {@link #getDataContext(Component)} or {@link #getDataContextFromFocus()}

View File

@@ -6,12 +6,14 @@ import com.intellij.openapi.util.NlsSafe;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jps.model.fileTypes.FileNameMatcherFactory;
import java.util.*;
import java.util.stream.Collectors;
@ApiStatus.Internal
public class LightEditFilePatterns {
public static final String[] DEFAULT_PATTERNS = {
"*.txt", "*.log", "*.md", "*.json", "*.xml", "*.sh", "*.ini", "*.yml", "*.conf"};

View File

@@ -9,6 +9,8 @@ import org.jetbrains.annotations.Nullable;
@ApiStatus.Experimental
public interface LightEditTabAttributesProvider {
@ApiStatus.Internal
ExtensionPointName<LightEditTabAttributesProvider> EP_NAME
= ExtensionPointName.create("com.intellij.lightEditTabAttributesProvider");

View File

@@ -4,6 +4,7 @@ package com.intellij.ide.projectView;
import com.intellij.ide.util.treeView.AbstractTreeNode;
import com.intellij.openapi.extensions.ProjectExtensionPointName;
import com.intellij.openapi.project.PossiblyDumbAware;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -17,6 +18,8 @@ import java.util.Collection;
* @see ProjectViewNodeDecorator
*/
public interface TreeStructureProvider extends PossiblyDumbAware {
@ApiStatus.Internal
ProjectExtensionPointName<TreeStructureProvider> EP = new ProjectExtensionPointName<>("com.intellij.treeStructureProvider");
/**

View File

@@ -6,6 +6,7 @@ import com.intellij.openapi.extensions.KeyedFactoryEPBean;
import com.intellij.openapi.fileEditor.FileEditor;
import com.intellij.openapi.fileTypes.FileTypeExtensionFactory;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -22,6 +23,8 @@ import org.jetbrains.annotations.Nullable;
*/
public interface StructureViewBuilder {
@ApiStatus.Internal
ExtensionPointName<KeyedFactoryEPBean> EP_NAME = ExtensionPointName.create("com.intellij.structureViewBuilder");
StructureViewBuilderProvider PROVIDER =

View File

@@ -3,6 +3,7 @@ package com.intellij.ide.structureView;
import com.intellij.openapi.fileEditor.FileEditor;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
/**
@@ -38,4 +39,8 @@ public abstract class StructureViewFactory {
public static StructureViewFactory getInstance(Project project) {
return project.getService(StructureViewFactory.class);
}
@ApiStatus.Internal
protected StructureViewFactory() {
}
}

View File

@@ -2,10 +2,12 @@
package com.intellij.ide.ui;
import com.intellij.openapi.diagnostic.Logger;
import org.jetbrains.annotations.ApiStatus;
import java.awt.*;
import java.lang.reflect.Field;
@ApiStatus.Internal
public final class FontSubpixelResolution {
private static final Logger LOG = Logger.getInstance(FontSubpixelResolution.class);

View File

@@ -18,7 +18,7 @@ class NotRoamableUiSettings : SerializablePersistentStateComponent<NotRoamableUi
companion object {
fun getInstance(): NotRoamableUiSettings = ApplicationManager.getApplication().service<NotRoamableUiSettings>()
const val COMPONENT_NAME: String = "NotRoamableUiSettings"
internal const val COMPONENT_NAME: String = "NotRoamableUiSettings"
}
var ideScale: Float
@@ -130,7 +130,7 @@ class NotRoamableUiSettings : SerializablePersistentStateComponent<NotRoamableUi
}
}
data class NotRoamableUiOptions(
data class NotRoamableUiOptions internal constructor(
@JvmField @OptionTag val ideAAType: AntialiasingType = if (AntialiasingType.canUseSubpixelAAForIDE()) AntialiasingType.SUBPIXEL else AntialiasingType.GREYSCALE,
@JvmField @OptionTag val editorAAType: AntialiasingType = if (AntialiasingType.canUseSubpixelAAForEditor()) AntialiasingType.SUBPIXEL else AntialiasingType.GREYSCALE,

View File

@@ -4,8 +4,17 @@ package com.intellij.ide.util.treeView;
import java.util.Comparator;
public final class AlphaComparator implements Comparator<NodeDescriptor<?>> {
/**
* @deprecated use {@link #getInstance()} instead
*/
@Deprecated
public static final AlphaComparator INSTANCE = new AlphaComparator();
public static AlphaComparator getInstance() {
return INSTANCE;
}
private AlphaComparator() {
}
@@ -21,6 +30,6 @@ public final class AlphaComparator implements Comparator<NodeDescriptor<?>> {
if (s1 == null) return s2 == null ? 0 : -1;
if (s2 == null) return +1;
return FileNameComparator.INSTANCE.compare(s1, s2);
return FileNameComparator.getInstance().compare(s1, s2);
}
}

View File

@@ -6,8 +6,17 @@ import com.intellij.openapi.util.text.NaturalComparator;
import java.util.Comparator;
public class FileNameComparator implements Comparator<String> {
/**
* @deprecated use {@link #getInstance()} instead
*/
@Deprecated
public static final Comparator<String> INSTANCE = new FileNameComparator();
public static Comparator<String> getInstance() {
return INSTANCE;
}
@Override
public int compare(String s1, String s2) {
return NaturalComparator.naturalCompare(s1, s2, s1.length(), s2.length(), true, true);

View File

@@ -5,8 +5,17 @@ package com.intellij.ide.util.treeView;
import java.util.Comparator;
public final class IndexComparator implements Comparator<NodeDescriptor<?>> {
/**
* @deprecated use {@link #getInstance()} instead
*/
@Deprecated
public static final IndexComparator INSTANCE = new IndexComparator();
public static IndexComparator getInstance() {
return INSTANCE;
}
private IndexComparator() {}
@Override

View File

@@ -11,8 +11,16 @@ import java.awt.*;
import java.util.Comparator;
public abstract class NodeDescriptor<E> {
public static final NodeDescriptor<?>[] EMPTY_ARRAY = new NodeDescriptor[0];
public static final int DEFAULT_WEIGHT = 30;
private static final NodeDescriptor<?>[] EMPTY_ARRAY = new NodeDescriptor[0];
private static final int DEFAULT_WEIGHT = 30;
public static NodeDescriptor<?>[] getEmptyArray() {
return EMPTY_ARRAY;
}
public static int getDefaultWeight() {
return DEFAULT_WEIGHT;
}
protected final Project myProject;
private final NodeDescriptor<?> myParentDescriptor;
@@ -84,7 +92,7 @@ public abstract class NodeDescriptor<E> {
if (element instanceof WeighedItem) {
return ((WeighedItem) element).getWeight();
}
return DEFAULT_WEIGHT;
return getDefaultWeight();
}
public final long getChildrenSortingStamp() {

View File

@@ -3,6 +3,7 @@ package com.intellij.ide.util.treeView;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -26,6 +27,10 @@ public class TreeAnchorizer {
return result;
}
@ApiStatus.Internal
protected TreeAnchorizer() {
}
public @NotNull Object createAnchor(@NotNull Object element) {
return element;
}

View File

@@ -41,7 +41,7 @@ public class DefaultNewRunConfigurationTreePopupFactory extends NewRunConfigurat
public void initStructure(@NotNull Project project) {
root = createDescriptor(project, "<invisible-templates-root>", null);
other = createDescriptor(project, ExecutionBundle.message("add.new.run.configuration.other.types.node.text"), root,
NodeDescriptor.DEFAULT_WEIGHT + 1);
NodeDescriptor.getDefaultWeight() + 1);
myTypesToShow = new ArrayList<>(
RunConfigurable.Companion.configurationTypeSorted(project, true,
ConfigurationType.CONFIGURATION_TYPE_EP.getExtensionList(), true));
@@ -95,14 +95,14 @@ public class DefaultNewRunConfigurationTreePopupFactory extends NewRunConfigurat
if (!myOtherTypes.isEmpty()) {
list.add(other);
}
return list.toArray(NodeDescriptor.EMPTY_ARRAY);
return list.toArray(NodeDescriptor.getEmptyArray());
}
else if (nodeDescriptor instanceof GroupDescriptor) {
ArrayList<NodeDescriptor> list = new ArrayList<>();
for (ConfigurationType type : ((GroupDescriptor)nodeDescriptor).myTypes) {
list.add(createDescriptor(project, type, nodeDescriptor));
}
return list.toArray(NodeDescriptor.EMPTY_ARRAY);
return list.toArray(NodeDescriptor.getEmptyArray());
}
else if (other.equals(nodeDescriptor)) {
return convertToDescriptors(project, nodeDescriptor, myOtherTypes.toArray());
@@ -113,7 +113,7 @@ public class DefaultNewRunConfigurationTreePopupFactory extends NewRunConfigurat
return convertToDescriptors(project, nodeDescriptor, factories);
}
}
return NodeDescriptor.EMPTY_ARRAY;
return NodeDescriptor.getEmptyArray();
}
@@ -143,7 +143,7 @@ public class DefaultNewRunConfigurationTreePopupFactory extends NewRunConfigurat
@Override
public int getWeight() {
return DEFAULT_WEIGHT - 1;
return getDefaultWeight() - 1;
}
}
}

View File

@@ -199,7 +199,7 @@ public final class NewRunConfigurationPopup {
@Override
public @NotNull NodeDescriptor<?> createDescriptor(@NotNull Object element, @Nullable NodeDescriptor parentDescriptor) {
return treePopupFactory.createDescriptor(project, element, parentDescriptor, NodeDescriptor.DEFAULT_WEIGHT);
return treePopupFactory.createDescriptor(project, element, parentDescriptor, NodeDescriptor.getDefaultWeight());
}
@Override

View File

@@ -30,7 +30,7 @@ public abstract class NewRunConfigurationTreePopupFactory {
for (Object element : elements) {
descriptors.add(createDescriptor(project, element, parent));
}
return descriptors.toArray(NodeDescriptor.EMPTY_ARRAY);
return descriptors.toArray(NodeDescriptor.getEmptyArray());
}
//This method is supposed to be called just once for each node, the result goes to cache
@@ -51,7 +51,7 @@ public abstract class NewRunConfigurationTreePopupFactory {
public final @NotNull NodeDescriptor createDescriptor(@NotNull Project project,
@NotNull Object element,
@Nullable NodeDescriptor parentDescriptor) {
return createDescriptor(project, element, parentDescriptor, NodeDescriptor.DEFAULT_WEIGHT);
return createDescriptor(project, element, parentDescriptor, NodeDescriptor.getDefaultWeight());
}
public @NotNull NodeDescriptor createDescriptor(@NotNull Project project,

View File

@@ -99,7 +99,7 @@ public class GroupByTypeComparator implements Comparator<NodeDescriptor<?>> {
}
if (descriptor1 == null) return -1;
if (descriptor2 == null) return 1;
return AlphaComparator.INSTANCE.compare(descriptor1, descriptor2);
return AlphaComparator.getInstance().compare(descriptor1, descriptor2);
}
private NodeDescriptor<?> getUpdatedDescriptor(NodeDescriptor<?> descriptor) {

View File

@@ -111,7 +111,7 @@ public abstract class AbstractTreeClassChooserDialog<T extends PsiNamedElement>
myScope = scope;
myElementClass = elementClass;
myClassFilter = classFilter == null ? allFilter() : classFilter;
myComparator = comparator == null ? AlphaComparator.INSTANCE : comparator;
myComparator = comparator == null ? AlphaComparator.getInstance() : comparator;
myBaseClass = baseClass;
myInitialClass = initialClass;
myIsShowMembers = isShowMembers;

View File

@@ -95,7 +95,7 @@ public final class TreeFileChooserDialog extends DialogWrapper implements TreeFi
myInitialFile = initialFile;
myFilter = filter;
myFileType = fileType;
myComparator = comparator == null ? AlphaComparator.INSTANCE : comparator;
myComparator = comparator == null ? AlphaComparator.getInstance() : comparator;
myDisableStructureProviders = disableStructureProviders;
myShowLibraryContents = showLibraryContents;
setTitle(title);

View File

@@ -19,7 +19,7 @@ public final class SliceTreeBuilder {
public static final Comparator<NodeDescriptor<?>> SLICE_NODE_COMPARATOR = (o1, o2) -> {
if (!(o1 instanceof SliceNode node1) || !(o2 instanceof SliceNode node2)) {
return AlphaComparator.INSTANCE.compare(o1, o2);
return AlphaComparator.getInstance().compare(o1, o2);
}
SliceUsage usage1 = node1.getValue();
SliceUsage usage2 = node2.getValue();

View File

@@ -165,7 +165,7 @@ public class SMTestRunnerResultsForm extends TestResultsPanel
myTreeView.setTestResultsViewer(this);
final SMTRunnerTreeStructure structure = new SMTRunnerTreeStructure(myProject, myTestsRootNode);
myTreeBuilder = new SMTRunnerTreeBuilder(myTreeView, structure);
StructureTreeModel structureTreeModel = new StructureTreeModel<>(structure, IndexComparator.INSTANCE, myProject);
StructureTreeModel structureTreeModel = new StructureTreeModel<>(structure, IndexComparator.getInstance(), myProject);
AsyncTreeModel asyncTreeModel = new AsyncTreeModel(structureTreeModel, true, myProject);
myTreeView.setModel(asyncTreeModel);
myTreeBuilder.setModel(structureTreeModel);

View File

@@ -47,7 +47,7 @@ public interface TestFrameworkRunningModel extends Disposable {
};
}
else {
comparator = TestConsoleProperties.SORT_ALPHABETICALLY.value(properties) ? AlphaComparator.INSTANCE : null;
comparator = TestConsoleProperties.SORT_ALPHABETICALLY.value(properties) ? AlphaComparator.getInstance() : null;
}
return comparator;
}

View File

@@ -37,7 +37,7 @@ public class HierarchicalFilePathComparator implements Comparator<FilePath> {
public static final HierarchicalFilePathComparator NATURAL = new HierarchicalFilePathComparator(true) {
@Override
protected int compareFileNames(@NotNull CharSequence name1, @NotNull CharSequence name2) {
return FileNameComparator.INSTANCE.compare(name1.toString(), name2.toString());
return FileNameComparator.getInstance().compare(name1.toString(), name2.toString());
}
};

View File

@@ -350,7 +350,7 @@ public abstract class ChangesBrowserNode<T> extends DefaultMutableTreeNode imple
}
protected static int compareFileNames(@NotNull String name1, @NotNull String name2) {
return FileNameComparator.INSTANCE.compare(name1, name2);
return FileNameComparator.getInstance().compare(name1, name2);
}
public static int compareFilePaths(@NotNull FilePath path1, @NotNull FilePath path2) {

View File

@@ -38,7 +38,7 @@ public final class ChangesComparator {
private static int comparePaths(@NotNull FilePath filePath1, @NotNull FilePath filePath2, boolean flattened) {
if (flattened) {
int delta = FileNameComparator.INSTANCE.compare(filePath1.getName(), filePath2.getName());
int delta = FileNameComparator.getInstance().compare(filePath1.getName(), filePath2.getName());
if (delta != 0) return delta;
}
return HierarchicalFilePathComparator.NATURAL.compare(filePath1, filePath2);

View File

@@ -365,7 +365,7 @@ public abstract class AbstractListBuilder implements Disposable {
resultDescriptors.sort(myComparator);
}
else {
resultDescriptors.sort(IndexComparator.INSTANCE);
resultDescriptors.sort(IndexComparator.getInstance());
}
if (shouldAddTopElement()) {

View File

@@ -310,7 +310,7 @@ public class Commander extends JPanel implements PersistentStateComponent<Elemen
panel.getList().addKeyListener(new PsiCopyPasteManager.EscapeHandler());
final ProjectAbstractTreeStructureBase treeStructure = createProjectTreeStructure();
panel.setBuilder(new ProjectListBuilder(project, panel, treeStructure, AlphaComparator.INSTANCE, true));
panel.setBuilder(new ProjectListBuilder(project, panel, treeStructure, AlphaComparator.getInstance(), true));
panel.setProjectTreeStructure(treeStructure);
final FocusAdapter focusListener = new FocusAdapter() {

View File

@@ -15,7 +15,7 @@ public final class ElementColumnInfo extends ColumnInfo<NodeDescriptor<?>, Strin
@Override
public Comparator<NodeDescriptor<?>> getComparator() {
return AlphaComparator.INSTANCE;
return AlphaComparator.getInstance();
}
@Override

View File

@@ -197,7 +197,7 @@ public class PsiViewerDialog extends DialogWrapper implements DataProvider {
});
myTreeStructure = new ViewerTreeStructure(myProject);
myStructureTreeModel = new StructureTreeModel<>(myTreeStructure, IndexComparator.INSTANCE, getDisposable());
myStructureTreeModel = new StructureTreeModel<>(myTreeStructure, IndexComparator.getInstance(), getDisposable());
AsyncTreeModel asyncTreeModel = new AsyncTreeModel(myStructureTreeModel, getDisposable());
myPsiTree.setModel(asyncTreeModel);

View File

@@ -80,7 +80,7 @@ class PsiViewerDebugPanel(
setShowTreeNodes(settings.showTreeNodes)
}
private val structureTreeModel = StructureTreeModel(treeStructure, IndexComparator.INSTANCE, this)
private val structureTreeModel = StructureTreeModel(treeStructure, IndexComparator.getInstance(), this)
private val psiTree = Tree()

View File

@@ -17,7 +17,7 @@ public final class PyHierarchyUtils {
public static @NotNull Comparator<NodeDescriptor<?>> getComparator(final Project project) {
if (HierarchyBrowserManager.getInstance(project).getState().SORT_ALPHABETICALLY) {
return AlphaComparator.INSTANCE;
return AlphaComparator.getInstance();
}
else {
return NODE_DESCRIPTOR_COMPARATOR;