diff --git a/java/idea-ui/src/com/intellij/peer/impl/PeerFactoryImpl.java b/java/idea-ui/src/com/intellij/peer/impl/PeerFactoryImpl.java index 920942160194..487f1d1c4232 100644 --- a/java/idea-ui/src/com/intellij/peer/impl/PeerFactoryImpl.java +++ b/java/idea-ui/src/com/intellij/peer/impl/PeerFactoryImpl.java @@ -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) { diff --git a/java/java-impl/src/com/intellij/cyclicDependencies/actions/CyclicDependenciesHandler.java b/java/java-impl/src/com/intellij/cyclicDependencies/actions/CyclicDependenciesHandler.java index 4feb925916da..c1bfd16e2de8 100644 --- a/java/java-impl/src/com/intellij/cyclicDependencies/actions/CyclicDependenciesHandler.java +++ b/java/java-impl/src/com/intellij/cyclicDependencies/actions/CyclicDependenciesHandler.java @@ -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); diff --git a/java/openapi/src/com/intellij/peer/PeerFactory.java b/java/openapi/src/com/intellij/peer/PeerFactory.java index f74654ce0fb5..2f55b278a65e 100644 --- a/java/openapi/src/com/intellij/peer/PeerFactory.java +++ b/java/openapi/src/com/intellij/peer/PeerFactory.java @@ -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); diff --git a/java/openapi/src/com/intellij/ui/UIHelper.java b/java/openapi/src/com/intellij/ui/UIHelper.java index 51a2f271a954..977e897c7096 100644 --- a/java/openapi/src/com/intellij/ui/UIHelper.java +++ b/java/openapi/src/com/intellij/ui/UIHelper.java @@ -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); diff --git a/platform/core-api/src/com/intellij/lang/PsiBuilderFactory.java b/platform/core-api/src/com/intellij/lang/PsiBuilderFactory.java index 340293599732..27ebb6b84b5f 100644 --- a/platform/core-api/src/com/intellij/lang/PsiBuilderFactory.java +++ b/platform/core-api/src/com/intellij/lang/PsiBuilderFactory.java @@ -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); diff --git a/platform/projectModel-impl/src/com/intellij/openapi/projectRoots/impl/ProjectJdkImpl.java b/platform/projectModel-impl/src/com/intellij/openapi/projectRoots/impl/ProjectJdkImpl.java index be9715fff9a5..f2ee8cf64d66 100644 --- a/platform/projectModel-impl/src/com/intellij/openapi/projectRoots/impl/ProjectJdkImpl.java +++ b/platform/projectModel-impl/src/com/intellij/openapi/projectRoots/impl/ProjectJdkImpl.java @@ -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() { diff --git a/plugins/ant/src/com/intellij/lang/ant/config/execution/AntBuildMessageView.java b/plugins/ant/src/com/intellij/lang/ant/config/execution/AntBuildMessageView.java index 195b8525ba99..ca8f37683deb 100644 --- a/plugins/ant/src/com/intellij/lang/ant/config/execution/AntBuildMessageView.java +++ b/plugins/ant/src/com/intellij/lang/ant/config/execution/AntBuildMessageView.java @@ -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); diff --git a/plugins/devkit/src/actions/NewActionDialog.java b/plugins/devkit/src/actions/NewActionDialog.java index 1e1d6ebe583a..faa1db563ec2 100644 --- a/plugins/devkit/src/actions/NewActionDialog.java +++ b/plugins/devkit/src/actions/NewActionDialog.java @@ -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() { + new ListSpeedSearch(myGroupList, new Function() { public String fun(final Object o) { return ActionManager.getInstance().getId((AnAction) o); } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/groovydoc/parser/GroovyDocElementTypes.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/groovydoc/parser/GroovyDocElementTypes.java index d8da4bde4b35..be00d2932c32 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/groovydoc/parser/GroovyDocElementTypes.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/groovydoc/parser/GroovyDocElementTypes.java @@ -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(); diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/groovydoc/parser/elements/GroovyDocTagValueTokenType.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/groovydoc/parser/elements/GroovyDocTagValueTokenType.java index 903c0d0e6fc1..a372cef07bed 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/groovydoc/parser/elements/GroovyDocTagValueTokenType.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/groovydoc/parser/elements/GroovyDocTagValueTokenType.java @@ -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())) {