[platform-api] fix deprecation problems

GitOrigin-RevId: 45b825e0330d0d2d49de86a6250da10265d71abf
This commit is contained in:
Yann Cébron
2019-06-13 20:19:50 +03:00
committed by intellij-monorepo-bot
parent 6e34c4a259
commit 4d668ffa28
36 changed files with 146 additions and 59 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2017 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.
@@ -19,7 +19,7 @@ import com.intellij.ide.BrowserUtil;
import com.intellij.openapi.project.Project;
/**
* Consider to use OpenUrlHyperlinkInfo.
* Consider to use {@link com.intellij.ide.browsers.OpenUrlHyperlinkInfo}.
*/
public class BrowserHyperlinkInfo implements HyperlinkInfo {
private final String myUrl;
@@ -33,6 +33,9 @@ public class BrowserHyperlinkInfo implements HyperlinkInfo {
BrowserUtil.browse(myUrl);
}
/**
* @deprecated use {@link BrowserUtil#browse(String)}
*/
@Deprecated
public static void openUrl(String url) {
BrowserUtil.browse(url);
@@ -215,12 +215,18 @@ public final class GeneralSettings implements PersistentStateComponent<GeneralSe
myUseDefaultBrowser = value;
}
/**
* @deprecated unused
*/
@Transient
@Deprecated
public boolean isConfirmExtractFiles() {
return true;
}
/**
* @deprecated unused
*/
@Deprecated
public void setConfirmExtractFiles(@SuppressWarnings("unused") boolean value) { }
@@ -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.ide;
import com.intellij.openapi.components.ServiceManager;
@@ -27,7 +27,7 @@ public class SelectInManager {
}
/**
* "Select In" targets should be registered as extension points ({@link SelectInTarget#EP_NAME}).
* @deprecated "Select In" targets should be registered as extension points ({@link SelectInTarget#EP_NAME}).
*/
@Deprecated
public void addTarget(SelectInTarget target) {
@@ -38,6 +38,9 @@ public abstract class ActionsCollector {
*/
public abstract void record(@Nullable String actionId, @Nullable InputEvent event, @NotNull Class context);
/**
* @deprecated use {@link #record(Project, AnAction, AnActionEvent, Language)} instead
*/
@Deprecated
public void record(@Nullable Project project, @Nullable AnAction action, @Nullable AnActionEvent event) {
record(project, action, event, null);
@@ -31,6 +31,9 @@ public interface PasswordStorage {
set(CredentialAttributes(requestor, key), value == null ? null : new Credentials(key, value));
}
/**
* @deprecated use {@link #get(CredentialAttributes)} + {@link Credentials#getPasswordAsString()}
*/
@Deprecated
@Nullable
default String getPassword(@SuppressWarnings("UnusedParameters") @Nullable Project project,
@@ -222,8 +222,7 @@ public class AbstractTreeBuilder implements Disposable {
}
/**
* @see #queueUpdateFrom
* @deprecated
* @deprecated use {@link #queueUpdate()}
*/
@Deprecated
public void updateFromRoot() {
@@ -277,7 +276,7 @@ public class AbstractTreeBuilder implements Disposable {
}
/**
* @deprecated
* @deprecated use {@link AbstractTreeUi#buildNodeForElement(Object)}
*/
@Deprecated
public void buildNodeForElement(@NotNull Object element) {
@@ -286,7 +285,7 @@ public class AbstractTreeBuilder implements Disposable {
}
/**
* @deprecated
* @deprecated use {@link AbstractTreeUi#getNodeForElement(Object, boolean)}
*/
@Deprecated
@Nullable
@@ -436,8 +436,8 @@ public class TreeState implements JDOMExternalizable {
}
/**
* Temporary solution to resolve simultaneous expansions with async tree model.
* Not that the specified consumer must resolve async promise at the end.
* @deprecated Temporary solution to resolve simultaneous expansions with async tree model.
* Note that the specified consumer must resolve async promise at the end.
*/
@Deprecated
public static void expand(@NotNull JTree tree, @NotNull Consumer<? super AsyncPromise<Void>> consumer) {
@@ -538,6 +538,9 @@ public abstract class AbstractWizard<T extends Step> extends DialogWrapper {
return myCancelButton;
}
/**
* @deprecated unused
*/
@Deprecated
protected JButton getFinishButton() {
return new JButton();
@@ -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.
@@ -30,8 +30,10 @@ public class ActionGroupUtil {
return action2presentation.computeIfAbsent(action, k -> action.getTemplatePresentation().clone());
}
/**
* @deprecated use {@link #isGroupEmpty(ActionGroup, AnActionEvent, boolean)} instead
*/
@Deprecated
// Use #isGroupEmpty with isModalContext instead
public static boolean isGroupEmpty(@NotNull ActionGroup actionGroup, @NotNull AnActionEvent e) {
return isGroupEmpty(actionGroup, e, new HashMap<>(), false);
}
@@ -21,7 +21,7 @@ import org.jetbrains.annotations.NonNls;
* Identifiers for data items which can be returned from {@link DataContext#getData(String)} and
* {@link DataProvider#getData(String)}.
*
* @deprecated {@link DataKeys} and {@link DataKey#getData} should be used instead
* @deprecated use {@link DataKeys} and {@link DataKey#getData} instead
*/
@Deprecated
public interface DataConstants {
@@ -50,6 +50,9 @@ public class PlatformDataKeys extends CommonDataKeys {
*/
public static final DataKey<Boolean> IS_MODAL_CONTEXT = DataKey.create("isModalContext");
/**
* @deprecated see {@link com.intellij.diff.tools.util.DiffDataKeys}
*/
@Deprecated
public static final DataKey<DiffViewer> DIFF_VIEWER = DataKey.create("diffViewer");
@@ -199,8 +199,10 @@ public class ActionUtil {
return false;
}
/**
* @deprecated use {@link #performDumbAwareUpdate(boolean, AnAction, AnActionEvent, boolean)} instead
*/
@Deprecated
// Use #performDumbAwareUpdate with isModalContext instead
public static boolean performDumbAwareUpdate(@NotNull AnAction action, @NotNull AnActionEvent e, boolean beforeActionPerformed) {
return performDumbAwareUpdate(false, action, e, beforeActionPerformed);
}
@@ -24,6 +24,7 @@ import com.intellij.openapi.ui.Messages;
* @see com.intellij.diff.util.DiffUserDataKeysEx#MERGE_CANCEL_MESSAGE
* @see com.intellij.diff.util.DiffUserDataKeysEx#MERGE_CANCEL_HANDLER
* @see com.intellij.diff.util.DiffUserDataKeysEx#MERGE_ACTION_CAPTIONS
* @deprecated kept for API compatibility
*/
@Deprecated
public abstract class ActionButtonPresentation {
@@ -4,7 +4,9 @@ package com.intellij.openapi.options;
public interface ConfigurableGroup extends Configurable.Composite {
String getDisplayName();
/** No one uses it */
/**
* @deprecated unused
*/
@Deprecated
default String getShortName() { return null; }
}
@@ -74,7 +74,9 @@ public class ComponentValidator {
this.parentDisposable = parentDisposable;
}
// @deprecated Use {@link ComponentValidator#withValidator(Supplier)} instead
/**
* @deprecated Use {@link ComponentValidator#withValidator(Supplier)} instead
*/
@Deprecated
public ComponentValidator withValidator(@NotNull Consumer<? super ComponentValidator> validator) {
this.validator = () -> {
@@ -266,7 +266,7 @@ public abstract class DialogWrapper {
* when we do not have a project to figure out which window
* is more suitable as an owner for the dialog.
* <p/>
* Instead, use {@link DialogWrapper#DialogWrapper(Project, boolean, boolean)}
* @deprecated use {@link DialogWrapper#DialogWrapper(Project, boolean, boolean)}
*/
@Deprecated
protected DialogWrapper(boolean canBeParent, boolean applicationModalIfPossible) {
@@ -827,7 +827,7 @@ public abstract class DialogWrapper {
return DialogWrapperPeerFactory.getInstance().createPeer(this, parent, canBeParent);
}
/** Dialogs with no parents are discouraged. */
/** @deprecated Dialogs with no parents are discouraged. */
@Deprecated
@NotNull
protected DialogWrapperPeer createPeer(boolean canBeParent, boolean applicationModalIfPossible) {
@@ -1421,18 +1421,27 @@ public abstract class DialogWrapper {
}
}
/**
* @deprecated unused
*/
@Deprecated
@SuppressWarnings("SpellCheckingInspection")
protected boolean isNorthStrictedToPreferredSize() {
return true;
}
/**
* @deprecated unused
*/
@Deprecated
@SuppressWarnings("SpellCheckingInspection")
protected boolean isCenterStrictedToPreferredSize() {
return false;
}
/**
* @deprecated unused
*/
@Deprecated
@SuppressWarnings("SpellCheckingInspection")
protected boolean isSouthStrictedToPreferredSize() {
@@ -1753,7 +1762,7 @@ public abstract class DialogWrapper {
return 0L;
}
/** deprecated pointless (equals {@link #isOK} */
/** @deprecated unused (equals {@link #isOK}) */
@Deprecated
public boolean isToDispatchTypeAhead() {
return isOK();
@@ -94,6 +94,9 @@ public abstract class JBPopupFactory {
Runnable onNo,
int defaultOptionIndex);
/**
* @deprecated use {@link #createActionsStep(ActionGroup, DataContext, String, boolean, boolean, String, Component, boolean, int, boolean)}
*/
@Deprecated
@NotNull
public ListPopupStep createActionsStep(@NotNull ActionGroup actionGroup,
@@ -106,6 +109,9 @@ public abstract class JBPopupFactory {
return createActionsStep(actionGroup, dataContext, null, showNumbers, showDisabledActions, title, component, honorActionMnemonics, 0, false);
}
/**
* @deprecated use {@link #createActionsStep(ActionGroup, DataContext, String, boolean, boolean, String, Component, boolean, int, boolean)}
*/
@Deprecated
@NotNull
public ListPopupStep createActionsStep(@NotNull ActionGroup actionGroup,
@@ -46,6 +46,9 @@ public interface StatusBarWidget extends Disposable {
@NotNull
String getText();
/**
* @deprecated unused
*/
@NotNull
@Deprecated
default String getMaxPossibleText() { return ""; }
@@ -60,6 +63,9 @@ public interface StatusBarWidget extends Disposable {
@Nullable
String getSelectedValue();
/**
* @deprecated unused
*/
@NotNull
@Deprecated
default String getMaxValue() { return ""; }
@@ -1,5 +1,5 @@
/*
* 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.wm;
@@ -38,14 +38,14 @@ public abstract class ToolWindowManager {
* @exception IllegalArgumentException if the same window is already installed or one
* of the parameters is {@code null}.
* @return tool window
* @deprecated {@link ToolWindowManager#registerToolWindow(String, boolean, ToolWindowAnchor)}
* @deprecated use {@link ToolWindowManager#registerToolWindow(String, boolean, ToolWindowAnchor)}
*/
@Deprecated
@NotNull
public abstract ToolWindow registerToolWindow(@NotNull String id, @NotNull JComponent component, @NotNull ToolWindowAnchor anchor);
/**
* @deprecated {@link ToolWindowManager#registerToolWindow(String, boolean, ToolWindowAnchor)}
* @deprecated use {@link ToolWindowManager#registerToolWindow(String, boolean, ToolWindowAnchor)}
*/
@Deprecated
@NotNull
@@ -55,7 +55,7 @@ public abstract class ToolWindowManager {
@NotNull Disposable parentDisposable);
/**
* @deprecated {@link ToolWindowManager#registerToolWindow(String, boolean, ToolWindowAnchor)}
* @deprecated use {@link ToolWindowManager#registerToolWindow(String, boolean, ToolWindowAnchor)}
*/
@Deprecated
@NotNull
@@ -65,7 +65,7 @@ public abstract class ToolWindowManager {
@NotNull Disposable parentDisposable,
boolean canWorkInDumbMode);
/**
* @deprecated {@link ToolWindowManager#registerToolWindow(String, boolean, ToolWindowAnchor)}
* @deprecated use {@link ToolWindowManager#registerToolWindow(String, boolean, ToolWindowAnchor)}
*/
@Deprecated
@NotNull
@@ -248,9 +248,9 @@ public class CheckboxTreeBase extends Tree {
}
/**
* @see CheckboxTreeCellRendererBase#customizeRenderer(JTree, Object, boolean, boolean, boolean, int, boolean)
* @deprecated
* @deprecated use {@link CheckboxTreeCellRendererBase#customizeRenderer(JTree, Object, boolean, boolean, boolean, int, boolean)}
*/
@SuppressWarnings({"DeprecatedIsStillUsed", "unused"})
@Deprecated
public void customizeCellRenderer(JTree tree,
Object value,
@@ -271,9 +271,8 @@ public class CheckboxTreeBase extends Tree {
}
/**
* Don't use this enum. Left for API compatibility.
* @see ThreeStateCheckBox.State
* @deprecated
* @see State
* @deprecated Don't use this enum. Left for API compatibility.
*/
@Deprecated
public enum NodeState {
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2017 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.
@@ -75,8 +75,7 @@ public class IdeBorderFactory {
}
/**
* @deprecated
* @see JBUI.Borders#empty()
* @deprecated use {@link JBUI.Borders#empty()}
*/
@Deprecated
public static Border createEmptyBorder() {
@@ -84,8 +83,7 @@ public class IdeBorderFactory {
}
/**
* @deprecated
* @see JBUI.Borders#empty(int)
* @deprecated use {@link JBUI.Borders#empty(int)}
*/
@Deprecated
public static Border createEmptyBorder(int thickness) {
@@ -93,8 +91,7 @@ public class IdeBorderFactory {
}
/**
* @deprecated
* @see JBUI.Borders#empty(int, int, int, int)
* @deprecated use {@link JBUI.Borders#empty(int, int, int, int)}
*/
@Deprecated
public static Border createEmptyBorder(int top, int left, int bottom, int right) {
@@ -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.
@@ -50,13 +50,16 @@ public class RawCommandLineEditor extends JPanel implements TextAccessor {
InsertPathAction.addTo(myEditor, descriptor, insertSystemDependentPaths);
}
/**
* @deprecated Won't be used anymore as dialog is replaced with lightweight popup
*/
@Deprecated
public String getDialogCaption() {
return myDialogCaption;
}
/**
* Won't be used anymore as dialog is replaced with lightweight popup
* @deprecated Won't be used anymore as dialog is replaced with lightweight popup
*/
@Deprecated
public void setDialogCaption(String dialogCaption) {
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2011 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,13 +20,13 @@ import javax.swing.table.TableModel;
/**
* @author dsl
* @author Konstantin Bulenkov
*
* @deprecated
* @see com.intellij.util.ui.EditableModel
* @deprecated use {@link com.intellij.util.ui.EditableModel}
*/
@Deprecated
public interface RowEditableTableModel extends TableModel {
void addRow();
void removeRow(int index);
void exchangeRows(int oldIndex, int newIndex);
}
@@ -209,12 +209,20 @@ public class SearchTextField extends JPanel {
}
}
/**
* @deprecated unused
*/
@Deprecated
@SuppressWarnings("unused")
protected boolean isSearchControlUISupported() {
return true;
}
/**
* @deprecated unused
*/
@Deprecated
@SuppressWarnings("unused")
protected boolean hasIconsOutsideOfTextField() {
return false;
}
@@ -494,6 +502,9 @@ public class SearchTextField extends JPanel {
return false;
}
/**
* @deprecated unused
*/
@Deprecated
@SuppressWarnings("unused")
public void setSearchIcon(final Icon icon) {
@@ -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.
@@ -26,7 +26,7 @@ import java.util.ArrayList;
* @author Konstantin Bulenkov
*/
public class JBSlidingPanel extends JBPanel {
private final ArrayList<Pair<String,Component>> mySlides = new ArrayList<>();
private final ArrayList<Pair<String, Component>> mySlides = new ArrayList<>();
private int mySelectedIndex = -1;
public JBSlidingPanel() {
@@ -75,24 +75,36 @@ public class JBSlidingPanel extends JBPanel {
return callback;
}
/**
* @deprecated MUST use {@link #add((String, Component))}
*/
@Override
@Deprecated
public Component add(Component comp) {
throw new AddMethodIsNotSupportedException();
}
/**
* @deprecated MUST use {@link #add((String, Component))}
*/
@Override
@Deprecated
public Component add(Component comp, int index) {
throw new AddMethodIsNotSupportedException();
}
/**
* @deprecated MUST use {@link #add((String, Component))}
*/
@Override
@Deprecated
public void add(Component comp, Object constraints) {
throw new AddMethodIsNotSupportedException();
}
/**
* @deprecated MUST use {@link #add((String, Component))}
*/
@Override
@Deprecated
public void add(Component comp, Object constraints, int index) {
@@ -85,7 +85,7 @@ public class ExtendableTextField extends JBTextField implements ExtendableTextCo
}
/**
* Temporary solution to support icons in the text component for different L&F.
* @deprecated Temporary solution to support icons in the text component for different L&F.
* This method replaces non-supported UI with Darcula UI.
*
* @param ui an object to paint this text component
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 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.
@@ -55,8 +55,7 @@ public class TableView<Item> extends BaseTableView implements ItemsProvider, Sel
}
/**
* use {@link #setModelAndUpdateColumns(com.intellij.util.ui.ListTableModel<Item>)} instead
* @param model
* @deprecated use {@link #setModelAndUpdateColumns(ListTableModel<Item>)} instead
*/
@Deprecated
public void setModel(final ListTableModel<Item> model) {
@@ -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.ui.tabs;
import org.jetbrains.annotations.NotNull;
@@ -9,15 +9,15 @@ public interface TabsListener {
default void beforeSelectionChanged(TabInfo oldSelection, TabInfo newSelection) {
}
default void tabRemoved(@NotNull TabInfo tabToRemove) {
}
default void tabsMoved() {
}
/**
* Use {@link TabsListener} directly
* @deprecated use {@link TabsListener} directly
*/
@Deprecated
class Adapter implements TabsListener {
@@ -27,7 +27,7 @@ import java.util.function.Supplier;
*/
public class JBEditorTabs extends JBTabsImpl implements JBEditorTabsBase {
/**
* @Deprecated use {@link #myTabPainter}.
* @deprecated use {@link #myTabPainter}.
*/
@Deprecated
protected JBEditorTabsPainter myDefaultPainter = new DefaultEditorTabsPainter(this);
@@ -9,6 +9,7 @@ import com.intellij.util.ui.UIUtil;
import java.awt.*;
/**
* @deprecated left for API compatibility
* @author Konstantin Bulenkov
*/
@Deprecated
@@ -746,6 +746,9 @@ public class Tree extends JTree implements ComponentWithEmptyText, ComponentWith
}
}
/**
* @deprecated no effect
*/
@Deprecated
public final void setLineStyleAngled() {
}
@@ -113,6 +113,9 @@ public class FilteringTreeBuilder extends AbstractTreeBuilder {
return true;
}
/**
* @deprecated use {@link #refilter(Object, boolean, boolean)}
*/
@NotNull
@Deprecated
public ActionCallback refilter() {
@@ -153,6 +153,9 @@ public class HttpConfigurable implements PersistentStateComponent<HttpConfigurab
CommonProxy.getInstance().setCustomAuth(name, new IdeaWideAuthenticator(this));
}
/**
* @deprecated use {@link #initializeComponent()}
*/
@Deprecated
public void initComponent() {
initializeComponent();
@@ -358,12 +361,17 @@ public class HttpConfigurable implements PersistentStateComponent<HttpConfigurab
}
}
//these methods are preserved for compatibility with com.intellij.openapi.project.impl.IdeaServerSettings
/**
* @deprecated left for compatibility with com.intellij.openapi.project.impl.IdeaServerSettings
*/
@Deprecated
public void readExternal(Element element) throws InvalidDataException {
loadState(XmlSerializer.deserialize(element, HttpConfigurable.class));
}
/**
* @deprecated left for compatibility with com.intellij.openapi.project.impl.IdeaServerSettings
*/
@Deprecated
public void writeExternal(Element element) throws WriteExternalException {
com.intellij.util.xmlb.XmlSerializer.serializeInto(getState(), element);
@@ -37,6 +37,9 @@ public class AsyncProcessIcon extends AnimatedIcon {
super(name, icons, passive, CYCLE_LENGTH);
}
/**
* @deprecated no effect
*/
@Deprecated
public AsyncProcessIcon setUseMask(boolean useMask) {
return this;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 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.
@@ -19,8 +19,7 @@ import javax.swing.tree.TreeModel;
import javax.swing.tree.TreeNode;
/**
* @deprecated
* @see com.intellij.ui.treeStructure.Tree
* @deprecated use {@link com.intellij.ui.treeStructure.Tree}
*/
@Deprecated
public class Tree extends com.intellij.ui.treeStructure.Tree {
@@ -316,8 +316,7 @@ public final class TreeUtil {
}
/**
* @see #promiseSelectFirstLeaf
* @deprecated
* @deprecated use {@link #promiseSelectFirstLeaf}
*/
@Deprecated
@NotNull