From 96952b1a127a0ce105751f5a6972148e01c871fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann=20C=C3=A9bron?= Date: Thu, 13 Jun 2019 15:30:07 +0200 Subject: [PATCH] [editor-ui-api] fix deprecation problems GitOrigin-RevId: 8378c8ce27b453673250d38793e1ded90413caab --- .../BackgroundEditorHighlighter.java | 19 ++++----------- .../ide/projectView/RootsProvider.java | 7 ++++-- .../intellij/ide/ui/LCDRenderingScope.java | 23 ++++--------------- .../ide/util/treeView/NodeDescriptor.java | 8 +++---- .../openapi/actionSystem/ActionManager.java | 5 +++- .../openapi/actionSystem/AnActionEvent.java | 5 +++- .../intellij/openapi/editor/FoldingModel.java | 2 +- .../openapi/editor/IndentStrategy.java | 10 ++++---- .../openapi/editor/colors/EditorColors.java | 3 +++ .../editor/colors/EditorColorsManager.java | 5 +++- .../editor/colors/EditorColorsScheme.java | 6 +++++ .../openapi/fileTypes/SyntaxHighlighter.java | 11 +++++---- .../com/intellij/openapi/vcs/FileStatus.java | 9 +++++++- .../ui/switcher/QuickAccessProvider.java | 8 ++++++- 14 files changed, 66 insertions(+), 55 deletions(-) diff --git a/platform/editor-ui-api/src/com/intellij/codeHighlighting/BackgroundEditorHighlighter.java b/platform/editor-ui-api/src/com/intellij/codeHighlighting/BackgroundEditorHighlighter.java index 1fc03e5a9853..2b04f23bdb1d 100644 --- a/platform/editor-ui-api/src/com/intellij/codeHighlighting/BackgroundEditorHighlighter.java +++ b/platform/editor-ui-api/src/com/intellij/codeHighlighting/BackgroundEditorHighlighter.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2015 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. - */ +// Copyright 2000-2019 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.codeHighlighting; import org.jetbrains.annotations.NotNull; @@ -21,6 +7,9 @@ public interface BackgroundEditorHighlighter { @NotNull HighlightingPass[] createPassesForEditor(); + /** + * @deprecated unused + */ @Deprecated @NotNull HighlightingPass[] createPassesForVisibleArea(); diff --git a/platform/editor-ui-api/src/com/intellij/ide/projectView/RootsProvider.java b/platform/editor-ui-api/src/com/intellij/ide/projectView/RootsProvider.java index 2a10d0211383..f621a0a4e788 100644 --- a/platform/editor-ui-api/src/com/intellij/ide/projectView/RootsProvider.java +++ b/platform/editor-ui-api/src/com/intellij/ide/projectView/RootsProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2019 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,11 +23,14 @@ import java.util.Collections; import java.util.Set; /** - * This interface specifies that the element corresponds to several virtual files. + * Specifies that the element corresponds to several virtual files. * For example, a package may correspond to several folders in a project, * or a resource bundle may correspond to several properties files. */ public interface RootsProvider { + /** + * @deprecated use {@link Collections#emptySet()} + */ @Deprecated Set EMPTY_ROOTS = Collections.emptySet(); diff --git a/platform/editor-ui-api/src/com/intellij/ide/ui/LCDRenderingScope.java b/platform/editor-ui-api/src/com/intellij/ide/ui/LCDRenderingScope.java index 8b6ac71a8f66..da584db9618b 100644 --- a/platform/editor-ui-api/src/com/intellij/ide/ui/LCDRenderingScope.java +++ b/platform/editor-ui-api/src/com/intellij/ide/ui/LCDRenderingScope.java @@ -1,27 +1,12 @@ -/* - * Copyright 2000-2015 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. - */ +// Copyright 2000-2019 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.ui; -// Use AntialiasingType instead +/** + * @deprecated use {@link AntialiasingType} instead + */ @Deprecated public enum LCDRenderingScope { - @Deprecated IDE, - @Deprecated EXCLUDING_EDITOR, - @Deprecated OFF } diff --git a/platform/editor-ui-api/src/com/intellij/ide/util/treeView/NodeDescriptor.java b/platform/editor-ui-api/src/com/intellij/ide/util/treeView/NodeDescriptor.java index 448f81c36435..4dfacc07f673 100644 --- a/platform/editor-ui-api/src/com/intellij/ide/util/treeView/NodeDescriptor.java +++ b/platform/editor-ui-api/src/com/intellij/ide/util/treeView/NodeDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2019 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. @@ -31,7 +31,7 @@ public abstract class NodeDescriptor { @Nullable protected Icon myClosedIcon; /** - * Unused. It's there only for API compatibility. + * @deprecated Unused. Left for API compatibility. */ @Deprecated protected Icon myOpenIcon; @@ -80,7 +80,7 @@ public abstract class NodeDescriptor { } /** - Use #getIcon() instead + * @deprecated Use {@link #getIcon()} instead */ @Deprecated public final Icon getOpenIcon() { @@ -88,7 +88,7 @@ public abstract class NodeDescriptor { } /** - Use #getIcon() instead + * @deprecated Use {@link #getIcon()} instead */ @Deprecated public final Icon getClosedIcon() { diff --git a/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/ActionManager.java b/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/ActionManager.java index a36761d307bf..7bf887732179 100644 --- a/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/ActionManager.java +++ b/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/ActionManager.java @@ -152,7 +152,7 @@ public abstract class ActionManager { @Nullable String place, boolean now); /** - * Use {@link AnActionListener#TOPIC} + * @deprecated Use {@link AnActionListener#TOPIC} */ @Deprecated public abstract void addAnActionListener(AnActionListener listener); @@ -165,6 +165,9 @@ public abstract class ActionManager { ApplicationManager.getApplication().getMessageBus().connect(parentDisposable).subscribe(AnActionListener.TOPIC, listener); } + /** + * @deprecated Use {@link AnActionListener#TOPIC} + */ @Deprecated public abstract void removeAnActionListener(AnActionListener listener); diff --git a/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/AnActionEvent.java b/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/AnActionEvent.java index 2a9843a65873..6d15571e5257 100644 --- a/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/AnActionEvent.java +++ b/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/AnActionEvent.java @@ -1,4 +1,4 @@ -// 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. +// Copyright 2000-2019 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.openapi.actionSystem; import com.intellij.ide.DataManager; @@ -75,6 +75,9 @@ public class AnActionEvent implements PlaceProvider { } + /** + * @deprecated use {@link #createFromInputEvent(InputEvent, String, Presentation, DataContext, boolean, boolean)} + */ @Deprecated @NotNull public static AnActionEvent createFromInputEvent(@NotNull AnAction action, @Nullable InputEvent event, @NotNull String place) { diff --git a/platform/editor-ui-api/src/com/intellij/openapi/editor/FoldingModel.java b/platform/editor-ui-api/src/com/intellij/openapi/editor/FoldingModel.java index 6d5f60db696b..ace1160ddfc4 100644 --- a/platform/editor-ui-api/src/com/intellij/openapi/editor/FoldingModel.java +++ b/platform/editor-ui-api/src/com/intellij/openapi/editor/FoldingModel.java @@ -40,7 +40,7 @@ public interface FoldingModel { FoldRegion addFoldRegion(int startOffset, int endOffset, @NotNull String placeholderText); /** - * Do nothing + * @deprecated Does nothing * TODO to remove in IDEA 2018 */ @Deprecated diff --git a/platform/editor-ui-api/src/com/intellij/openapi/editor/IndentStrategy.java b/platform/editor-ui-api/src/com/intellij/openapi/editor/IndentStrategy.java index 619eb8a4fe6c..ac185d16e459 100644 --- a/platform/editor-ui-api/src/com/intellij/openapi/editor/IndentStrategy.java +++ b/platform/editor-ui-api/src/com/intellij/openapi/editor/IndentStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2019 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 org.jetbrains.annotations.NotNull; /** * Defines whether or not some elements can be indented when a user selects a fragment of text and invokes "indent" action (normally by - * pressing [TAB]). The elements which are said to be unmovable (canIndent() returns false) do not change their indentation. This may be - * useful for cases like HEREDOC text handling. + * pressing [TAB]). The elements which are said to be unmovable ({@link #canIndent(int, int, PsiElement)} returns {@code false}) do not change their indentation. + * This may be useful for cases like HEREDOC text handling. * * @author Rustam Vishnyakov */ @@ -29,7 +29,9 @@ public interface IndentStrategy { /** * @deprecated use {@link #canIndent(int, int, PsiElement)} */ - default boolean canIndent(@NotNull PsiElement element) { + @SuppressWarnings("DeprecatedIsStillUsed") + @Deprecated + default boolean canIndent(@SuppressWarnings("unused") @NotNull PsiElement element) { return true; } diff --git a/platform/editor-ui-api/src/com/intellij/openapi/editor/colors/EditorColors.java b/platform/editor-ui-api/src/com/intellij/openapi/editor/colors/EditorColors.java index fb44a07aa32f..6d0e4c61f266 100644 --- a/platform/editor-ui-api/src/com/intellij/openapi/editor/colors/EditorColors.java +++ b/platform/editor-ui-api/src/com/intellij/openapi/editor/colors/EditorColors.java @@ -39,6 +39,9 @@ public interface EditorColors { TextAttributesKey DELETED_TEXT_ATTRIBUTES = TextAttributesKey.createTextAttributesKey("DELETED_TEXT_ATTRIBUTES"); ColorKey GUTTER_BACKGROUND = ColorKey.createColorKey("GUTTER_BACKGROUND", new JBColor(0xf0f0f0, 0x313335)); + /** + * @deprecated use {@link #GUTTER_BACKGROUND} + */ @Deprecated ColorKey LEFT_GUTTER_BACKGROUND = GUTTER_BACKGROUND; ColorKey NOTIFICATION_BACKGROUND = ColorKey.createColorKey("NOTIFICATION_BACKGROUND"); diff --git a/platform/editor-ui-api/src/com/intellij/openapi/editor/colors/EditorColorsManager.java b/platform/editor-ui-api/src/com/intellij/openapi/editor/colors/EditorColorsManager.java index d23ab0435026..5362db26d219 100644 --- a/platform/editor-ui-api/src/com/intellij/openapi/editor/colors/EditorColorsManager.java +++ b/platform/editor-ui-api/src/com/intellij/openapi/editor/colors/EditorColorsManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2019 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. @@ -38,6 +38,9 @@ public abstract class EditorColorsManager { public abstract void addColorsScheme(@NotNull EditorColorsScheme scheme); + /** + * @deprecated Does nothing, left for API compatibility. + */ @Deprecated public abstract void removeAllSchemes(); diff --git a/platform/editor-ui-api/src/com/intellij/openapi/editor/colors/EditorColorsScheme.java b/platform/editor-ui-api/src/com/intellij/openapi/editor/colors/EditorColorsScheme.java index ab8246909dfc..2baa829f3401 100644 --- a/platform/editor-ui-api/src/com/intellij/openapi/editor/colors/EditorColorsScheme.java +++ b/platform/editor-ui-api/src/com/intellij/openapi/editor/colors/EditorColorsScheme.java @@ -58,9 +58,15 @@ public interface EditorColorsScheme extends Cloneable, TextAttributesScheme, Sch */ void setEditorFontSize(int fontSize); + /** + * @deprecated stored in application level property + */ @Deprecated FontSize getQuickDocFontSize(); + /** + * @deprecated stored in application level property + */ @Deprecated void setQuickDocFontSize(@NotNull FontSize fontSize); diff --git a/platform/editor-ui-api/src/com/intellij/openapi/fileTypes/SyntaxHighlighter.java b/platform/editor-ui-api/src/com/intellij/openapi/fileTypes/SyntaxHighlighter.java index f6e4b770474e..1c1030ef39ca 100644 --- a/platform/editor-ui-api/src/com/intellij/openapi/fileTypes/SyntaxHighlighter.java +++ b/platform/editor-ui-api/src/com/intellij/openapi/fileTypes/SyntaxHighlighter.java @@ -32,12 +32,13 @@ public interface SyntaxHighlighter { ExtensionPointName EP_NAME = ExtensionPointName.create("com.intellij.syntaxHighlighter"); /** - * @deprecated - * @see SyntaxHighlighterFactory#getSyntaxHighlighter(com.intellij.openapi.project.Project, com.intellij.openapi.vfs.VirtualFile) - * @see SyntaxHighlighterFactory#getSyntaxHighlighter(com.intellij.lang.Language, com.intellij.openapi.project.Project, com.intellij.openapi.vfs.VirtualFile) + * @deprecated see + * {@link SyntaxHighlighterFactory#getSyntaxHighlighter(com.intellij.openapi.project.Project, com.intellij.openapi.vfs.VirtualFile)} and + * {@link SyntaxHighlighterFactory#getSyntaxHighlighter(com.intellij.lang.Language, com.intellij.openapi.project.Project, com.intellij.openapi.vfs.VirtualFile)} */ - @Deprecated SyntaxHighlighterProvider PROVIDER = - new FileTypeExtensionFactory<>(SyntaxHighlighterProvider.class, EP_NAME).get(); + @SuppressWarnings("DeprecatedIsStillUsed") + @Deprecated + SyntaxHighlighterProvider PROVIDER = new FileTypeExtensionFactory<>(SyntaxHighlighterProvider.class, EP_NAME).get(); /** * Returns the lexer used for highlighting the file. The lexer is invoked incrementally when the file is changed, so it must be diff --git a/platform/editor-ui-api/src/com/intellij/openapi/vcs/FileStatus.java b/platform/editor-ui-api/src/com/intellij/openapi/vcs/FileStatus.java index f25fa7867702..78541f21366c 100644 --- a/platform/editor-ui-api/src/com/intellij/openapi/vcs/FileStatus.java +++ b/platform/editor-ui-api/src/com/intellij/openapi/vcs/FileStatus.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2019 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,12 +23,19 @@ import java.awt.*; @SuppressWarnings("UseJBColor") public interface FileStatus { + /** @deprecated use {@link FileStatus#getColor} */ @Deprecated Color COLOR_MERGE = new Color(117, 3, 220); + /** @deprecated use {@link FileStatus#getColor} */ @Deprecated Color COLOR_MODIFIED = new Color(0, 50, 160); + /** @deprecated use {@link FileStatus#getColor} */ @Deprecated Color COLOR_MISSING = Gray._97; + /** @deprecated use {@link FileStatus#getColor} */ @Deprecated Color COLOR_ADDED = new Color(10, 119, 0); + /** @deprecated use {@link FileStatus#getColor} */ @Deprecated Color COLOR_OUT_OF_DATE = Color.yellow.darker().darker(); + /** @deprecated use {@link FileStatus#getColor} */ @Deprecated Color COLOR_SWITCHED = new Color(8, 151, 143); + /** @deprecated use {@link FileStatus#getColor} */ @Deprecated Color COLOR_UNKNOWN = new Color(153, 51, 0); FileStatus NOT_CHANGED = FileStatusFactory.getInstance().createFileStatus("NOT_CHANGED", VcsBundle.message("file.status.name.up.to.date")); diff --git a/platform/editor-ui-api/src/com/intellij/ui/switcher/QuickAccessProvider.java b/platform/editor-ui-api/src/com/intellij/ui/switcher/QuickAccessProvider.java index 8eab007ebf6f..f57d4680bd2e 100644 --- a/platform/editor-ui-api/src/com/intellij/ui/switcher/QuickAccessProvider.java +++ b/platform/editor-ui-api/src/com/intellij/ui/switcher/QuickAccessProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2019 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. @@ -15,9 +15,15 @@ */ package com.intellij.ui.switcher; +import org.jetbrains.annotations.ApiStatus; + import javax.swing.*; +/** + * @deprecated unused + */ @Deprecated +@ApiStatus.ScheduledForRemoval(inVersion = "2020.1") public interface QuickAccessProvider { JComponent getComponent();