Deprecate some relics

This commit is contained in:
Roman Shevchenko
2012-12-19 16:17:59 +01:00
parent 33c7916c26
commit 3699b59447
10 changed files with 38 additions and 63 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2012 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.
@@ -229,7 +229,7 @@ public class PeerFactoryImpl extends PeerFactory {
}
public PsiBuilder createBuilder(ASTNode tree, Language lang, CharSequence seq, final Project project) {
return PsiBuilderFactory.getInstance().createBuilder(project, tree, lang, seq);
return PsiBuilderFactory.getInstance().createBuilder(project, tree, null, lang, seq);
}
public PsiBuilder createBuilder(final ASTNode tree, final Lexer lexer, final Language lang, final CharSequence seq, final Project project) {
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2012 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,8 +23,8 @@ import com.intellij.cyclicDependencies.ui.CyclicDependenciesPanel;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.project.Project;
import com.intellij.packageDependencies.DependenciesToolWindow;
import com.intellij.peer.PeerFactory;
import com.intellij.ui.content.Content;
import com.intellij.ui.content.ContentFactory;
import javax.swing.*;
@@ -53,7 +53,7 @@ public class CyclicDependenciesHandler {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
CyclicDependenciesPanel panel = new CyclicDependenciesPanel(myProject, builder);
Content content = PeerFactory.getInstance().getContentFactory().createContent(panel, AnalysisScopeBundle.message(
Content content = ContentFactory.SERVICE.getInstance().createContent(panel, AnalysisScopeBundle.message(
"action.analyzing.cyclic.dependencies.in.scope", builder.getScope().getDisplayName()), false);
content.setDisposer(panel);
panel.setContent(content);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2012 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.
@@ -42,48 +42,39 @@ import org.apache.xmlrpc.XmlRpcServer;
import java.net.InetAddress;
/** @deprecated to remove in IDEA 13 */
@SuppressWarnings({"UnusedDeclaration", "deprecation"})
public abstract class PeerFactory {
public static PeerFactory getInstance() {
return ServiceManager.getService(PeerFactory.class);
}
@Deprecated
public abstract FileStatusFactory getFileStatusFactory();
@Deprecated
public abstract DialogWrapperPeerFactory getDialogWrapperPeerFactory();
@Deprecated
public abstract PackageSetFactory getPackageSetFactory();
public abstract UIHelper getUIHelper();
@Deprecated
public abstract ErrorViewFactory getErrorViewFactory();
@Deprecated
public abstract ContentFactory getContentFactory();
@Deprecated
public abstract FileSystemTreeFactory getFileSystemTreeFactory();
@Deprecated
public abstract DiffRequestFactory getDiffRequestFactory();
@Deprecated
public abstract VcsContextFactory getVcsContextFactory();
@Deprecated
public abstract PsiBuilder createBuilder(ASTNode tree, Language lang, CharSequence seq, final Project project);
@Deprecated
public abstract PsiBuilder createBuilder(ASTNode tree, Lexer lexer, Language lang, CharSequence seq, final Project project);
public abstract XmlRpcServer createRpcServer();
public abstract WebServer createWebServer(int port, InetAddress addr, XmlRpcServer xmlrpc);
public abstract WebServer createWebServer(int port, InetAddress addr, XmlRpcServer xmlRpc);
@Deprecated
public abstract EditorHighlighter createEditorHighlighter(SyntaxHighlighter syntaxHighlighter, EditorColorsScheme colors);
public abstract Sdk createProjectJdk(String name, final String version, final String homePath, SdkType sdkType);
+3 -16
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2012 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,18 +31,11 @@ import javax.swing.tree.TreeCellRenderer;
import javax.swing.tree.TreePath;
import java.awt.*;
/**
* @see com.intellij.peer.PeerFactory#getUIHelper()
*/
/** @deprecated to remove in IDEA 13 */
@SuppressWarnings({"UnusedDeclaration", "deprecation"})
public interface UIHelper {
/**
* @deprecated use JBTree class instead, it will automatically configure tool tips
*/
void installToolTipHandler(JTree tree);
/**
* @deprecated use JBTable class instead, it will automatically configure tool tips
*/
void installToolTipHandler(JTable table);
void installEditSourceOnDoubleClick(JTree tree);
@@ -77,12 +70,6 @@ public interface UIHelper {
void installSelectionSaver(JTree tree);
/**
* @param text
* @param type expected type that the expression to be input in this field should have, subtypes accepted
* @param context where the expression is to be virtually inserted (for smart completing variables from the context)
* @param project
*/
TextComponent createTypedTextField(final String text, PsiType type, PsiElement context, final Project project);
PackageChooser createPackageChooser(String title, Project project);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2011 JetBrains s.r.o.
* Copyright 2000-2012 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.
@@ -36,21 +36,19 @@ public abstract class PsiBuilderFactory {
@NotNull
public abstract PsiBuilder createBuilder(@NotNull Project project, @NotNull LighterLazyParseableNode chameleon);
/**
* @deprecated consider using {@link #createBuilder(com.intellij.openapi.project.Project, ASTNode)} instead.
*/
@NotNull
public PsiBuilder createBuilder(@NotNull Project project, @NotNull ASTNode tree, @NotNull Language lang, @NotNull CharSequence seq) {
return createBuilder(project, tree, null, lang, seq);
}
public abstract PsiBuilder createBuilder(@NotNull Project project,
@NotNull ASTNode chameleon,
@Nullable Lexer lexer,
@NotNull Language lang,
@NotNull CharSequence seq);
@NotNull
public abstract PsiBuilder createBuilder(@NotNull Project project, @NotNull ASTNode chameleon, @Nullable Lexer lexer,
@NotNull Language lang, @NotNull CharSequence seq);
@NotNull
public abstract PsiBuilder createBuilder(@NotNull Project project, @NotNull LighterLazyParseableNode chameleon, @Nullable Lexer lexer,
@NotNull Language lang, @NotNull CharSequence seq);
public abstract PsiBuilder createBuilder(@NotNull Project project,
@NotNull LighterLazyParseableNode chameleon,
@Nullable Lexer lexer,
@NotNull Language lang,
@NotNull CharSequence seq);
@NotNull
public abstract PsiBuilder createBuilder(@NotNull ParserDefinition parserDefinition, @NotNull Lexer lexer, @NotNull CharSequence seq);
@@ -69,6 +69,12 @@ public class ProjectJdkImpl extends UserDataHolderBase implements JDOMExternaliz
myRootContainer.addProjectRootContainerListener(myRootProvider);
}
public ProjectJdkImpl(String name, SdkTypeId sdkType, String homePath, String version) {
this(name, sdkType);
myHomePath = homePath;
myVersionString = version;
}
@Override
@NotNull
public SdkTypeId getSdkType() {
@@ -48,7 +48,6 @@ import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.VirtualFileManager;
import com.intellij.openapi.wm.*;
import com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy;
import com.intellij.peer.PeerFactory;
import com.intellij.problems.WolfTheProblemSolver;
import com.intellij.ui.content.*;
import com.intellij.util.Alarm;
@@ -275,7 +274,7 @@ public final class AntBuildMessageView extends JPanel implements DataProvider, O
String contentName = buildFile.getPresentableName();
contentName = BUILD_CONTENT_NAME + " (" + contentName + ")";
final Content content = PeerFactory.getInstance().getContentFactory().createContent(messageView.getComponent(), contentName, true);
final Content content = ContentFactory.SERVICE.getInstance().createContent(messageView.getComponent(), contentName, true);
content.putUserData(KEY, messageView);
ijMessageView.getContentManager().addContent(content);
ijMessageView.getContentManager().setSelectedContent(content);
@@ -24,10 +24,10 @@ import com.intellij.openapi.keymap.KeymapUtil;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
import com.intellij.peer.PeerFactory;
import com.intellij.psi.JavaPsiFacade;
import com.intellij.psi.PsiClass;
import com.intellij.ui.ColoredListCellRenderer;
import com.intellij.ui.ListSpeedSearch;
import com.intellij.ui.SimpleTextAttributes;
import com.intellij.util.ArrayUtil;
import com.intellij.util.Function;
@@ -126,7 +126,7 @@ public class NewActionDialog extends DialogWrapper implements ActionData {
}
}
});
PeerFactory.getInstance().getUIHelper().installListSpeedSearch(myGroupList, new Function<Object, String>() {
new ListSpeedSearch(myGroupList, new Function<Object, String>() {
public String fun(final Object o) {
return ActionManager.getInstance().getId((AnAction) o);
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2012 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.
@@ -16,12 +16,8 @@
package org.jetbrains.plugins.groovy.lang.groovydoc.parser;
import com.intellij.lang.ASTNode;
import com.intellij.lang.Language;
import com.intellij.lang.PsiBuilder;
import com.intellij.lang.PsiParser;
import com.intellij.lang.*;
import com.intellij.openapi.project.Project;
import com.intellij.peer.PeerFactory;
import com.intellij.psi.JavaPsiFacade;
import com.intellij.psi.PsiElement;
import com.intellij.psi.tree.ILazyParseableElementType;
@@ -48,11 +44,10 @@ public interface GroovyDocElementTypes extends GroovyDocTokenTypes {
}
public ASTNode parseContents(ASTNode chameleon) {
final PeerFactory factory = PeerFactory.getInstance();
final PsiElement parentElement = chameleon.getTreeParent().getPsi();
final Project project = JavaPsiFacade.getInstance(parentElement.getProject()).getProject();
final PsiBuilder builder = factory.createBuilder(chameleon, new GroovyDocLexer(), getLanguage(), chameleon.getText(), project);
final PsiBuilder builder = PsiBuilderFactory.getInstance().createBuilder(project, chameleon, new GroovyDocLexer(), getLanguage(), chameleon.getText());
final PsiParser parser = new GroovyDocParser();
return parser.parse(this, builder).getFirstChildNode();
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2012 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.
@@ -18,8 +18,8 @@ package org.jetbrains.plugins.groovy.lang.groovydoc.parser.elements;
import com.intellij.lang.ASTNode;
import com.intellij.lang.PsiBuilder;
import com.intellij.lang.PsiBuilderFactory;
import com.intellij.openapi.project.Project;
import com.intellij.peer.PeerFactory;
import com.intellij.psi.PsiElement;
import com.intellij.psi.impl.source.tree.LeafPsiElement;
import com.intellij.util.containers.HashSet;
@@ -103,10 +103,9 @@ public class GroovyDocTagValueTokenType extends GroovyDocChameleonElementType im
}
private ASTNode parseImpl(ASTNode chameleon) {
final PeerFactory factory = PeerFactory.getInstance();
final PsiElement parentElement = chameleon.getTreeParent().getPsi();
final Project project = parentElement.getProject();
final PsiBuilder builder = factory.createBuilder(chameleon, new GroovyLexer(), getLanguage(), chameleon.getText(), project);
final PsiBuilder builder = PsiBuilderFactory.getInstance().createBuilder(project, chameleon, new GroovyLexer(), getLanguage(), chameleon.getText());
PsiBuilder.Marker rootMarker = builder.mark();
if (BUILT_IN_TYPES.contains(chameleon.getText())) {