Cleanup (misc. deprecated API dropped from *-impl modules)

This commit is contained in:
Roman Shevchenko
2015-04-30 19:08:06 +02:00
parent 89a0440a7e
commit 28e912e40b
13 changed files with 18 additions and 414 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* 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.
@@ -103,14 +103,6 @@ public class DefaultJavaProgramRunner extends JavaPatchableProgramRunner {
return contentBuilder.showRunContent(env.getContentToReuse());
}
@Deprecated
/**
* @deprecated to remove in IDEA 14
*/
protected AnAction[] createActions(@SuppressWarnings("UnusedParameters") final ExecutionResult executionResult) {
return AnAction.EMPTY_ARRAY;
}
private static void addDefaultActions(@NotNull RunContentBuilder contentBuilder, @NotNull ExecutionResult executionResult) {
final ExecutionConsole executionConsole = executionResult.getExecutionConsole();
final JComponent consoleComponent = executionConsole != null ? executionConsole.getComponent() : null;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* 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.
@@ -21,7 +21,7 @@ import com.intellij.openapi.editor.colors.TextAttributesKey;
/**
* Highlighting text attributes for Java language.
*
*
* @author Rustam Vishnyakov
*/
@SuppressWarnings("deprecation")
@@ -42,12 +42,7 @@ public class JavaHighlightingColors {
public static final TextAttributesKey DOC_COMMENT_TAG = SyntaxHighlighterColors.DOC_COMMENT_TAG;
public static final TextAttributesKey DOC_COMMENT_MARKUP = SyntaxHighlighterColors.DOC_COMMENT_MARKUP;
public static final TextAttributesKey DOC_COMMENT_TAG_VALUE = TextAttributesKey.createTextAttributesKey(
"DOC_COMMENT_TAG_VALUE",
DefaultLanguageHighlighterColors.DOC_COMMENT_TAG_VALUE);
"DOC_COMMENT_TAG_VALUE", DefaultLanguageHighlighterColors.DOC_COMMENT_TAG_VALUE);
public static final TextAttributesKey VALID_STRING_ESCAPE = SyntaxHighlighterColors.VALID_STRING_ESCAPE;
public static final TextAttributesKey INVALID_STRING_ESCAPE = SyntaxHighlighterColors.INVALID_STRING_ESCAPE;
/** @deprecated use {@link #PARENTHESES} (to remove in IDEA 14) */
@SuppressWarnings("SpellCheckingInspection")
public static final TextAttributesKey PARENTHS = PARENTHESES;
}
@@ -1,43 +0,0 @@
/*
* Copyright 2000-2014 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.psi.impl.source.tree;
import com.intellij.lang.LighterAST;
import com.intellij.lang.LighterASTNode;
import com.intellij.psi.PsiJavaCodeReferenceElement;
import com.intellij.psi.PsiManager;
import com.intellij.psi.tree.IElementType;
import org.jetbrains.annotations.NotNull;
/** @deprecated use {@link JavaSourceUtil} (to be removed in IDEA 15) */
@SuppressWarnings("UnusedDeclaration")
public class SourceUtil {
private SourceUtil() { }
@NotNull
public static String getReferenceText(@NotNull PsiJavaCodeReferenceElement ref) {
return JavaSourceUtil.getReferenceText(ref);
}
@NotNull
public static String getReferenceText(@NotNull LighterAST tree, @NotNull LighterASTNode node) {
return JavaSourceUtil.getReferenceText(tree, node);
}
public static TreeElement addParenthToReplacedChild(@NotNull IElementType parenthType, @NotNull TreeElement newChild, @NotNull PsiManager manager) {
return JavaSourceUtil.addParenthToReplacedChild(parenthType, newChild, manager);
}
}
@@ -1,59 +0,0 @@
/*
* Copyright 2000-2014 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.openapi.util;
import com.intellij.openapi.components.PersistentStateComponent;
import com.intellij.openapi.diagnostic.Logger;
import org.jdom.Element;
@Deprecated
/**
* @author Dmitry Avdeev
* @deprecated to remove in IDEA 14
*/
public class JDOMExternalizableAdapter implements PersistentStateComponent<Element> {
private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.util.JDOMExternalizableAdapter");
private final JDOMExternalizable myExternalizable;
private final String myName;
public JDOMExternalizableAdapter(JDOMExternalizable externalizable, String name) {
myExternalizable = externalizable;
myName = name;
}
public Element getState() {
Element element = new Element(myName);
try {
myExternalizable.writeExternal(element);
}
catch (WriteExternalException e) {
LOG.info(e);
}
return element;
}
public void loadState(Element state) {
try {
myExternalizable.readExternal(state);
}
catch (InvalidDataException e) {
LOG.info(e);
}
}
}
@@ -1,84 +0,0 @@
/*
* 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.
*/
package com.intellij.diff.contents;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.fileEditor.OpenFileDescriptor;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.LineSeparator;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.nio.charset.Charset;
@Deprecated
/** @deprecated (to be removed in IDEA 15) */
public class DocumentContentWrapper implements DocumentContent {
@NotNull private final DocumentContent myBase;
@NotNull private final Document myDocument;
public DocumentContentWrapper(@NotNull Document document, @NotNull DocumentContent base) {
myDocument = document;
myBase = base;
}
@NotNull
@Override
public Document getDocument() {
return myDocument;
}
@Nullable
@Override
public VirtualFile getHighlightFile() {
return myBase.getHighlightFile();
}
@Nullable
@Override
public OpenFileDescriptor getOpenFileDescriptor(int offset) {
return myBase.getOpenFileDescriptor(offset);
}
@Nullable
@Override
public Charset getCharset() {
return null;
}
@Nullable
@Override
public LineSeparator getLineSeparator() {
return null;
}
@Nullable
@Override
public FileType getContentType() {
return myBase.getContentType();
}
@Nullable
@Override
public OpenFileDescriptor getOpenFileDescriptor() {
return getOpenFileDescriptor(0);
}
@Override
public void onAssigned(boolean isAssigned) {
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* 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.
@@ -25,14 +25,11 @@ import com.intellij.openapi.ui.LabeledComponent;
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
import com.intellij.openapi.util.Comparing;
import com.intellij.ui.UserActivityProviderComponent;
import com.intellij.util.ArrayUtil;
import com.intellij.util.EnvironmentUtil;
import org.jdom.Element;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import javax.swing.event.ChangeListener;
import java.io.File;
import java.util.Map;
public class EnvironmentVariablesComponent extends LabeledComponent<TextFieldWithBrowseButton> implements UserActivityProviderComponent {
@@ -113,23 +110,6 @@ public class EnvironmentVariablesComponent extends LabeledComponent<TextFieldWit
element.addContent(envsElement);
}
/**
* To be removed in IDEA 15
* @deprecated use {@link com.intellij.util.EnvironmentUtil#inlineParentOccurrences(java.util.Map)} instead
*/
@Deprecated
public static void inlineParentOccurrences(final Map<String, String> envs) {
EnvironmentUtil.inlineParentOccurrences(envs);
}
/**
* To be removed in IDEA 15
*/
@Deprecated
public static boolean containsEnvKeySubstitution(final String envKey, final String val) {
return ArrayUtil.find(val.split(File.pathSeparator), "$" + envKey + "$") != -1;
}
@Override
public void addChangeListener(final ChangeListener changeListener) {
myEnvVars.addChangeListener(changeListener);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* 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.
@@ -33,6 +33,7 @@ import com.intellij.ide.CommonActionsManager;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Computable;
import com.intellij.ui.JBColor;
import com.intellij.ui.SideBorder;
import com.intellij.util.NotNullFunction;
import com.intellij.util.containers.ContainerUtil;
@@ -45,9 +46,10 @@ import java.awt.*;
import java.util.List;
/**
* This class provides basic functionality for running consoles.
* It launches external process and handles line input with history
*
* @author oleg
* This class provides basic functionality for running consoles.
* It launches external process and handles line input with history
*/
public abstract class AbstractConsoleRunnerWithHistory<T extends LanguageConsoleView> {
private final String myConsoleTitle;
@@ -88,7 +90,7 @@ public abstract class AbstractConsoleRunnerWithHistory<T extends LanguageConsole
// Init console view
myConsoleView = createConsoleView();
if (myConsoleView instanceof JComponent) {
((JComponent)myConsoleView).setBorder(new SideBorder(UIUtil.getBorderColor(), SideBorder.LEFT));
((JComponent)myConsoleView).setBorder(new SideBorder(JBColor.border(), SideBorder.LEFT));
}
myProcessHandler = createProcessHandler(process);
@@ -234,21 +236,9 @@ public abstract class AbstractConsoleRunnerWithHistory<T extends LanguageConsole
return ActionManager.getInstance().getAction(IdeActions.ACTION_STOP_PROGRAM);
}
@SuppressWarnings("UnusedDeclaration")
@Deprecated
/**
* @deprecated to remove in IDEA 14
*/
public static AnAction createConsoleExecAction(@NotNull LanguageConsoleView console,
@NotNull ProcessHandler processHandler,
@NotNull ProcessBackedConsoleExecuteActionHandler consoleExecuteActionHandler) {
return new ConsoleExecuteAction(console, consoleExecuteActionHandler, consoleExecuteActionHandler.getEmptyExecuteAction(),
consoleExecuteActionHandler);
}
protected AnAction createConsoleExecAction(@NotNull ProcessBackedConsoleExecuteActionHandler consoleExecuteActionHandler) {
return new ConsoleExecuteAction(myConsoleView, consoleExecuteActionHandler, consoleExecuteActionHandler.getEmptyExecuteAction(),
consoleExecuteActionHandler);
String emptyAction = consoleExecuteActionHandler.getEmptyExecuteAction();
return new ConsoleExecuteAction(myConsoleView, consoleExecuteActionHandler, emptyAction, consoleExecuteActionHandler);
}
@NotNull
@@ -21,7 +21,6 @@ import com.intellij.execution.ExecutionResult;
import com.intellij.execution.Executor;
import com.intellij.execution.configurations.RunConfigurationBase;
import com.intellij.execution.configurations.RunProfile;
import com.intellij.execution.configurations.SearchScopeProvider;
import com.intellij.execution.impl.ConsoleViewImpl;
import com.intellij.execution.ui.*;
import com.intellij.execution.ui.actions.CloseAction;
@@ -32,11 +31,9 @@ import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Disposer;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.ui.content.Content;
import com.intellij.ui.content.tabs.PinToolwindowTabAction;
import com.intellij.util.SmartList;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -44,21 +41,11 @@ import java.util.Collection;
import java.util.List;
public class RunContentBuilder extends RunTab {
@NonNls private static final String JAVA_RUNNER = "JavaRunner";
private static final String JAVA_RUNNER = "JavaRunner";
private final List<AnAction> myRunnerActions = new SmartList<AnAction>();
private final ExecutionResult myExecutionResult;
/**
* @deprecated use {@link #RunContentBuilder(com.intellij.execution.ExecutionResult, ExecutionEnvironment)}
* to remove in IDEA 15
*/
public RunContentBuilder(ProgramRunner runner,
ExecutionResult executionResult,
@NotNull ExecutionEnvironment environment) {
this(executionResult, fix(environment, runner));
}
public RunContentBuilder(@NotNull ExecutionResult executionResult, @NotNull ExecutionEnvironment environment) {
super(environment, getRunnerType(executionResult.getExecutionConsole()));
@@ -76,16 +63,6 @@ public class RunContentBuilder extends RunTab {
}
}
@SuppressWarnings("UnusedDeclaration")
@Deprecated
@NotNull
/**
* @deprecated to remove in IDEA 15
*/
public static GlobalSearchScope createSearchScope(Project project, RunProfile runProfile) {
return SearchScopeProvider.createSearchScope(project, runProfile);
}
public void addAction(@NotNull final AnAction action) {
myRunnerActions.add(action);
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* 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.
@@ -276,12 +276,6 @@ public class CopyPasteManagerEx extends CopyPasteManager implements ClipboardOwn
}
}
/** @deprecated use {@link #moveContentToStackTop(Transferable)} (to remove in IDEA 14) */
@SuppressWarnings("UnusedDeclaration")
public void moveContentTopStackTop(Transferable t) {
moveContentToStackTop(t);
}
public void moveContentToStackTop(Transferable t) {
moveContentToStackTop(t, true);
}
@@ -36,7 +36,6 @@ import com.intellij.util.EnvironmentUtil;
import com.intellij.util.PlatformUtils;
import com.intellij.util.lang.UrlClassLoader;
import com.sun.jna.Native;
import org.jetbrains.annotations.NonNls;
import javax.swing.*;
import java.io.File;
@@ -52,7 +51,7 @@ import java.util.Locale;
* @author yole
*/
public class StartupUtil {
@NonNls public static final String NO_SPLASH = "nosplash";
public static final String NO_SPLASH = "nosplash";
private static SocketLock ourLock;
@@ -62,12 +61,6 @@ public class StartupUtil {
return !Arrays.asList(args).contains(NO_SPLASH);
}
/** @deprecated use {@link Main#isHeadless()} (to remove in IDEA 14) */
@SuppressWarnings("unused")
public static boolean isHeadless() {
return Main.isHeadless();
}
public synchronized static void addExternalInstanceListener(Consumer<List<String>> consumer) {
ourLock.setActivateListener(consumer);
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* 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.
@@ -45,18 +45,6 @@ public class FileTypeRenderer extends ListCellRendererWrapper<FileType> {
myFileTypeListProvider = fileTypeListProvider;
}
/** @deprecated use {@link #FileTypeRenderer()} (to remove in IDEA 14) */
@SuppressWarnings("UnusedDeclaration")
public FileTypeRenderer(final ListCellRenderer renderer) {
this();
}
/** @deprecated use {@link #FileTypeRenderer(FileTypeListProvider)} (to remove in IDEA 14) */
@SuppressWarnings("UnusedDeclaration")
public FileTypeRenderer(final ListCellRenderer renderer, final FileTypeListProvider fileTypeListProvider) {
this(fileTypeListProvider);
}
@Override
public void customize(JList list, FileType type, int index, boolean selected, boolean hasFocus) {
LayeredIcon layeredIcon = new LayeredIcon(2);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* 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.
@@ -168,15 +168,6 @@ public class AppUIUtil {
});
}
@SuppressWarnings("UnusedDeclaration")
@Deprecated
/**
* to remove in IDEA 14
*/
public static JTextField createUndoableTextField() {
return GuiUtils.createUndoableTextField();
}
private static final int MIN_ICON_SIZE = 32;
@Nullable
@@ -1,110 +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.openapi.vcs.impl;
import com.intellij.openapi.components.PersistentStateComponent;
import com.intellij.openapi.components.State;
import com.intellij.openapi.components.Storage;
import com.intellij.openapi.components.StoragePathMacros;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleComponent;
import com.intellij.openapi.roots.ModuleRootManager;
import com.intellij.openapi.startup.StartupManager;
import com.intellij.openapi.util.DefaultJDOMExternalizer;
import com.intellij.openapi.util.InvalidDataException;
import com.intellij.openapi.vcs.ex.ProjectLevelVcsManagerEx;
import com.intellij.openapi.vfs.VirtualFile;
import org.jdom.Element;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* @deprecated to remove in IDEA 15
*/
@Deprecated
@SuppressWarnings("UnusedDeclaration")
@State(
name = "VcsManagerConfiguration",
storages = @Storage(file = StoragePathMacros.MODULE_FILE)
)
public class VcsManagerPerModuleConfiguration implements ModuleComponent, PersistentStateComponent<Element> {
private final Module myModule;
public String ACTIVE_VCS_NAME = "";
public boolean USE_PROJECT_VCS = true;
public static VcsManagerPerModuleConfiguration getInstance(Module module) {
return module.getComponent(VcsManagerPerModuleConfiguration.class);
}
public VcsManagerPerModuleConfiguration(final Module module) {
myModule = module;
}
@Override
public void moduleAdded() {
}
@Override
public void projectClosed() {
}
@Override
public void projectOpened() {
}
@Override
public void disposeComponent() {
}
@Override
public void initComponent() { }
@Override
@NotNull
public String getComponentName() {
return "VcsManagerConfiguration";
}
@Nullable
@Override
public Element getState() {
return null;
}
@Override
public void loadState(Element state) {
try {
//noinspection deprecation
DefaultJDOMExternalizer.readExternal(this, state);
}
catch (InvalidDataException ignored) {
}
if (!USE_PROJECT_VCS) {
StartupManager.getInstance(myModule.getProject()).runWhenProjectIsInitialized(new Runnable() {
@Override
public void run() {
ProjectLevelVcsManagerImpl vcsManager = (ProjectLevelVcsManagerImpl)ProjectLevelVcsManagerEx.getInstanceEx(myModule.getProject());
for(VirtualFile file: ModuleRootManager.getInstance(myModule).getContentRoots()) {
vcsManager.setDirectoryMapping(file.getPath(), ACTIVE_VCS_NAME);
}
vcsManager.cleanupMappings();
}
});
}
}
}