From 9a2c735d5185de4e1eea09a40f033a9da59408f0 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Mon, 16 Apr 2012 21:17:11 +0200 Subject: [PATCH] Drop deprecated APIs --- .../roots/ui/FileAppearanceServiceImpl.java | 5 +- .../AnalyzeDependenciesComponent.java | 8 +- .../intellij/psi/PsiLiteralExpression.java | 7 +- .../src/com/intellij/psi/PsiType.java | 9 +- .../compiled/ClsLiteralExpressionImpl.java | 7 +- .../tree/java/PsiLiteralExpressionImpl.java | 7 +- .../codeInsight/daemon/GroupNames.java | 13 +- .../com/intellij/openapi/vfs/VirtualFile.java | 7 - .../codeInspection/IntentionProvider.java | 27 --- .../util/OrderEntryCellAppearanceUtils.java | 216 ------------------ .../ui/configuration/ContentEntryEditor.java | 8 - .../highlighting/TooltipLinkHandler.java | 12 +- .../configurations/GeneralCommandLine.java | 36 +-- .../fileChooser/FileChooserDescriptor.java | 13 -- .../fileChooser/MacFileChooserDialog.java | 37 --- .../openapi/roots/ui/CellAppearanceEx.java | 11 +- .../util/BaseTextCommentCellAppearance.java | 3 +- .../openapi/roots/ui/util/CellAppearance.java | 26 --- .../roots/ui/util/CellAppearanceUtils.java | 80 ------- .../roots/ui/util/CompositeAppearance.java | 7 +- .../ui/util/ModifiableCellAppearance.java | 27 --- .../ui/util/SimpleTextCellAppearance.java | 15 +- .../openapi/ui/ComboBoxTableRenderer.java | 10 +- .../com/intellij/ui/HtmlListCellRenderer.java | 9 +- .../fileChooser/ex/FileChooserDialogImpl.java | 5 - .../fileChooser/ex/FileSystemTreeImpl.java | 9 - .../intellij/openapi/util/io/FileUtil.java | 12 - .../util/ui/MappingListCellRenderer.java | 52 ----- .../util/src/com/intellij/util/ui/UIUtil.java | 16 -- .../explorer/AntBuildFileNodeDescriptor.java | 4 +- .../config/explorer/AntNodeDescriptor.java | 5 +- .../explorer/AntTargetNodeDescriptor.java | 4 +- .../plugins/groovy/mvc/MvcConsole.java | 31 ++- .../plugins/groovy/mvc/MvcFramework.java | 44 ++-- .../plugins/groovy/mvc/MvcRunTarget.java | 22 +- 35 files changed, 97 insertions(+), 707 deletions(-) delete mode 100644 platform/lang-api/src/com/intellij/codeInspection/IntentionProvider.java delete mode 100644 platform/lang-api/src/com/intellij/openapi/roots/ui/util/OrderEntryCellAppearanceUtils.java delete mode 100644 platform/platform-api/src/com/intellij/openapi/fileChooser/MacFileChooserDialog.java delete mode 100644 platform/platform-api/src/com/intellij/openapi/roots/ui/util/CellAppearance.java delete mode 100644 platform/platform-api/src/com/intellij/openapi/roots/ui/util/CellAppearanceUtils.java delete mode 100644 platform/platform-api/src/com/intellij/openapi/roots/ui/util/ModifiableCellAppearance.java delete mode 100644 platform/util/src/com/intellij/util/ui/MappingListCellRenderer.java diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/FileAppearanceServiceImpl.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/FileAppearanceServiceImpl.java index 277e35f16030..d71f083021c6 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/FileAppearanceServiceImpl.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/FileAppearanceServiceImpl.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. @@ -32,11 +32,12 @@ import java.io.File; public class FileAppearanceServiceImpl extends FileAppearanceService { private static CellAppearanceEx EMPTY = new CellAppearanceEx() { @Override - public void customize(SimpleColoredComponent component) { } + public void customize(@NotNull SimpleColoredComponent component) { } @Override public void customize(@NotNull HtmlListCellRenderer renderer) { } + @NotNull @Override public String getText() { return ""; } }; diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/dependencyAnalysis/AnalyzeDependenciesComponent.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/dependencyAnalysis/AnalyzeDependenciesComponent.java index c2e2ad24d897..c0e3997ccafd 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/dependencyAnalysis/AnalyzeDependenciesComponent.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/dependencyAnalysis/AnalyzeDependenciesComponent.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. @@ -537,7 +537,7 @@ public class AnalyzeDependenciesComponent extends MasterDetailsComponent { public CellAppearanceEx getAppearance(boolean selected, final boolean isBold) { return new CellAppearanceEx() { @Override - public void customize(SimpleColoredComponent component) { + public void customize(@NotNull SimpleColoredComponent component) { component.setIcon(getIcon()); final Font font = UIUtil.getTreeFont(); if (isBold) { @@ -557,6 +557,7 @@ public class AnalyzeDependenciesComponent extends MasterDetailsComponent { throw new UnsupportedOperationException("Rendering in combo box not supported yet."); } + @NotNull @Override public String getText() { return getDisplayName(); @@ -618,7 +619,7 @@ public class AnalyzeDependenciesComponent extends MasterDetailsComponent { if (e.getOwnerModule() == myModule) { return new CellAppearanceEx() { @Override - public void customize(SimpleColoredComponent component) { + public void customize(@NotNull SimpleColoredComponent component) { component.setIcon(ModuleType.get(myModule).getNodeIcon(false)); component.append("", SimpleTextAttributes.SYNTHETIC_ATTRIBUTES); } @@ -628,6 +629,7 @@ public class AnalyzeDependenciesComponent extends MasterDetailsComponent { throw new UnsupportedOperationException("Rendering in combo box not supported yet."); } + @NotNull @Override public String getText() { return ""; diff --git a/java/java-psi-api/src/com/intellij/psi/PsiLiteralExpression.java b/java/java-psi-api/src/com/intellij/psi/PsiLiteralExpression.java index 53ca5783fa95..bf680e106ba6 100644 --- a/java/java-psi-api/src/com/intellij/psi/PsiLiteralExpression.java +++ b/java/java-psi-api/src/com/intellij/psi/PsiLiteralExpression.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. @@ -15,13 +15,8 @@ */ package com.intellij.psi; -import org.jetbrains.annotations.Nullable; - /** * Represents a Java literal expression. */ public interface PsiLiteralExpression extends PsiExpression, PsiLiteral { - /** @deprecated (to remove in IDEA 12) */ - @Nullable - String getParsingError(); } diff --git a/java/java-psi-api/src/com/intellij/psi/PsiType.java b/java/java-psi-api/src/com/intellij/psi/PsiType.java index fe442dac8ac5..5ed21bd5fdd0 100644 --- a/java/java-psi-api/src/com/intellij/psi/PsiType.java +++ b/java/java-psi-api/src/com/intellij/psi/PsiType.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. @@ -123,13 +123,6 @@ public abstract class PsiType implements PsiAnnotationOwner { return JavaPsiFacade.getInstance(manager.getProject()).getElementFactory().createTypeByFQClassName(CommonClassNames.JAVA_LANG_CLASS, resolveScope); } - /** - * @deprecated use {@linkplain #getJavaLangThrowable(PsiManager, com.intellij.psi.search.GlobalSearchScope)} (todo: to remove in IDEA 12) - */ - public static PsiClassType getJavaLangTrowable(PsiManager manager, GlobalSearchScope resolveScope) { - return getJavaLangThrowable(manager, resolveScope); - } - /** * Returns the class type for the java.lang.Throwable class. * diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/compiled/ClsLiteralExpressionImpl.java b/java/java-psi-impl/src/com/intellij/psi/impl/compiled/ClsLiteralExpressionImpl.java index d73610037b54..4c31f9f4fa94 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/compiled/ClsLiteralExpressionImpl.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/compiled/ClsLiteralExpressionImpl.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. @@ -52,11 +52,6 @@ public class ClsLiteralExpressionImpl extends ClsElementImpl implements PsiLiter return myText; } - @Override - public String getParsingError() { - return null; - } - @Override public void appendMirrorText(final int indentLevel, final StringBuilder buffer) { buffer.append(getText()); diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiLiteralExpressionImpl.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiLiteralExpressionImpl.java index 297e1b97eab0..53cc1246dba5 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiLiteralExpressionImpl.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiLiteralExpressionImpl.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. @@ -217,11 +217,6 @@ public class PsiLiteralExpressionImpl return integer; } - @Override - public String getParsingError() { - return null; - } - @Nullable private static String internedParseStringCharacters(final String chars) { final StringBuilder outChars = new StringBuilder(chars.length()); diff --git a/java/openapi/src/com/intellij/codeInsight/daemon/GroupNames.java b/java/openapi/src/com/intellij/codeInsight/daemon/GroupNames.java index 0be6fc5081cb..50789eb52802 100644 --- a/java/openapi/src/com/intellij/codeInsight/daemon/GroupNames.java +++ b/java/openapi/src/com/intellij/codeInsight/daemon/GroupNames.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. @@ -67,15 +67,4 @@ public interface GroupNames { String JAVAEE_GROUP_NAME = InspectionsBundle.message("group.names.javaee.issues"); String CONCURRENCY_ANNOTATION_ISSUES = InspectionsBundle.message("group.names.concurrency.annotation.issues"); String JAVADOC_GROUP_NAME = InspectionsBundle.message("group.names.javadoc.issues"); - - /** @deprecated use #CLASS_LAYOUT_GROUP_NAME (todo: remove in IDEA 12) */ - String CLASSLAYOUT_GROUP_NAME = CLASS_LAYOUT_GROUP_NAME; - /** @deprecated use #CLASS_METRICS_GROUP_NAME (todo: remove in IDEA 12) */ - String CLASSMETRICS_GROUP_NAME = CLASS_METRICS_GROUP_NAME; - /** @deprecated use #ERROR_HANDLING_GROUP_NAME (todo: remove in IDEA 12) */ - String ERRORHANDLING_GROUP_NAME = ERROR_HANDLING_GROUP_NAME; - /** @deprecated use #METHOD_METRICS_GROUP_NAME (todo: remove in IDEA 12) */ - String METHODMETRICS_GROUP_NAME = METHOD_METRICS_GROUP_NAME; - /** @deprecated use #LANGUAGE_LEVEL_SPECIFIC_GROUP_NAME (todo: remove in IDEA 12) */ - String JDK15_SPECIFIC_GROUP_NAME = LANGUAGE_LEVEL_SPECIFIC_GROUP_NAME; } diff --git a/platform/core-api/src/com/intellij/openapi/vfs/VirtualFile.java b/platform/core-api/src/com/intellij/openapi/vfs/VirtualFile.java index 122f5efce2eb..202d0476bf57 100644 --- a/platform/core-api/src/com/intellij/openapi/vfs/VirtualFile.java +++ b/platform/core-api/src/com/intellij/openapi/vfs/VirtualFile.java @@ -212,13 +212,6 @@ public abstract class VirtualFile extends UserDataHolderBase implements Modifica return false; } - /** @deprecated use {@linkplain #getCanonicalFile()} (to remove in IDEA 12) */ - @SuppressWarnings({"MethodMayBeStatic", "UnusedDeclaration"}) - @Nullable - public String resolveSymLink() { - return null; - } - /** * Checks whether this file is a special (e.g. FIFO or device) file. * diff --git a/platform/lang-api/src/com/intellij/codeInspection/IntentionProvider.java b/platform/lang-api/src/com/intellij/codeInspection/IntentionProvider.java deleted file mode 100644 index 41e58651b7fe..000000000000 --- a/platform/lang-api/src/com/intellij/codeInspection/IntentionProvider.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2000-2011 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.codeInspection; - -import com.intellij.codeInsight.intention.IntentionAction; -import org.jetbrains.annotations.NotNull; - -import java.util.Collection; - -/** @deprecated (to remove in IDEA 12) */ -public interface IntentionProvider { - @NotNull - Collection getIntentions(); -} diff --git a/platform/lang-api/src/com/intellij/openapi/roots/ui/util/OrderEntryCellAppearanceUtils.java b/platform/lang-api/src/com/intellij/openapi/roots/ui/util/OrderEntryCellAppearanceUtils.java deleted file mode 100644 index 1f08b56986c7..000000000000 --- a/platform/lang-api/src/com/intellij/openapi/roots/ui/util/OrderEntryCellAppearanceUtils.java +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Copyright 2000-2011 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.roots.ui.util; - -import com.intellij.openapi.module.Module; -import com.intellij.openapi.module.ModuleType; -import com.intellij.openapi.project.Project; -import com.intellij.openapi.project.ProjectBundle; -import com.intellij.openapi.projectRoots.Sdk; -import com.intellij.openapi.roots.*; -import com.intellij.openapi.roots.libraries.Library; -import com.intellij.openapi.roots.ui.FileAppearanceService; -import com.intellij.openapi.roots.ui.LightFilePointer; -import com.intellij.openapi.util.IconLoader; -import com.intellij.openapi.util.text.StringUtil; -import com.intellij.openapi.vfs.*; -import com.intellij.ui.SimpleTextAttributes; -import com.intellij.util.PathUtil; -import com.intellij.util.PlatformIcons; -import org.jetbrains.annotations.Nullable; - -import javax.swing.*; -import java.awt.*; -import java.io.File; - -/** - * @deprecated please use {@linkplain com.intellij.openapi.roots.ui.OrderEntryAppearanceService} (to remove in IDEA 12) - */ -@SuppressWarnings("UnusedDeclaration") -public class OrderEntryCellAppearanceUtils { - public static final Icon EXCLUDE_FOLDER_ICON = IconLoader.getDisabledIcon(PlatformIcons.FOLDER_ICON); - public static final Icon GENERIC_JDK_ICON = IconLoader.getIcon("/general/jdk.png"); - public static final String NO_JDK = ProjectBundle.message("jdk.missing.item"); - - private OrderEntryCellAppearanceUtils() { } - - public static CellAppearance forOrderEntry(OrderEntry orderEntry, boolean selected) { - if (orderEntry instanceof JdkOrderEntry) { - JdkOrderEntry jdkLibraryEntry = (JdkOrderEntry)orderEntry; - Sdk jdk = jdkLibraryEntry.getJdk(); - if (!orderEntry.isValid()) { - final String oldJdkName = jdkLibraryEntry.getJdkName(); - return FileAppearanceService.getInstance().forInvalidUrl(oldJdkName != null ? oldJdkName : NO_JDK); - } - return forJdk(jdk, false, selected); - } - else if (!orderEntry.isValid()) { - return FileAppearanceService.getInstance().forInvalidUrl(orderEntry.getPresentableName()); - } - else if (orderEntry instanceof LibraryOrderEntry) { - LibraryOrderEntry libraryOrderEntry = (LibraryOrderEntry)orderEntry; - final Library library = libraryOrderEntry.getLibrary(); - if (!libraryOrderEntry.isValid()){ //library can be removed - return FileAppearanceService.getInstance().forInvalidUrl(orderEntry.getPresentableName()); - } - return forLibrary(library); - } - else if (orderEntry.isSynthetic()) { - String presentableName = orderEntry.getPresentableName(); - Icon icon = orderEntry instanceof ModuleSourceOrderEntry ? sourceFolderIcon(false) : null; - return new SimpleTextCellAppearance(presentableName, icon, SimpleTextAttributes.SYNTHETIC_ATTRIBUTES); - } - else if (orderEntry instanceof ModuleOrderEntry) { - final Icon icon = ModuleType.get(((ModuleOrderEntry)orderEntry).getModule()).getNodeIcon(false); - return SimpleTextCellAppearance.regular(orderEntry.getPresentableName(), icon); - } - else return CompositeAppearance.single(orderEntry.getPresentableName()); - } - - public static CellAppearance forLibrary(Library library) { - return forLibrary(library, false); - } - - public static CellAppearance forLibrary(Library library, final boolean hasInvalidRoots) { - String name = library.getName(); - if (name != null) { - return normalOrRedWaved(name, PlatformIcons.LIBRARY_ICON, hasInvalidRoots); - } - String[] files = library.getUrls(OrderRootType.CLASSES); - if (files.length == 0) { - return SimpleTextCellAppearance.invalid(ProjectBundle.message("library.empty.library.item"), PlatformIcons.LIBRARY_ICON); - } - if (files.length == 1) { - return forVirtualFilePointer(new LightFilePointer(files[0])); - } - String url = StringUtil.trimEnd(files[0], JarFileSystem.JAR_SEPARATOR); - return SimpleTextCellAppearance.regular(PathUtil.getFileName(url), PlatformIcons.LIBRARY_ICON); - } - - public static CellAppearance normalOrRedWaved(String text, final Icon icon, boolean waved) { - if (waved) { - return new SimpleTextCellAppearance(text, icon, new SimpleTextAttributes(SimpleTextAttributes.STYLE_WAVED, null, Color.RED)); - } - return SimpleTextCellAppearance.regular(text, icon); - } - - public static Icon sourceFolderIcon(boolean testSource) { - return testSource ? PlatformIcons.TEST_SOURCE_FOLDER : PlatformIcons.SOURCE_FOLDERS_ICON; - } - - public static ModifiableCellAppearance forJdk(@Nullable Sdk jdk, boolean isInComboBox, final boolean selected, final boolean showVersion) { - if (jdk == null) { - return (ModifiableCellAppearance)FileAppearanceService.getInstance().forInvalidUrl(NO_JDK); - } - String name = jdk.getName(); - CompositeAppearance appearance = new CompositeAppearance(); - appearance.setIcon(jdk.getSdkType().getIcon()); - VirtualFile homeDirectory = jdk.getHomeDirectory(); - SimpleTextAttributes attributes = homeDirectory != null && homeDirectory.isValid() - ? CellAppearanceUtils.createSimpleCellAttributes(selected) : SimpleTextAttributes.ERROR_ATTRIBUTES; - CompositeAppearance.DequeEnd ending = appearance.getEnding(); - ending.addText(name, attributes); - if (showVersion) { - String versionString = jdk.getVersionString(); - if (versionString != null && !versionString.equals(name)) { - SimpleTextAttributes textAttributes = isInComboBox - ? SimpleTextAttributes.SYNTHETIC_ATTRIBUTES : SimpleTextAttributes.GRAY_ATTRIBUTES; - ending.addComment(versionString, textAttributes); - } - } - return ending.getAppearance(); - } - - public static CellAppearance forJdk(@Nullable Sdk jdk, boolean isInComboBox, final boolean selected) { - return forJdk(jdk, isInComboBox, selected, true); - } - - public static SimpleTextCellAppearance forSourceFolder(SourceFolder folder) { - return formatRelativePath(folder, PlatformIcons.FOLDER_ICON); - } - - public static CellAppearance forExcludeFolder(ExcludeFolder folder) { - return formatRelativePath(folder, EXCLUDE_FOLDER_ICON); - } - - public static CellAppearance forContentFolder(ContentFolder folder) { - if (folder instanceof SourceFolder) { - return forSourceFolder((SourceFolder)folder); - } - else if (folder instanceof ExcludeFolder) { - return forExcludeFolder((ExcludeFolder)folder); - } - else { - throw new RuntimeException(folder.getClass().getName()); - } - } - - public static CellAppearance forModule(Module module) { - return SimpleTextCellAppearance.regular(module.getName(), ModuleType.get(module).getNodeIcon(false)); - } - - public static CellAppearance forContentEntry(ContentEntry contentEntry) { - return forVirtualFilePointer(new LightFilePointer(contentEntry.getUrl())); - } - - public static SimpleTextCellAppearance formatRelativePath(ContentFolder folder, Icon icon) { - LightFilePointer folderFile = new LightFilePointer(folder.getUrl()); - VirtualFile file = VirtualFileManager.getInstance().findFileByUrl(folder.getContentEntry().getUrl()); - if (file == null) return (SimpleTextCellAppearance)FileAppearanceService.getInstance().forInvalidUrl(folderFile.getPresentableUrl()); - String contentPath = file.getPath(); - String relativePath; - SimpleTextAttributes textAttributes; - if (!folderFile.isValid()) { - textAttributes = SimpleTextAttributes.ERROR_ATTRIBUTES; - String absolutePath = folderFile.getPresentableUrl(); - relativePath = absolutePath.startsWith(contentPath) ? absolutePath.substring(contentPath.length()) : absolutePath; - } - else { - relativePath = VfsUtilCore.getRelativePath(folderFile.getFile(), file, File.separatorChar); - textAttributes = SimpleTextAttributes.REGULAR_ATTRIBUTES; - } - if (relativePath == null) relativePath = ""; - relativePath = relativePath.length() == 0 ? "." + File.separatorChar : relativePath; - return new SimpleTextCellAppearance(relativePath, icon, textAttributes); - } - - public static CellAppearance forProjectJdk(final Project project) { - final ProjectRootManager projectRootManager = ProjectRootManager.getInstance(project); - final Sdk projectJdk = projectRootManager.getProjectSdk(); - final CellAppearance appearance; - if (projectJdk != null) { - appearance = forJdk(projectJdk, false, false); - } - else { - // probably invalid JDK - final String projectJdkName = projectRootManager.getProjectSdkName(); - if (projectJdkName != null) { - appearance = FileAppearanceService.getInstance().forInvalidUrl(ProjectBundle.message("jdk.combo.box.invalid.item", projectJdkName)); - } - else { - appearance = forJdk(null, false, false); - } - } - return appearance; - } - - public static CellAppearance forVirtualFilePointer(LightFilePointer filePointer) { - final VirtualFile file = filePointer.getFile(); - return file != null ? FileAppearanceService.getInstance().forVirtualFile(file) - : FileAppearanceService.getInstance().forInvalidUrl(filePointer.getPresentableUrl()); - } -} diff --git a/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/ContentEntryEditor.java b/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/ContentEntryEditor.java index 9b0db57dd926..6f84cd1c8266 100644 --- a/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/ContentEntryEditor.java +++ b/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/ContentEntryEditor.java @@ -262,14 +262,6 @@ public abstract class ContentEntryEditor implements ContentRootPanel.ActionCallb } } - /** @deprecated use {@linkplain #doRemoveExcludeFolder(com.intellij.openapi.roots.ExcludeFolder)} (to remove in IDEA 12) */ - protected void doRemoveExcludeFolder(ExcludeFolder excludeFolder, VirtualFile file) { - if (!excludeFolder.isSynthetic()) { - final ContentEntry contentEntry = getContentEntry(); - if (contentEntry != null) contentEntry.removeExcludeFolder(excludeFolder); - } - } - public boolean isSource(@NotNull final VirtualFile file) { final SourceFolder sourceFolder = getSourceFolder(file); return sourceFolder != null && !sourceFolder.isTestSource(); diff --git a/platform/platform-api/src/com/intellij/codeInsight/highlighting/TooltipLinkHandler.java b/platform/platform-api/src/com/intellij/codeInsight/highlighting/TooltipLinkHandler.java index c74ba25e0ee3..e53644ba53d5 100644 --- a/platform/platform-api/src/com/intellij/codeInsight/highlighting/TooltipLinkHandler.java +++ b/platform/platform-api/src/com/intellij/codeInsight/highlighting/TooltipLinkHandler.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. @@ -19,20 +19,10 @@ import com.intellij.openapi.editor.Editor; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import javax.swing.*; - /** * @author peter */ public abstract class TooltipLinkHandler { - /** - * @deprecated use {@link #handleLink(String, com.intellij.openapi.editor.Editor)} (to remove in IDEA 12) - */ - @SuppressWarnings("UnusedDeclaration") - public void handleLink(@NotNull String refSuffix, @NotNull Editor editor, @NotNull JEditorPane tooltip) { - handleLink(refSuffix, editor); - } - /** * Override to handle mouse clicks on a link. * diff --git a/platform/platform-api/src/com/intellij/execution/configurations/GeneralCommandLine.java b/platform/platform-api/src/com/intellij/execution/configurations/GeneralCommandLine.java index 60c7154d1da4..0d59afede2d8 100644 --- a/platform/platform-api/src/com/intellij/execution/configurations/GeneralCommandLine.java +++ b/platform/platform-api/src/com/intellij/execution/configurations/GeneralCommandLine.java @@ -141,14 +141,6 @@ public class GeneralCommandLine implements UserDataHolder { myRedirectErrorStream = redirectErrorStream; } - /** - * @deprecated please use {@link #getCommandLineString()} (to remove in IDEA 12). - */ - @SuppressWarnings("UnusedDeclaration") - public String getCommandLineParams() { - return getCommandLineString(); - } - /** * Returns string representation of this command line.
* Warning: resulting string is not OS-dependent - do not use it for executing this command line. @@ -182,30 +174,14 @@ public class GeneralCommandLine implements UserDataHolder { } /** - * Returns a list of command and its parameters prepared in OS-dependent way to be executed by e.g. {@link Runtime#exec(String[])}. + * Prepares command (quotes and escapes all arguments) and returns it as a newline-separated list + * (suitable e.g. for passing in a environment variable). * - * @deprecated this method is not intended for internal use (to remove in IDEA 12). + * @return command as a newline-separated list. */ - public String[] getCommands() { - return prepareCommands(); - } - - /** - * @deprecated use {@link #addParameter(String)} and {@link #addParameters(String...)} methods for adding parameters - - * any quoting needed will be done on {@link #createProcess()} (to remove in IDEA 12). - */ - @SuppressWarnings("UnusedDeclaration") - public static String quoteParameter(final String parameter) { - return parameter; - } - - /** - * @deprecated use {@link #addParameter(String)} and {@link #addParameters(String...)} methods for adding parameters - - * any quoting needed will be done on {@link #createProcess()} (to remove in IDEA 12). - */ - @SuppressWarnings("UnusedDeclaration") - public static String quote(final String parameter) { - return parameter; + @NotNull + public String getPreparedCommandLine() { + return StringUtil.join(prepareCommands(), "\n"); } public Process createProcess() throws ExecutionException { diff --git a/platform/platform-api/src/com/intellij/openapi/fileChooser/FileChooserDescriptor.java b/platform/platform-api/src/com/intellij/openapi/fileChooser/FileChooserDescriptor.java index d4b150d8dd76..d69b4c68c2bb 100644 --- a/platform/platform-api/src/com/intellij/openapi/fileChooser/FileChooserDescriptor.java +++ b/platform/platform-api/src/com/intellij/openapi/fileChooser/FileChooserDescriptor.java @@ -76,19 +76,6 @@ public class FileChooserDescriptor implements Cloneable { myChooseMultiple = chooseMultiple; } - /** @deprecated use {@linkplain FileChooserDescriptorFactory} (to remove in IDEA 12) */ - @SuppressWarnings("UnusedDeclaration") - public FileChooserDescriptor() { - this(false, false, false, false, false, false); - } - - /** @deprecated use {@linkplain FileChooserDescriptorFactory} (to remove in IDEA 12) */ - @SuppressWarnings("UnusedDeclaration") - public FileChooserDescriptor chooseFolders() { - myChooseFolders = true; - return this; - } - public final String getTitle() { return myTitle; } diff --git a/platform/platform-api/src/com/intellij/openapi/fileChooser/MacFileChooserDialog.java b/platform/platform-api/src/com/intellij/openapi/fileChooser/MacFileChooserDialog.java deleted file mode 100644 index 94ebfc23e5d7..000000000000 --- a/platform/platform-api/src/com/intellij/openapi/fileChooser/MacFileChooserDialog.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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. - * 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.fileChooser; - -import com.intellij.openapi.actionSystem.DataKey; -import com.intellij.openapi.project.Project; -import com.intellij.openapi.vfs.VirtualFile; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -/** - * @deprecated use {@linkplain PathChooserDialog} (to remove in IDEA 12) - */ -@SuppressWarnings("UnusedDeclaration") -public interface MacFileChooserDialog extends FileChooserDialog { - DataKey NATIVE_MAC_FILE_CHOOSER_ENABLED = DataKey.create("native.mac.file.chooser.enabled"); - DataKey NATIVE_MAC_FILE_CHOOSER_SHOW_HIDDEN_FILES_ENABLED = PathChooserDialog.NATIVE_MAC_CHOOSER_SHOW_HIDDEN_FILES; - - void chooseWithSheet(@Nullable VirtualFile toSelect, @Nullable Project project, @NotNull final MacFileChooserCallback callback); - - interface MacFileChooserCallback { - void onChosen(@NotNull VirtualFile[] files); - } -} diff --git a/platform/platform-api/src/com/intellij/openapi/roots/ui/CellAppearanceEx.java b/platform/platform-api/src/com/intellij/openapi/roots/ui/CellAppearanceEx.java index bfc7d948c870..0d6a8fe95df9 100644 --- a/platform/platform-api/src/com/intellij/openapi/roots/ui/CellAppearanceEx.java +++ b/platform/platform-api/src/com/intellij/openapi/roots/ui/CellAppearanceEx.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. @@ -15,10 +15,15 @@ */ package com.intellij.openapi.roots.ui; -import com.intellij.openapi.roots.ui.util.CellAppearance; import com.intellij.ui.HtmlListCellRenderer; +import com.intellij.ui.SimpleColoredComponent; import org.jetbrains.annotations.NotNull; -public interface CellAppearanceEx extends CellAppearance { +public interface CellAppearanceEx { + @NotNull + String getText(); + void customize(@NotNull HtmlListCellRenderer renderer); + + void customize(@NotNull SimpleColoredComponent component); } diff --git a/platform/platform-api/src/com/intellij/openapi/roots/ui/util/BaseTextCommentCellAppearance.java b/platform/platform-api/src/com/intellij/openapi/roots/ui/util/BaseTextCommentCellAppearance.java index 9799c8252a92..b2386f600103 100644 --- a/platform/platform-api/src/com/intellij/openapi/roots/ui/util/BaseTextCommentCellAppearance.java +++ b/platform/platform-api/src/com/intellij/openapi/roots/ui/util/BaseTextCommentCellAppearance.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. @@ -52,6 +52,7 @@ public abstract class BaseTextCommentCellAppearance implements CellAppearanceEx } } + @NotNull public String getText() { String secondaryText = getSecondaryText(); if (secondaryText != null && secondaryText.length() > 0) { diff --git a/platform/platform-api/src/com/intellij/openapi/roots/ui/util/CellAppearance.java b/platform/platform-api/src/com/intellij/openapi/roots/ui/util/CellAppearance.java deleted file mode 100644 index 5e5cb447470c..000000000000 --- a/platform/platform-api/src/com/intellij/openapi/roots/ui/util/CellAppearance.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2000-2011 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.roots.ui.util; - -import com.intellij.ui.SimpleColoredComponent; - -/** - * @deprecated please use {@linkplain com.intellij.openapi.roots.ui.CellAppearanceEx} (to remove in IDEA 12). - */ -public interface CellAppearance { - void customize(SimpleColoredComponent component); - String getText(); -} diff --git a/platform/platform-api/src/com/intellij/openapi/roots/ui/util/CellAppearanceUtils.java b/platform/platform-api/src/com/intellij/openapi/roots/ui/util/CellAppearanceUtils.java deleted file mode 100644 index e7cadb792db4..000000000000 --- a/platform/platform-api/src/com/intellij/openapi/roots/ui/util/CellAppearanceUtils.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2000-2011 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.roots.ui.util; - -import com.intellij.ide.presentation.VirtualFilePresentation; -import com.intellij.openapi.fileTypes.FileType; -import com.intellij.openapi.fileTypes.FileTypeManager; -import com.intellij.openapi.roots.ui.FileAppearanceService; -import com.intellij.openapi.util.IconLoader; -import com.intellij.openapi.vfs.JarFileSystem; -import com.intellij.openapi.vfs.VirtualFile; -import com.intellij.ui.SimpleTextAttributes; -import com.intellij.util.PlatformIcons; - -import javax.swing.*; -import java.io.File; - -/** - * @deprecated please use {@linkplain com.intellij.openapi.roots.ui.FileAppearanceService} (to remove in IDEA 12) - */ -@SuppressWarnings("UnusedDeclaration") -public class CellAppearanceUtils { - public static final Icon INVALID_ICON = PlatformIcons.INVALID_ENTRY_ICON; - public static final CellAppearance EMPTY = FileAppearanceService.getInstance().empty(); - - private CellAppearanceUtils() { } - - public static SimpleTextAttributes createSimpleCellAttributes(boolean isSelected) { - return isSelected ? SimpleTextAttributes.SELECTED_SIMPLE_CELL_ATTRIBUTES : SimpleTextAttributes.SIMPLE_CELL_ATTRIBUTES; - } - - public static CellAppearance forVirtualFile(VirtualFile virtualFile) { - return FileAppearanceService.getInstance().forVirtualFile(virtualFile); - } - - public static CellAppearance forValidVirtualFile(VirtualFile virtualFile) { - return FileAppearanceService.getInstance().forVirtualFile(virtualFile); - } - - public static Icon iconForFile(VirtualFile file) { - if (file.getFileSystem().getProtocol().equals(JarFileSystem.PROTOCOL) && file.getParent() == null) { - return VirtualFilePresentation.getIcon(file); - } - if (file.isDirectory()) return PlatformIcons.FOLDER_ICON; - return VirtualFilePresentation.getIcon(file); - } - - public static Icon excludeIcon(Icon icon) { - return IconLoader.getDisabledIcon(icon); - } - - public static CompositeAppearance forFile(File file) { - String absolutePath = file.getAbsolutePath(); - if (!file.exists()) return CompositeAppearance.invalid(absolutePath); - if (file.isDirectory()) { - CompositeAppearance appearance = CompositeAppearance.single(absolutePath); - appearance.setIcon(PlatformIcons.FOLDER_ICON); - return appearance; - } - String name = file.getName(); - FileType fileType = FileTypeManager.getInstance().getFileTypeByFileName(name); - File parent = file.getParentFile(); - CompositeAppearance appearance = CompositeAppearance.textComment(name, parent.getAbsolutePath()); - appearance.setIcon(fileType.getIcon()); - return appearance; - } -} diff --git a/platform/platform-api/src/com/intellij/openapi/roots/ui/util/CompositeAppearance.java b/platform/platform-api/src/com/intellij/openapi/roots/ui/util/CompositeAppearance.java index 197618b84a1b..8ec0e75a36a2 100644 --- a/platform/platform-api/src/com/intellij/openapi/roots/ui/util/CompositeAppearance.java +++ b/platform/platform-api/src/com/intellij/openapi/roots/ui/util/CompositeAppearance.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. @@ -31,14 +31,14 @@ import java.util.ArrayList; import java.util.Iterator; // todo: move to lang-impl ? -public class CompositeAppearance implements ModifiableCellAppearanceEx, ModifiableCellAppearance { +public class CompositeAppearance implements ModifiableCellAppearanceEx { private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.roots.ui.util.CompositeAppearance"); private Icon myIcon; private final ArrayList mySections = new ArrayList(); private int myInsertionIndex = 0; - public void customize(SimpleColoredComponent component) { + public void customize(@NotNull SimpleColoredComponent component) { synchronized (mySections) { for (TextSection section : mySections) { final TextAttributes attributes = section.getTextAttributes(); @@ -71,6 +71,7 @@ public class CompositeAppearance implements ModifiableCellAppearanceEx, Modifiab } } + @NotNull public String getText() { synchronized (mySections) { StringBuilder buffer = new StringBuilder(); diff --git a/platform/platform-api/src/com/intellij/openapi/roots/ui/util/ModifiableCellAppearance.java b/platform/platform-api/src/com/intellij/openapi/roots/ui/util/ModifiableCellAppearance.java deleted file mode 100644 index 353297d23c7c..000000000000 --- a/platform/platform-api/src/com/intellij/openapi/roots/ui/util/ModifiableCellAppearance.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2000-2011 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.roots.ui.util; - -import javax.swing.*; - -/** - * @author dyoma - * @deprecated please use {@linkplain com.intellij.openapi.roots.ui.ModifiableCellAppearanceEx} (to remove in IDEA 12). - */ -public interface ModifiableCellAppearance extends CellAppearance { - Icon getIcon(); - void setIcon(Icon icon); -} diff --git a/platform/platform-api/src/com/intellij/openapi/roots/ui/util/SimpleTextCellAppearance.java b/platform/platform-api/src/com/intellij/openapi/roots/ui/util/SimpleTextCellAppearance.java index e598f3f62fde..bba26727092d 100644 --- a/platform/platform-api/src/com/intellij/openapi/roots/ui/util/SimpleTextCellAppearance.java +++ b/platform/platform-api/src/com/intellij/openapi/roots/ui/util/SimpleTextCellAppearance.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. @@ -25,7 +25,7 @@ import org.jetbrains.annotations.Nullable; import javax.swing.*; // todo: move to lang-impl ? -public class SimpleTextCellAppearance implements ModifiableCellAppearanceEx, ModifiableCellAppearance { +public class SimpleTextCellAppearance implements ModifiableCellAppearanceEx { private Icon myIcon; private final SimpleTextAttributes myTextAttributes; private final String myText; @@ -38,11 +38,6 @@ public class SimpleTextCellAppearance implements ModifiableCellAppearanceEx, Mod return new SimpleTextCellAppearance(text, icon, SimpleTextAttributes.ERROR_ATTRIBUTES); } - /** @deprecated use {@linkplain #regular(String, javax.swing.Icon)} (to remove in IDEA 12) */ - public static CellAppearance normal(@NotNull final String text, @Nullable final Icon icon) { - return regular(text, icon); - } - public static SimpleTextCellAppearance synthetic(@NotNull final String text, @Nullable final Icon icon) { return new SimpleTextCellAppearance(text, icon, SimpleTextAttributes.SYNTHETIC_ATTRIBUTES); } @@ -78,12 +73,6 @@ public class SimpleTextCellAppearance implements ModifiableCellAppearanceEx, Mod return myTextAttributes; } - @Override - @Nullable - public Icon getIcon() { - return myIcon; - } - @Override public void setIcon(@Nullable final Icon icon) { myIcon = icon; diff --git a/platform/platform-api/src/com/intellij/openapi/ui/ComboBoxTableRenderer.java b/platform/platform-api/src/com/intellij/openapi/ui/ComboBoxTableRenderer.java index 5b401dbbe92a..4afd7754bdc4 100644 --- a/platform/platform-api/src/com/intellij/openapi/ui/ComboBoxTableRenderer.java +++ b/platform/platform-api/src/com/intellij/openapi/ui/ComboBoxTableRenderer.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. @@ -171,14 +171,6 @@ public class ComboBoxTableRenderer extends JLabel implements TableCellRendere setForeground(isSelected ? table.getSelectionForeground() : table.getForeground()); } - /** @deprecated use {@linkplain #customizeComponent(Object, javax.swing.JTable, boolean)} (to remove in IDEA 12) */ - protected void customizeComponent(T value, boolean isSelected) { - setOpaque(true); - setText(value == null ? "" : getTextFor(value)); - setBackground(isSelected ? UIUtil.getTableSelectionBackground() : UIUtil.getTableBackground()); - setForeground(isSelected ? UIUtil.getTableSelectionForeground() : UIUtil.getTableForeground()); - } - public Object getCellEditorValue() { return myValue; } diff --git a/platform/platform-api/src/com/intellij/ui/HtmlListCellRenderer.java b/platform/platform-api/src/com/intellij/ui/HtmlListCellRenderer.java index f383b18eb0b6..7669dcec59ce 100644 --- a/platform/platform-api/src/com/intellij/ui/HtmlListCellRenderer.java +++ b/platform/platform-api/src/com/intellij/ui/HtmlListCellRenderer.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. @@ -16,8 +16,6 @@ package com.intellij.ui; import com.intellij.ide.ui.ListCellRendererWrapper; -import com.intellij.openapi.roots.ui.CellAppearanceEx; -import com.intellij.openapi.roots.ui.util.ModifiableCellAppearance; import com.intellij.openapi.util.text.StringUtil; import com.intellij.util.StringBuilderSpinAllocator; import org.jetbrains.annotations.NotNull; @@ -125,9 +123,4 @@ public abstract class HtmlListCellRenderer extends ListCellRendererWrapper } builder.append('"'); } - - /** @deprecated use {@linkplain com.intellij.openapi.roots.ui.CellAppearanceEx#customize(HtmlListCellRenderer)} (to remove in IDEA 12) */ - public void render(@NotNull final ModifiableCellAppearance appearance) { - ((CellAppearanceEx)appearance).customize(this); - } } diff --git a/platform/platform-impl/src/com/intellij/openapi/fileChooser/ex/FileChooserDialogImpl.java b/platform/platform-impl/src/com/intellij/openapi/fileChooser/ex/FileChooserDialogImpl.java index a697360556e0..0a710f8de671 100644 --- a/platform/platform-impl/src/com/intellij/openapi/fileChooser/ex/FileChooserDialogImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/fileChooser/ex/FileChooserDialogImpl.java @@ -349,11 +349,6 @@ public class FileChooserDialogImpl extends DialogWrapper implements FileChooserD myFileSystemTree.registerMouseListener(group); } - /** @deprecated internal method (to remove in IDEA 12) */ - protected VirtualFile[] getSelectedFiles() { - return getSelectedFilesInt(); - } - private VirtualFile[] getSelectedFilesInt() { final List selectedFiles = Arrays.asList(myFileSystemTree.getSelectedFiles()); return VfsUtil.toVirtualFileArray(FileChooserUtil.getChosenFiles(myChooserDescriptor, selectedFiles)); diff --git a/platform/platform-impl/src/com/intellij/openapi/fileChooser/ex/FileSystemTreeImpl.java b/platform/platform-impl/src/com/intellij/openapi/fileChooser/ex/FileSystemTreeImpl.java index 27de84f33e57..0de270d5b88f 100644 --- a/platform/platform-impl/src/com/intellij/openapi/fileChooser/ex/FileSystemTreeImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/fileChooser/ex/FileSystemTreeImpl.java @@ -27,7 +27,6 @@ import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ModalityState; import com.intellij.openapi.command.CommandProcessor; import com.intellij.openapi.fileChooser.FileChooserDescriptor; -import com.intellij.openapi.fileChooser.impl.FileChooserUtil; import com.intellij.openapi.fileChooser.FileElement; import com.intellij.openapi.fileChooser.FileSystemTree; import com.intellij.openapi.fileChooser.impl.FileComparator; @@ -361,14 +360,6 @@ public class FileSystemTreeImpl implements FileSystemTree { return VfsUtil.toVirtualFileArray(files); } - /** @deprecated use {@linkplain FileChooserUtil#getChosenFiles(com.intellij.openapi.fileChooser.FileChooserDescriptor, java.util.List)} (to remove in IDEA 12) */ - @SuppressWarnings("UnusedDeclaration") - @NotNull - public VirtualFile[] getChosenFiles() { - final List selectedFiles = Arrays.asList(getSelectedFiles()); - return VfsUtil.toVirtualFileArray(FileChooserUtil.getChosenFiles(myTreeStructure.getChooserDescriptor(), selectedFiles)); - } - private List collectSelectedElements(final Function converter) { final TreePath[] paths = myTree.getSelectionPaths(); if (paths == null) return Collections.emptyList(); diff --git a/platform/util/src/com/intellij/openapi/util/io/FileUtil.java b/platform/util/src/com/intellij/openapi/util/io/FileUtil.java index 062d9d4e9c75..f005b9ec19f6 100644 --- a/platform/util/src/com/intellij/openapi/util/io/FileUtil.java +++ b/platform/util/src/com/intellij/openapi/util/io/FileUtil.java @@ -901,18 +901,6 @@ public class FileUtil extends FileUtilRt { return file.canExecute(); } - /** @deprecated use {@link FileSystemUtil#isSymLink(File)} (to remove in IDEA 12) */ - @SuppressWarnings("UnusedDeclaration") - public static boolean isSymbolicLink(File file) { - return FileSystemUtil.isSymLink(file); - } - - /** @deprecated use {@link FileSystemUtil#isSymLink(File)} (to remove in IDEA 12) */ - @SuppressWarnings("UnusedDeclaration") - public static boolean isSymbolicLink(File parent, String name) { - return FileSystemUtil.isSymLink(new File(parent, name)); - } - public static void setReadOnlyAttribute(@NotNull String path, boolean readOnlyFlag) throws IOException { final boolean writableFlag = !readOnlyFlag; final File file = new File(path); diff --git a/platform/util/src/com/intellij/util/ui/MappingListCellRenderer.java b/platform/util/src/com/intellij/util/ui/MappingListCellRenderer.java deleted file mode 100644 index bffd1ce40bc5..000000000000 --- a/platform/util/src/com/intellij/util/ui/MappingListCellRenderer.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2000-2011 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.util.ui; - -import com.intellij.openapi.util.Pair; - -import javax.swing.*; -import java.awt.*; -import java.util.HashMap; -import java.util.Map; - -/** - * @deprecated use {@link com.intellij.ide.ui.MappingListCellRenderer} (to remove in IDEA 12). - */ -@SuppressWarnings("UnusedDeclaration") -public class MappingListCellRenderer extends DefaultListCellRenderer { - private final Map myValueMap; - - public MappingListCellRenderer(final Map valueMap) { - myValueMap = valueMap; - } - - public MappingListCellRenderer(final Pair... valuePairs) { - myValueMap = new HashMap(); - for (Pair valuePair : valuePairs) { - myValueMap.put(valuePair.getFirst(), valuePair.getSecond()); - } - } - - public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { - super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - String newValue = myValueMap.get(value); - if (newValue != null) { - setText(newValue); - } - return this; - } -} diff --git a/platform/util/src/com/intellij/util/ui/UIUtil.java b/platform/util/src/com/intellij/util/ui/UIUtil.java index b65181ae178d..2736edbb4e0e 100644 --- a/platform/util/src/com/intellij/util/ui/UIUtil.java +++ b/platform/util/src/com/intellij/util/ui/UIUtil.java @@ -2326,22 +2326,6 @@ public class UIUtil { myLineSpacing = 1.0f; } - /** @deprecated use {@linkplain #withLineSpacing(float)} (to remove in IDEA 12) */ - @SuppressWarnings("UnusedDeclaration") - public TextPainter(final float lineSpacing) { - myDrawShadow = isUnderAquaLookAndFeel(); - myShadowColor = Gray._220; - myLineSpacing = lineSpacing; - } - - /** @deprecated use {@linkplain #withShadow(boolean, java.awt.Color)} and {@linkplain #withLineSpacing(float)} (to remove in IDEA 12) */ - @SuppressWarnings("UnusedDeclaration") - public TextPainter(final boolean drawShadow, final Color shadowColor, final float lineSpacing) { - myDrawShadow = drawShadow; - myShadowColor = shadowColor; - myLineSpacing = lineSpacing; - } - public TextPainter withShadow(final boolean drawShadow) { myDrawShadow = drawShadow; return this; diff --git a/plugins/ant/src/com/intellij/lang/ant/config/explorer/AntBuildFileNodeDescriptor.java b/plugins/ant/src/com/intellij/lang/ant/config/explorer/AntBuildFileNodeDescriptor.java index 4e44046f303b..5e2aaf36eb60 100644 --- a/plugins/ant/src/com/intellij/lang/ant/config/explorer/AntBuildFileNodeDescriptor.java +++ b/plugins/ant/src/com/intellij/lang/ant/config/explorer/AntBuildFileNodeDescriptor.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. @@ -62,7 +62,7 @@ final class AntBuildFileNodeDescriptor extends AntNodeDescriptor { return !Comparing.equal(myAppearance, oldAppearence); } - public void customize(SimpleColoredComponent component) { + public void customize(@NotNull SimpleColoredComponent component) { if (myAppearance != null) { myAppearance.customize(component); } diff --git a/plugins/ant/src/com/intellij/lang/ant/config/explorer/AntNodeDescriptor.java b/plugins/ant/src/com/intellij/lang/ant/config/explorer/AntNodeDescriptor.java index d820b1478a27..daf89da31b24 100644 --- a/plugins/ant/src/com/intellij/lang/ant/config/explorer/AntNodeDescriptor.java +++ b/plugins/ant/src/com/intellij/lang/ant/config/explorer/AntNodeDescriptor.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. @@ -30,7 +30,7 @@ abstract class AntNodeDescriptor extends NodeDescriptor implements CellAppearanc public abstract boolean isAutoExpand(); - public void customize(SimpleColoredComponent component) { + public void customize(@NotNull SimpleColoredComponent component) { component.append(toString(), SimpleTextAttributes.REGULAR_ATTRIBUTES); } @@ -39,6 +39,7 @@ abstract class AntNodeDescriptor extends NodeDescriptor implements CellAppearanc renderer.append(toString(), SimpleTextAttributes.REGULAR_ATTRIBUTES); } + @NotNull public String getText() { return toString(); } diff --git a/plugins/ant/src/com/intellij/lang/ant/config/explorer/AntTargetNodeDescriptor.java b/plugins/ant/src/com/intellij/lang/ant/config/explorer/AntTargetNodeDescriptor.java index 9a2487103900..b5fe79ba9959 100644 --- a/plugins/ant/src/com/intellij/lang/ant/config/explorer/AntTargetNodeDescriptor.java +++ b/plugins/ant/src/com/intellij/lang/ant/config/explorer/AntTargetNodeDescriptor.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. @@ -137,7 +137,7 @@ final class AntTargetNodeDescriptor extends AntNodeDescriptor { return false; } - public void customize(SimpleColoredComponent component) { + public void customize(@NotNull SimpleColoredComponent component) { getHighlightedText().customize(component); component.setIcon(getOpenIcon()); String toolTipText = getTarget().getNotEmptyDescription(); diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcConsole.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcConsole.java index d04d0a3d5fba..6cda418c5280 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcConsole.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcConsole.java @@ -1,5 +1,6 @@ /* - * Copyright 2000-2007 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. * You may obtain a copy of the License at @@ -15,6 +16,8 @@ package org.jetbrains.plugins.groovy.mvc; +import com.intellij.execution.ExecutionException; +import com.intellij.execution.configurations.GeneralCommandLine; import com.intellij.execution.filters.TextConsoleBuilderFactory; import com.intellij.execution.impl.ConsoleViewImpl; import com.intellij.execution.process.*; @@ -36,7 +39,6 @@ import com.intellij.openapi.progress.ProgressIndicator; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.Messages; import com.intellij.openapi.util.*; -import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.LocalFileSystem; import com.intellij.openapi.wm.ToolWindow; import com.intellij.openapi.wm.ToolWindowAnchor; @@ -52,7 +54,6 @@ import org.jetbrains.plugins.groovy.GroovyIcons; import javax.swing.*; import java.awt.*; -import java.io.IOException; import java.io.OutputStreamWriter; import java.util.LinkedList; import java.util.List; @@ -146,7 +147,7 @@ public class MvcConsole implements Disposable { private static class MyProcessInConsole implements ConsoleProcessDescriptor { final Module module; - final ProcessBuilder pb; + final GeneralCommandLine commandLine; final @Nullable Runnable onDone; final boolean closeOnDone; final boolean showConsole; @@ -156,13 +157,13 @@ public class MvcConsole implements Disposable { private OSProcessHandler myHandler; public MyProcessInConsole(final Module module, - final ProcessBuilder pb, + final GeneralCommandLine commandLine, final Runnable onDone, final boolean showConsole, final boolean closeOnDone, final String[] input) { this.module = module; - this.pb = pb; + this.commandLine = commandLine; this.onDone = onDone; this.closeOnDone = closeOnDone; this.input = input; @@ -204,15 +205,15 @@ public class MvcConsole implements Disposable { } public static ConsoleProcessDescriptor executeProcess(final Module module, - final ProcessBuilder pb, + final GeneralCommandLine commandLine, final @Nullable Runnable onDone, final boolean closeOnDone, final String... input) { - return getInstance(module.getProject()).executeProcess(module, pb, onDone, true, closeOnDone, input); + return getInstance(module.getProject()).executeProcess(module, commandLine, onDone, true, closeOnDone, input); } public ConsoleProcessDescriptor executeProcess(final Module module, - final ProcessBuilder pb, + final GeneralCommandLine commandLine, final @Nullable Runnable onDone, boolean showConsole, final boolean closeOnDone, @@ -220,7 +221,7 @@ public class MvcConsole implements Disposable { ApplicationManager.getApplication().assertIsDispatchThread(); assert module.getProject() == myProject; - final MyProcessInConsole process = new MyProcessInConsole(module, pb, onDone, showConsole, closeOnDone, input); + final MyProcessInConsole process = new MyProcessInConsole(module, commandLine, onDone, showConsole, closeOnDone, input); if (isExecuting()) { myProcessQueue.add(process); } @@ -236,7 +237,7 @@ public class MvcConsole implements Disposable { private void executeProcessImpl(final MyProcessInConsole pic, boolean toFocus) { final Module module = pic.module; - final ProcessBuilder pb = pic.pb; + final GeneralCommandLine commandLine = pic.commandLine; final String[] input = pic.input; final boolean closeOnDone = pic.closeOnDone; final Runnable onDone = pic.onDone; @@ -256,12 +257,10 @@ public class MvcConsole implements Disposable { } FileDocumentManager.getInstance().saveAllDocuments(); - myConsole.print(StringUtil.join(pb.command(), " "), ConsoleViewContentType.SYSTEM_OUTPUT); + myConsole.print(commandLine.getCommandLineString(), ConsoleViewContentType.SYSTEM_OUTPUT); final OSProcessHandler handler; try { - if (pb.command() == null || pb.command().size() == 0) return; - - Process process = pb.start(); + Process process = commandLine.createProcess(); handler = new OSProcessHandler(process, ""); @SuppressWarnings("IOResourceOpenedButNotSafelyClosed") @@ -291,7 +290,7 @@ public class MvcConsole implements Disposable { } }); } - catch (final IOException e) { + catch (final Exception e) { ApplicationManager.getApplication().invokeLater(new Runnable() { public void run() { Messages.showErrorDialog(e.getMessage(), "Cannot Start Process"); diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcFramework.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcFramework.java index c30348f74347..0539d22fe9f0 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcFramework.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcFramework.java @@ -144,10 +144,10 @@ public abstract class MvcFramework { return; } - final ProcessBuilder pb = createCommandAndShowErrors(null, module, true, result == 0 ? "create-app" : "create-plugin"); - if (pb == null) return; + final GeneralCommandLine commandLine = createCommandAndShowErrors(null, module, true, result == 0 ? "create-app" : "create-plugin"); + if (commandLine == null) return; - MvcConsole.executeProcess(module, pb, new Runnable() { + MvcConsole.executeProcess(module, commandLine, new Runnable() { public void run() { VirtualFile root = findAppRoot(module); if (root == null) return; @@ -368,17 +368,17 @@ public abstract class MvcFramework { public abstract String getSdkHomePropertyName(); @Nullable - public ProcessBuilder createCommandAndShowErrors(@NotNull Module module, @NotNull String command, @NotNull String... args) { + public GeneralCommandLine createCommandAndShowErrors(@NotNull Module module, @NotNull String command, @NotNull String... args) { return createCommandAndShowErrors(null, module, command, args); } @Nullable - public ProcessBuilder createCommandAndShowErrors(@Nullable String vmOptions, @NotNull Module module, @NotNull String command, @NotNull String... args) { + public GeneralCommandLine createCommandAndShowErrors(@Nullable String vmOptions, @NotNull Module module, @NotNull String command, @NotNull String... args) { return createCommandAndShowErrors(vmOptions, module, false, command, args); } @Nullable - public ProcessBuilder createCommandAndShowErrors(@Nullable String vmOptions, @NotNull Module module, final boolean forCreation, @NotNull String command, @NotNull String... args) { + public GeneralCommandLine createCommandAndShowErrors(@Nullable String vmOptions, @NotNull Module module, final boolean forCreation, @NotNull String command, @NotNull String... args) { try { return createCommand(module, vmOptions, forCreation, command, args); } @@ -389,23 +389,26 @@ public abstract class MvcFramework { } @NotNull - public ProcessBuilder createCommand(@NotNull Module module, @Nullable String jvmParams, final boolean forCreation, @NotNull String command, @NotNull String... args) - throws ExecutionException { + public GeneralCommandLine createCommand(@NotNull Module module, + @Nullable String jvmParams, + final boolean forCreation, + @NotNull String command, + @NotNull String... args) throws ExecutionException { final JavaParameters params = createJavaParameters(module, forCreation, false, true, jvmParams, command, args); - addJavaHome(params, module); - final ProcessBuilder builder = createProcessBuilder(params); + final GeneralCommandLine commandLine = createCommandLine(params); + final VirtualFile griffonHome = getSdkRoot(module); if (griffonHome != null) { - builder.environment().put(getSdkHomePropertyName(), FileUtil.toSystemDependentName(griffonHome.getPath())); + commandLine.setEnvParams(Collections.singletonMap(getSdkHomePropertyName(), FileUtil.toSystemDependentName(griffonHome.getPath()))); } final VirtualFile root = findAppRoot(module); final File ioRoot = root != null ? VfsUtil.virtualToIoFile(root) : new File(module.getModuleFilePath()).getParentFile(); - builder.directory(forCreation ? ioRoot.getParentFile() : ioRoot); + commandLine.setWorkDirectory(forCreation ? ioRoot.getParentFile() : ioRoot); - return builder; + return commandLine; } public static void addJavaHome(@NotNull JavaParameters params, @NotNull Module module) { @@ -424,20 +427,9 @@ public abstract class MvcFramework { } } - public static ProcessBuilder createProcessBuilder(JavaParameters params) { + public static GeneralCommandLine createCommandLine(@NotNull JavaParameters params) { try { - ProcessBuilder builder = new ProcessBuilder(CommandLineBuilder.createFromJavaParameters(params).getCommands()); - Map env = params.getEnv(); - if (env != null) { - builder.environment().putAll(env); - } - - String workDir = params.getWorkingDirectory(); - if (workDir != null) { - builder.directory(new File(workDir)); - } - - return builder; + return CommandLineBuilder.createFromJavaParameters(params); } catch (CantRunException e) { throw new RuntimeException(e); diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcRunTarget.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcRunTarget.java index 9e14bf446be9..a88782104954 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcRunTarget.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcRunTarget.java @@ -1,5 +1,21 @@ +/* + * 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. + * 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 org.jetbrains.plugins.groovy.mvc; +import com.intellij.execution.configurations.GeneralCommandLine; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.module.Module; import com.intellij.openapi.util.Pair; @@ -24,10 +40,10 @@ public class MvcRunTarget extends MvcActionBase { Pair parsedCmd = MvcFramework.parsedCmd(targetArgs); - ProcessBuilder pb = framework.createCommandAndShowErrors(dialog.getVmOptions(), selectedModule, parsedCmd.first, parsedCmd.second); - if (pb == null) return; + final GeneralCommandLine commandLine = framework.createCommandAndShowErrors(dialog.getVmOptions(), selectedModule, parsedCmd.first, parsedCmd.second); + if (commandLine == null) return; - MvcConsole.executeProcess(selectedModule, pb, null, false); + MvcConsole.executeProcess(selectedModule, commandLine, null, false); } }