diff --git a/.idea/libraries/miglayout_swing.xml b/.idea/libraries/miglayout_swing.xml
index 5eced334efaa..03394158a644 100644
--- a/.idea/libraries/miglayout_swing.xml
+++ b/.idea/libraries/miglayout_swing.xml
@@ -1,11 +1,11 @@
-
+
-
+
\ No newline at end of file
diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/jikes/JikesConfigurable.java b/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/jikes/JikesConfigurable.java
index e5e5115108a7..a7cd8a4d1f82 100644
--- a/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/jikes/JikesConfigurable.java
+++ b/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/jikes/JikesConfigurable.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.
@@ -49,7 +49,7 @@ public class JikesConfigurable implements Configurable {
myPathField.getButton().addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor();
- VirtualFile file = FileChooser.chooseFile(myPathField, descriptor, null);
+ VirtualFile file = FileChooser.chooseFile(descriptor, myPathField, null, null);
if (file != null) {
myPathField.setText(file.getPath().replace('/', File.separatorChar));
}
diff --git a/java/compiler/impl/src/com/intellij/compiler/options/AnnotationProcessorsConfigurable.java b/java/compiler/impl/src/com/intellij/compiler/options/AnnotationProcessorsConfigurable.java
index b022493d0109..9b51826e6002 100644
--- a/java/compiler/impl/src/com/intellij/compiler/options/AnnotationProcessorsConfigurable.java
+++ b/java/compiler/impl/src/com/intellij/compiler/options/AnnotationProcessorsConfigurable.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.
@@ -18,6 +18,7 @@ package com.intellij.compiler.options;
import com.intellij.compiler.CompileServerManager;
import com.intellij.compiler.CompilerConfiguration;
import com.intellij.openapi.fileChooser.FileChooser;
+import com.intellij.openapi.fileChooser.FileChooserDescriptor;
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleManager;
@@ -105,8 +106,8 @@ public class AnnotationProcessorsConfigurable implements SearchableConfigurable,
myProcessorPathField = new TextFieldWithBrowseButton(new ActionListener() {
public void actionPerformed(ActionEvent e) {
- final VirtualFile[] files =
- FileChooser.chooseFiles(myProcessorPathField, FileChooserDescriptorFactory.createAllButJarContentsDescriptor());
+ final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createAllButJarContentsDescriptor();
+ final VirtualFile[] files = FileChooser.chooseFiles(descriptor, myProcessorPathField, myProject, null);
if (files.length > 0) {
final StringBuilder builder = new StringBuilder();
for (VirtualFile file : files) {
diff --git a/java/compiler/impl/src/com/intellij/packaging/impl/elements/DirectoryCopyElementType.java b/java/compiler/impl/src/com/intellij/packaging/impl/elements/DirectoryCopyElementType.java
index c92e6be88b2b..1c709ea2d8c0 100644
--- a/java/compiler/impl/src/com/intellij/packaging/impl/elements/DirectoryCopyElementType.java
+++ b/java/compiler/impl/src/com/intellij/packaging/impl/elements/DirectoryCopyElementType.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.
@@ -53,7 +53,7 @@ public class DirectoryCopyElementType extends PackagingElementType chooseAndCreate(@NotNull ArtifactEditorContext context, @NotNull Artifact artifact,
@NotNull CompositePackagingElement> parent) {
final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createMultipleFoldersDescriptor();
- final VirtualFile[] files = FileChooser.chooseFiles(context.getProject(), descriptor);
+ final VirtualFile[] files = FileChooser.chooseFiles(descriptor, context.getProject(), null);
final List list = new ArrayList();
for (VirtualFile file : files) {
list.add(new DirectoryCopyPackagingElement(file.getPath()));
diff --git a/java/compiler/impl/src/com/intellij/packaging/impl/elements/ExtractedDirectoryElementType.java b/java/compiler/impl/src/com/intellij/packaging/impl/elements/ExtractedDirectoryElementType.java
index ab4c1e9efe34..833efd590b94 100644
--- a/java/compiler/impl/src/com/intellij/packaging/impl/elements/ExtractedDirectoryElementType.java
+++ b/java/compiler/impl/src/com/intellij/packaging/impl/elements/ExtractedDirectoryElementType.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2010 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,9 +15,8 @@
*/
package com.intellij.packaging.impl.elements;
+import com.intellij.openapi.fileChooser.FileChooser;
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
-import com.intellij.openapi.fileChooser.FileChooserDialog;
-import com.intellij.openapi.fileChooser.FileChooserFactory;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.IconLoader;
import com.intellij.openapi.vfs.VirtualFile;
@@ -63,8 +62,7 @@ public class ExtractedDirectoryElementType extends PackagingElementType> list = new ArrayList>();
final PackagingElementFactory factory = PackagingElementFactory.getInstance();
for (VirtualFile file : files) {
diff --git a/java/compiler/impl/src/com/intellij/packaging/impl/elements/FileCopyElementType.java b/java/compiler/impl/src/com/intellij/packaging/impl/elements/FileCopyElementType.java
index 675751389c75..b793db96bf1c 100644
--- a/java/compiler/impl/src/com/intellij/packaging/impl/elements/FileCopyElementType.java
+++ b/java/compiler/impl/src/com/intellij/packaging/impl/elements/FileCopyElementType.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.
@@ -15,9 +15,8 @@
*/
package com.intellij.packaging.impl.elements;
+import com.intellij.openapi.fileChooser.FileChooser;
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
-import com.intellij.openapi.fileChooser.FileChooserDialog;
-import com.intellij.openapi.fileChooser.FileChooserFactory;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.IconLoader;
import com.intellij.openapi.vfs.VirtualFile;
@@ -55,8 +54,7 @@ public class FileCopyElementType extends PackagingElementType chooseAndCreate(@NotNull ArtifactEditorContext context, @NotNull Artifact artifact,
@NotNull CompositePackagingElement> parent) {
final FileChooserDescriptor descriptor = new FileChooserDescriptor(true, false, true, true, false, true);
- final FileChooserDialog chooser = FileChooserFactory.getInstance().createFileChooser(descriptor, context.getProject());
- final VirtualFile[] files = chooser.choose(null, context.getProject());
+ final VirtualFile[] files = FileChooser.chooseFiles(descriptor, context.getProject(), null);
final List list = new ArrayList();
for (VirtualFile file : files) {
list.add(new FileCopyPackagingElement(file.getPath()));
diff --git a/java/compiler/impl/src/com/intellij/packaging/impl/elements/ManifestFileUtil.java b/java/compiler/impl/src/com/intellij/packaging/impl/elements/ManifestFileUtil.java
index 56e215103e98..2aa991e0b1fa 100644
--- a/java/compiler/impl/src/com/intellij/packaging/impl/elements/ManifestFileUtil.java
+++ b/java/compiler/impl/src/com/intellij/packaging/impl/elements/ManifestFileUtil.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.
@@ -261,7 +261,7 @@ public class ManifestFileUtil {
public static VirtualFile showDialogAndCreateManifest(final ArtifactEditorContext context, final CompositePackagingElement> element) {
FileChooserDescriptor descriptor = createDescriptorForManifestDirectory();
final VirtualFile directory = suggestManifestFileDirectory(element, context, context.getArtifactType());
- final VirtualFile file = FileChooser.chooseFile(context.getProject(), descriptor, directory);
+ final VirtualFile file = FileChooser.chooseFile(descriptor, context.getProject(), directory);
if (file == null) {
return null;
}
diff --git a/java/compiler/impl/src/com/intellij/packaging/impl/ui/properties/ElementWithManifestPropertiesPanel.java b/java/compiler/impl/src/com/intellij/packaging/impl/ui/properties/ElementWithManifestPropertiesPanel.java
index d568c524ce8c..ad58d519b7c6 100644
--- a/java/compiler/impl/src/com/intellij/packaging/impl/ui/properties/ElementWithManifestPropertiesPanel.java
+++ b/java/compiler/impl/src/com/intellij/packaging/impl/ui/properties/ElementWithManifestPropertiesPanel.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.
@@ -105,7 +105,7 @@ public abstract class ElementWithManifestPropertiesPanel suitableDescriptors = new ArrayList();
@@ -167,8 +169,7 @@ public class CreateModuleLibraryChooser implements ClasspathElementChooser chosenRoots = RootDetectionUtil.detectRoots(Arrays.asList(files), myParentComponent, myModule.getProject(),
- rootsComponentDescriptor);
+ List chosenRoots = RootDetectionUtil.detectRoots(Arrays.asList(files), myParentComponent, project, rootsComponentDescriptor);
final List roots = filterAlreadyAdded(chosenRoots);
if (roots.isEmpty()) {
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/idea-ui/src/com/intellij/openapi/roots/ui/configuration/libraryEditor/LibraryRootsComponent.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/libraryEditor/LibraryRootsComponent.java
index 3a9daaa32146..5d49f97c8ba9 100644
--- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/libraryEditor/LibraryRootsComponent.java
+++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/libraryEditor/LibraryRootsComponent.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.
@@ -359,7 +359,7 @@ public class LibraryRootsComponent implements Disposable, LibraryEditorComponent
if (myContextModule != null) {
chooserDescriptor.putUserData(LangDataKeys.MODULE_CONTEXT, myContextModule);
}
- final VirtualFile[] files = FileChooser.chooseFiles(myPanel, chooserDescriptor, initialSelection);
+ final VirtualFile[] files = FileChooser.chooseFiles(chooserDescriptor, myPanel, myProject, initialSelection);
if (files.length == 0) return Collections.emptyList();
return RootDetectionUtil.detectRoots(Arrays.asList(files), myPanel, myProject, myDescriptor);
diff --git a/java/java-impl/src/com/intellij/codeInsight/ExternalAnnotationsManagerImpl.java b/java/java-impl/src/com/intellij/codeInsight/ExternalAnnotationsManagerImpl.java
index a6790e8bb7e8..04d683ff2540 100644
--- a/java/java-impl/src/com/intellij/codeInsight/ExternalAnnotationsManagerImpl.java
+++ b/java/java-impl/src/com/intellij/codeInsight/ExternalAnnotationsManagerImpl.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.
@@ -252,7 +252,7 @@ public class ExternalAnnotationsManagerImpl extends ExternalAnnotationsManager {
final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
descriptor.setTitle(ProjectBundle.message("external.annotations.root.chooser.title", entry.getPresentableName()));
descriptor.setDescription(ProjectBundle.message("external.annotations.root.chooser.description"));
- final VirtualFile file = FileChooser.chooseFile(project, descriptor);
+ final VirtualFile file = FileChooser.chooseFile(descriptor, project, null);
if (file == null) {
return;
}
diff --git a/java/java-impl/src/com/intellij/codeInsight/completion/ReferenceExpressionCompletionContributor.java b/java/java-impl/src/com/intellij/codeInsight/completion/ReferenceExpressionCompletionContributor.java
index e1f28cd2b85a..dcace8ea4d10 100644
--- a/java/java-impl/src/com/intellij/codeInsight/completion/ReferenceExpressionCompletionContributor.java
+++ b/java/java-impl/src/com/intellij/codeInsight/completion/ReferenceExpressionCompletionContributor.java
@@ -96,6 +96,21 @@ public class ReferenceExpressionCompletionContributor {
));
}
+ final PsiForeachStatement foreach = PsiTreeUtil.getParentOfType(element, PsiForeachStatement.class);
+ if (foreach != null && !PsiTreeUtil.isAncestor(foreach.getBody(), element, false)) {
+ return new ElementExtractorFilter(new ElementFilter() {
+ @Override
+ public boolean isAcceptable(Object element, @Nullable PsiElement context) {
+ return element != foreach.getIterationParameter();
+ }
+
+ @Override
+ public boolean isClassAcceptable(Class hintClass) {
+ return true;
+ }
+ });
+ }
+
if (!allowRecursion) {
final ElementFilter filter = RecursionWeigher.recursionFilter(element);
if (filter != null) {
diff --git a/java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/MoveClassesOrPackagesToNewDirectoryDialog.java b/java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/MoveClassesOrPackagesToNewDirectoryDialog.java
index 8a11a20021ac..4d1792cb9ee3 100644
--- a/java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/MoveClassesOrPackagesToNewDirectoryDialog.java
+++ b/java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/MoveClassesOrPackagesToNewDirectoryDialog.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.
@@ -78,7 +78,7 @@ public class MoveClassesOrPackagesToNewDirectoryDialog extends DialogWrapper {
final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
myDestDirectoryField.getButton().addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
- final VirtualFile file = FileChooser.chooseFile(myDirectory.getProject(), descriptor, directory.getVirtualFile());
+ final VirtualFile file = FileChooser.chooseFile(descriptor, myDirectory.getProject(), directory.getVirtualFile());
if (file != null) {
myDestDirectoryField.setText(FileUtil.toSystemDependentName(file.getPath()));
}
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/PsiForeachStatementImpl.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiForeachStatementImpl.java
index 26f3545e22fa..ec3cfbcd1127 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiForeachStatementImpl.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiForeachStatementImpl.java
@@ -134,7 +134,7 @@ public class PsiForeachStatementImpl extends CompositePsiElement implements PsiF
@Override
public boolean processDeclarations(@NotNull PsiScopeProcessor processor, @NotNull ResolveState state, PsiElement lastParent, @NotNull PsiElement place) {
processor.handleEvent(PsiScopeProcessor.Event.SET_DECLARATION_HOLDER, this);
- if (lastParent == null || lastParent.getParent() != this || lastParent == getIteratedValue())
+ if (lastParent == null || lastParent.getParent() != this /*|| lastParent == getIteratedValue()*/)
// Parent element should not see our vars
return true;
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/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting/LocalVariableInitialization.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting/LocalVariableInitialization.java
index 7b6e40003652..dddaa1dc4e51 100644
--- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting/LocalVariableInitialization.java
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting/LocalVariableInitialization.java
@@ -181,7 +181,7 @@ public class a {
}
void forEachParam(java.io.File x) {
- for (java.io.File f: f.listFiles()) {
+ for (java.io.File f: f.listFiles()) {
forEachParam(f);
}
}
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 extends IntentionAction> getIntentions();
-}
diff --git a/platform/lang-api/src/com/intellij/openapi/projectRoots/ui/PathEditor.java b/platform/lang-api/src/com/intellij/openapi/projectRoots/ui/PathEditor.java
index 374c5adc6c39..7db6ea3ef324 100644
--- a/platform/lang-api/src/com/intellij/openapi/projectRoots/ui/PathEditor.java
+++ b/platform/lang-api/src/com/intellij/openapi/projectRoots/ui/PathEditor.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.
@@ -177,13 +177,11 @@ public class PathEditor {
private VirtualFile[] doAdd() {
VirtualFile baseDir = myAddBaseDir;
- if (baseDir == null) {
- Project project = PlatformDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext(myPanel));
- if (project != null) {
- baseDir = project.getBaseDir();
- }
+ Project project = PlatformDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext(myPanel));
+ if (baseDir == null && project != null) {
+ baseDir = project.getBaseDir();
}
- VirtualFile[] files = FileChooser.chooseFiles(myPanel, myDescriptor, baseDir);
+ VirtualFile[] files = FileChooser.chooseFiles(myDescriptor, myPanel, project, baseDir);
files = adjustAddedFileSet(myPanel, files);
List added = new ArrayList(files.length);
for (VirtualFile vFile : files) {
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/codeInspection/actions/ViewOfflineResultsAction.java b/platform/lang-impl/src/com/intellij/codeInspection/actions/ViewOfflineResultsAction.java
index 2b49d863d81d..1c4953ab7337 100644
--- a/platform/lang-impl/src/com/intellij/codeInspection/actions/ViewOfflineResultsAction.java
+++ b/platform/lang-impl/src/com/intellij/codeInspection/actions/ViewOfflineResultsAction.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.
@@ -82,7 +82,7 @@ public class ViewOfflineResultsAction extends AnAction implements DumbAware {
LOG.assertTrue(project != null);
- final VirtualFile virtualFile = FileChooser.chooseFile(project, BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR);
+ final VirtualFile virtualFile = FileChooser.chooseFile(BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR, project, null);
if (virtualFile == null || !virtualFile.isDirectory()) return;
final Map>> resMap =
diff --git a/platform/lang-impl/src/com/intellij/execution/ui/CommonProgramParametersPanel.java b/platform/lang-impl/src/com/intellij/execution/ui/CommonProgramParametersPanel.java
index 3a12e8ad5db4..e70359491b0f 100644
--- a/platform/lang-impl/src/com/intellij/execution/ui/CommonProgramParametersPanel.java
+++ b/platform/lang-impl/src/com/intellij/execution/ui/CommonProgramParametersPanel.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2010 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.
@@ -70,7 +70,7 @@ public class CommonProgramParametersPanel extends JPanel implements PanelWithAnc
protected void initComponents() {
myProgramParametersComponent = LabeledComponent.create(new RawCommandLineEditor(),
- ExecutionBundle.message("run.configuration.program.parameters"));
+ ExecutionBundle.message("run.configuration.program.parameters"));
final JPanel panel = new JPanel(new BorderLayout());
myWorkingDirectoryField = new TextFieldWithBrowseButton(new ActionListener() {
@@ -78,7 +78,8 @@ public class CommonProgramParametersPanel extends JPanel implements PanelWithAnc
FileChooserDescriptor fileChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
fileChooserDescriptor.setTitle(ExecutionBundle.message("select.working.directory.message"));
fileChooserDescriptor.putUserData(LangDataKeys.MODULE_CONTEXT, myModuleContext);
- VirtualFile file = FileChooser.chooseFile(myWorkingDirectoryComponent, fileChooserDescriptor, null);
+ Project project = myModuleContext != null ? myModuleContext.getProject() : null;
+ VirtualFile file = FileChooser.chooseFile(fileChooserDescriptor, myWorkingDirectoryComponent, project, null);
if (file != null) {
setWorkingDirectory(file.getPresentableUrl());
}
diff --git a/platform/lang-impl/src/com/intellij/framework/detection/impl/exclude/DetectionExcludesConfigurable.java b/platform/lang-impl/src/com/intellij/framework/detection/impl/exclude/DetectionExcludesConfigurable.java
index cd2fb1e1483f..dc416f66aca0 100644
--- a/platform/lang-impl/src/com/intellij/framework/detection/impl/exclude/DetectionExcludesConfigurable.java
+++ b/platform/lang-impl/src/com/intellij/framework/detection/impl/exclude/DetectionExcludesConfigurable.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.
@@ -199,7 +199,7 @@ public class DetectionExcludesConfigurable implements Configurable {
private void chooseDirectoryAndAdd(final @Nullable FrameworkType type) {
final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
descriptor.setDescription((type != null ? type.getPresentableName() + " framework detection" : "Detection for all frameworks") + " will be disabled in selected directory");
- final VirtualFile[] files = FileChooser.chooseFiles(myMainPanel, descriptor, myProject.getBaseDir());
+ final VirtualFile[] files = FileChooser.chooseFiles(descriptor, myMainPanel, myProject, myProject.getBaseDir());
final VirtualFile file = files.length > 0 ? files[0] : null;
if (file != null) {
addAndRemoveDuplicates(type, file);
diff --git a/platform/lang-impl/src/com/intellij/ide/macro/FilePromptMacro.java b/platform/lang-impl/src/com/intellij/ide/macro/FilePromptMacro.java
index 7346a6865e00..fa6b49633674 100644
--- a/platform/lang-impl/src/com/intellij/ide/macro/FilePromptMacro.java
+++ b/platform/lang-impl/src/com/intellij/ide/macro/FilePromptMacro.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.
@@ -18,10 +18,7 @@ package com.intellij.ide.macro;
import com.intellij.ide.IdeBundle;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
-import com.intellij.openapi.fileChooser.FileChooserDescriptor;
-import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
-import com.intellij.openapi.fileChooser.FileChooserDialog;
-import com.intellij.openapi.fileChooser.FileChooserFactory;
+import com.intellij.openapi.fileChooser.*;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.VirtualFile;
@@ -43,8 +40,7 @@ public class FilePromptMacro extends PromptingMacro implements SecondQueueExpand
protected String promptUser(DataContext dataContext) {
Project project = PlatformDataKeys.PROJECT.getData(dataContext);
final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleLocalFileDescriptor();
- final FileChooserDialog fileChooser = FileChooserFactory.getInstance().createFileChooser(descriptor, project);
- final VirtualFile[] result = fileChooser.choose(null, project);
+ final VirtualFile[] result = FileChooser.chooseFiles(descriptor, project, null);
return result.length == 1? FileUtil.toSystemDependentName(result[0].getPath()) : null;
}
diff --git a/platform/lang-impl/src/com/intellij/internal/DumpIntentionsAction.java b/platform/lang-impl/src/com/intellij/internal/DumpIntentionsAction.java
index ba8305d1b4c8..12a7be843102 100644
--- a/platform/lang-impl/src/com/intellij/internal/DumpIntentionsAction.java
+++ b/platform/lang-impl/src/com/intellij/internal/DumpIntentionsAction.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.
@@ -49,7 +49,7 @@ public class DumpIntentionsAction extends AnAction implements DumbAware {
@Override
public void actionPerformed(AnActionEvent e) {
final VirtualFile file =
- FileChooser.chooseFile(e.getData(PlatformDataKeys.PROJECT), FileChooserDescriptorFactory.createSingleFolderDescriptor(), null);
+ FileChooser.chooseFile(FileChooserDescriptorFactory.createSingleFolderDescriptor(), e.getData(PlatformDataKeys.PROJECT), null);
if (file != null) {
final List list = IntentionManagerSettings.getInstance().getMetaData();
final File root = VfsUtil.virtualToIoFile(file);
diff --git a/platform/lang-impl/src/com/intellij/openapi/roots/impl/libraries/LibraryTypeServiceImpl.java b/platform/lang-impl/src/com/intellij/openapi/roots/impl/libraries/LibraryTypeServiceImpl.java
index 60d7059e40c6..84fe7b88231b 100644
--- a/platform/lang-impl/src/com/intellij/openapi/roots/impl/libraries/LibraryTypeServiceImpl.java
+++ b/platform/lang-impl/src/com/intellij/openapi/roots/impl/libraries/LibraryTypeServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2010 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.
@@ -60,7 +60,7 @@ public class LibraryTypeServiceImpl extends LibraryTypeService {
final Project project) {
final FileChooserDescriptor chooserDescriptor = descriptor.createAttachFilesChooserDescriptor();
chooserDescriptor.setTitle("Select Library Files");
- final VirtualFile[] rootCandidates = FileChooser.chooseFiles(parentComponent, chooserDescriptor, contextDirectory);
+ final VirtualFile[] rootCandidates = FileChooser.chooseFiles(chooserDescriptor, parentComponent, project, contextDirectory);
if (rootCandidates.length == 0) {
return null;
}
diff --git a/platform/lang-impl/src/com/intellij/openapi/roots/libraries/ui/ChooserBasedAttachRootButtonDescriptor.java b/platform/lang-impl/src/com/intellij/openapi/roots/libraries/ui/ChooserBasedAttachRootButtonDescriptor.java
index 4e4de9a2826d..b6f4e4c041ea 100644
--- a/platform/lang-impl/src/com/intellij/openapi/roots/libraries/ui/ChooserBasedAttachRootButtonDescriptor.java
+++ b/platform/lang-impl/src/com/intellij/openapi/roots/libraries/ui/ChooserBasedAttachRootButtonDescriptor.java
@@ -1,9 +1,12 @@
/*
- * Copyright 2000-2010 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
+ *
* 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.
@@ -49,6 +52,6 @@ public abstract class ChooserBasedAttachRootButtonDescriptor extends AttachRootB
if (contextModule != null) {
chooserDescriptor.putUserData(LangDataKeys.MODULE_CONTEXT, contextModule);
}
- return FileChooser.chooseFiles(parent, chooserDescriptor, initialSelection);
+ return FileChooser.chooseFiles(chooserDescriptor, parent, contextModule != null ? contextModule.getProject() : null, initialSelection);
}
}
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/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionToolsConfigurable.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionToolsConfigurable.java
index f97a5e122cb1..d8c97a0c7837 100644
--- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionToolsConfigurable.java
+++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionToolsConfigurable.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.
@@ -41,6 +41,7 @@ import com.intellij.openapi.options.BaseConfigurable;
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.options.SearchableConfigurable;
+import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.util.*;
@@ -119,6 +120,7 @@ public abstract class InspectionToolsConfigurable extends BaseConfigurable imple
}
});
+ final Project project = projectProfileManager.getProject();
myImportButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
final FileChooserDescriptor descriptor = new FileChooserDescriptor(true, false, false, false, false, false){
@@ -128,7 +130,7 @@ public abstract class InspectionToolsConfigurable extends BaseConfigurable imple
}
};
descriptor.setDescription("Choose profile file");
- final VirtualFile file = FileChooser.chooseFile(myWholePanel, descriptor, null);
+ final VirtualFile file = FileChooser.chooseFile(descriptor, myWholePanel, project, null);
if (file == null) return;
InspectionProfileImpl profile =
new InspectionProfileImpl("TempProfile", InspectionToolRegistrar.getInstance(), myProfileManager);
@@ -193,7 +195,7 @@ public abstract class InspectionToolsConfigurable extends BaseConfigurable imple
public void actionPerformed(ActionEvent e) {
final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
descriptor.setDescription("Choose directory to store profile file");
- final VirtualFile file = FileChooser.chooseFile(myWholePanel, descriptor, null);
+ final VirtualFile file = FileChooser.chooseFile(descriptor, myWholePanel, project, null);
if (file == null) return;
final Element element = new Element("inspections");
try {
diff --git a/platform/lang-impl/src/com/intellij/tools/ToolEditorDialog.java b/platform/lang-impl/src/com/intellij/tools/ToolEditorDialog.java
index ce991c7eb246..7c4055402403 100644
--- a/platform/lang-impl/src/com/intellij/tools/ToolEditorDialog.java
+++ b/platform/lang-impl/src/com/intellij/tools/ToolEditorDialog.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.
@@ -197,7 +197,7 @@ public class ToolEditorDialog extends DialogWrapper {
new ActionListener() {
public void actionPerformed(ActionEvent e) {
FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor();
- VirtualFile file = FileChooser.chooseFile(myProject, descriptor, null);
+ VirtualFile file = FileChooser.chooseFile(descriptor, myProject, null);
if (file != null) {
myTfCommand.setText(file.getPresentableUrl());
String workingDirectory = myTfCommandWorkingDirectory.getText();
@@ -276,7 +276,7 @@ public class ToolEditorDialog extends DialogWrapper {
new ActionListener() {
public void actionPerformed(ActionEvent e) {
FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
- VirtualFile file = FileChooser.chooseFile(myProject, descriptor);
+ VirtualFile file = FileChooser.chooseFile(descriptor, myProject, null);
if (file != null) {
myTfCommandWorkingDirectory.setText(file.getPresentableUrl());
}
diff --git a/platform/lang-impl/src/com/intellij/ui/debugger/extensions/PlaybackDebugger.java b/platform/lang-impl/src/com/intellij/ui/debugger/extensions/PlaybackDebugger.java
index 1c1513a594fa..6ca9a05dfc58 100644
--- a/platform/lang-impl/src/com/intellij/ui/debugger/extensions/PlaybackDebugger.java
+++ b/platform/lang-impl/src/com/intellij/ui/debugger/extensions/PlaybackDebugger.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.
@@ -177,7 +177,7 @@ public class PlaybackDebugger implements UiDebuggerExtension, PlaybackRunner.Sta
public void actionPerformed(AnActionEvent e) {
if (pathToFile() == null) {
- VirtualFile selectedFile = FileChooser.chooseFile(myComponent, FILE_DESCRIPTOR, null);
+ VirtualFile selectedFile = FileChooser.chooseFile(FILE_DESCRIPTOR, myComponent, getEventProject(e), null);
if (selectedFile != null) {
myState.currentScript = selectedFile.getPresentableUrl();
myCurrentScript.setText(myState.currentScript);
@@ -218,7 +218,7 @@ public class PlaybackDebugger implements UiDebuggerExtension, PlaybackRunner.Sta
@Override
public void actionPerformed(AnActionEvent e) {
- VirtualFile selectedFile = FileChooser.chooseFile(myComponent, FILE_DESCRIPTOR, pathToFile());
+ VirtualFile selectedFile = FileChooser.chooseFile(FILE_DESCRIPTOR, myComponent, getEventProject(e), pathToFile());
if (selectedFile != null) {
myState.currentScript = selectedFile.getPresentableUrl();
loadFrom(selectedFile);
diff --git a/platform/lang-impl/src/com/intellij/util/download/impl/FileDownloaderImpl.java b/platform/lang-impl/src/com/intellij/util/download/impl/FileDownloaderImpl.java
index 76b4f6811259..1fc41f0cf8ae 100644
--- a/platform/lang-impl/src/com/intellij/util/download/impl/FileDownloaderImpl.java
+++ b/platform/lang-impl/src/com/intellij/util/download/impl/FileDownloaderImpl.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.
@@ -177,16 +177,8 @@ public class FileDownloaderImpl implements FileDownloader {
private VirtualFile chooseDirectoryForFiles() {
final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
descriptor.setTitle(IdeBundle.message("dialog.directory.for.downloaded.files.title"));
-
- final VirtualFile file;
- if (myProject != null) {
- file = FileChooser.chooseFile(myProject, descriptor, myProject.getBaseDir());
- }
- else {
- file = FileChooser.chooseFile(myParent, descriptor, null);
- }
-
- return file;
+ final VirtualFile baseDir = myProject != null ? myProject.getBaseDir() : null;
+ return FileChooser.chooseFile(descriptor, myParent, myProject, baseDir);
}
@NotNull
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/FileChooser.java b/platform/platform-api/src/com/intellij/openapi/fileChooser/FileChooser.java
index 89a71fcb9682..68e11de23454 100644
--- a/platform/platform-api/src/com/intellij/openapi/fileChooser/FileChooser.java
+++ b/platform/platform-api/src/com/intellij/openapi/fileChooser/FileChooser.java
@@ -17,7 +17,6 @@ package com.intellij.openapi.fileChooser;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
-import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.ArrayUtil;
@@ -33,48 +32,128 @@ public class FileChooser {
private FileChooser() { }
+ /**
+ * @deprecated use {@linkplain #chooseFiles(FileChooserDescriptor,
+ * com.intellij.openapi.project.Project,
+ * com.intellij.openapi.vfs.VirtualFile)} (to remove in IDEA 13)
+ */
+ @SuppressWarnings("UnusedDeclaration")
@NotNull
public static VirtualFile[] chooseFiles(Project project, FileChooserDescriptor descriptor) {
- return chooseFiles(project, descriptor, null);
+ return chooseFiles(descriptor, null, project, null);
}
+ /**
+ * @deprecated use {@linkplain #chooseFiles(FileChooserDescriptor,
+ * java.awt.Component,
+ * com.intellij.openapi.project.Project,
+ * com.intellij.openapi.vfs.VirtualFile)} (to remove in IDEA 13)
+ */
+ @SuppressWarnings("UnusedDeclaration")
@NotNull
public static VirtualFile[] chooseFiles(Component parent, FileChooserDescriptor descriptor) {
- return chooseFiles(parent, descriptor, null);
+ return chooseFiles(descriptor, parent, null, null);
+ }
+
+ /**
+ * @deprecated use {@linkplain #chooseFiles(FileChooserDescriptor,
+ * com.intellij.openapi.project.Project,
+ * com.intellij.openapi.vfs.VirtualFile)} (to remove in IDEA 13)
+ */
+ @SuppressWarnings("UnusedDeclaration")
+ @NotNull
+ public static VirtualFile[] chooseFiles(Project project, FileChooserDescriptor descriptor, @Nullable VirtualFile toSelect) {
+ return chooseFiles(descriptor, null, project, toSelect);
+ }
+
+ /**
+ * @deprecated use {@linkplain #chooseFiles(FileChooserDescriptor,
+ * java.awt.Component,
+ * com.intellij.openapi.project.Project,
+ * com.intellij.openapi.vfs.VirtualFile)} (to remove in IDEA 13)
+ */
+ @SuppressWarnings("UnusedDeclaration")
+ @NotNull
+ public static VirtualFile[] chooseFiles(Component parent, FileChooserDescriptor descriptor, @Nullable VirtualFile toSelect) {
+ return chooseFiles(descriptor, parent, null, toSelect);
}
@NotNull
- public static VirtualFile[] chooseFiles(Project project, FileChooserDescriptor descriptor, @Nullable VirtualFile toSelect) {
- FileChooserDialog chooser = FileChooserFactory.getInstance().createFileChooser(descriptor, project);
+ public static VirtualFile[] chooseFiles(@NotNull final FileChooserDescriptor descriptor,
+ @Nullable final Project project,
+ @Nullable final VirtualFile toSelect) {
+ return chooseFiles(descriptor, null, project, toSelect);
+ }
+
+ @NotNull
+ public static VirtualFile[] chooseFiles(@NotNull final FileChooserDescriptor descriptor,
+ @Nullable final Component parent,
+ @Nullable final Project project,
+ @Nullable final VirtualFile toSelect) {
+ final FileChooserDialog chooser = FileChooserFactory.getInstance().createFileChooser(descriptor, project, parent);
return chooser.choose(toSelect, project);
}
- @NotNull
- public static VirtualFile[] chooseFiles(Component parent, FileChooserDescriptor descriptor, @Nullable VirtualFile toSelect) {
- FileChooserDialog chooser = FileChooserFactory.getInstance().createFileChooser(descriptor, parent);
- return chooser.choose(toSelect, null);
- }
-
+ /**
+ * @deprecated use {@linkplain #chooseFile(FileChooserDescriptor,
+ * com.intellij.openapi.project.Project,
+ * com.intellij.openapi.vfs.VirtualFile)} (to remove in IDEA 13)
+ */
+ @SuppressWarnings("UnusedDeclaration")
@Nullable
public static VirtualFile chooseFile(Project project, FileChooserDescriptor descriptor) {
- return chooseFile(project, descriptor, null);
+ return chooseFile(descriptor, null, project, null);
}
+ /**
+ * @deprecated use {@linkplain #chooseFile(FileChooserDescriptor,
+ * java.awt.Component,
+ * com.intellij.openapi.project.Project,
+ * com.intellij.openapi.vfs.VirtualFile)} (to remove in IDEA 13)
+ */
+ @SuppressWarnings("UnusedDeclaration")
@Nullable
public static VirtualFile chooseFile(Component parent, FileChooserDescriptor descriptor) {
- return chooseFile(parent, descriptor, null);
+ return chooseFile(descriptor, parent, null, null);
}
+ /**
+ * @deprecated use {@linkplain #chooseFile(FileChooserDescriptor,
+ * com.intellij.openapi.project.Project,
+ * com.intellij.openapi.vfs.VirtualFile)} (to remove in IDEA 13)
+ */
+ @SuppressWarnings("UnusedDeclaration")
@Nullable
public static VirtualFile chooseFile(Project project, FileChooserDescriptor descriptor, @Nullable VirtualFile toSelect) {
- LOG.assertTrue(!descriptor.isChooseMultiple());
- return ArrayUtil.getFirstElement(chooseFiles(project, descriptor, toSelect));
+ return chooseFile(descriptor, null, project, toSelect);
+ }
+
+ /**
+ * @deprecated use {@linkplain #chooseFile(FileChooserDescriptor,
+ * java.awt.Component,
+ * com.intellij.openapi.project.Project,
+ * com.intellij.openapi.vfs.VirtualFile)} (to remove in IDEA 13)
+ */
+ @SuppressWarnings("UnusedDeclaration")
+ @Nullable
+ public static VirtualFile chooseFile(Component parent, FileChooserDescriptor descriptor, @Nullable VirtualFile toSelect) {
+ return chooseFile(descriptor, parent, null, toSelect);
}
@Nullable
- public static VirtualFile chooseFile(Component parent, FileChooserDescriptor descriptor, @Nullable VirtualFile toSelect) {
+ public static VirtualFile chooseFile(@NotNull final FileChooserDescriptor descriptor,
+ @Nullable final Project project,
+ @Nullable final VirtualFile toSelect) {
+ return chooseFile(descriptor, null, project, toSelect);
+ }
+
+ @Nullable
+ public static VirtualFile chooseFile(@NotNull final FileChooserDescriptor descriptor,
+ @Nullable final Component parent,
+ @Nullable final Project project,
+ @Nullable final VirtualFile toSelect) {
LOG.assertTrue(!descriptor.isChooseMultiple());
- return ArrayUtil.getFirstElement(chooseFiles(parent, descriptor, toSelect));
+ return ArrayUtil.getFirstElement(chooseFiles(descriptor, parent, project, toSelect));
}
/**
@@ -154,11 +233,4 @@ public class FileChooser {
final PathChooserDialog pathChooser = factory.createPathChooser(descriptor, project, parent);
pathChooser.choose(toSelect, callback);
}
-
- /** @deprecated internal method, to remove in IDEA 12 */
- @SuppressWarnings("UnusedDeclaration")
- public static boolean isNativeMacChooserEnabled() {
- return "true".equalsIgnoreCase(System.getProperty("native.mac.file.chooser.enabled", "true")) &&
- Registry.is("ide.mac.filechooser.native");
- }
}
\ No newline at end of file
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/FileChooserFactory.java b/platform/platform-api/src/com/intellij/openapi/fileChooser/FileChooserFactory.java
index 8f3c48b775c2..0d47ad39462b 100644
--- a/platform/platform-api/src/com/intellij/openapi/fileChooser/FileChooserFactory.java
+++ b/platform/platform-api/src/com/intellij/openapi/fileChooser/FileChooserFactory.java
@@ -29,11 +29,21 @@ public abstract class FileChooserFactory {
return ServiceManager.getService(FileChooserFactory.class);
}
+ /**
+ * @deprecated use {@linkplain #createFileChooser(FileChooserDescriptor, com.intellij.openapi.project.Project, java.awt.Component)}
+ * (to remove in IDEA 13)
+ */
+ @SuppressWarnings("UnusedDeclaration")
@NotNull
public FileChooserDialog createFileChooser(@NotNull FileChooserDescriptor descriptor, @Nullable Project project) {
return createFileChooser(descriptor, project, null);
}
+ /**
+ * @deprecated use {@linkplain #createFileChooser(FileChooserDescriptor, com.intellij.openapi.project.Project, java.awt.Component)}
+ * (to remove in IDEA 13)
+ */
+ @SuppressWarnings("UnusedDeclaration")
@NotNull
public FileChooserDialog createFileChooser(@NotNull FileChooserDescriptor descriptor, @NotNull Component parent) {
return createFileChooser(descriptor, null, parent);
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/GuiUtils.java b/platform/platform-api/src/com/intellij/ui/GuiUtils.java
index 68c970d04780..a3702a05b7cb 100644
--- a/platform/platform-api/src/com/intellij/ui/GuiUtils.java
+++ b/platform/platform-api/src/com/intellij/ui/GuiUtils.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.
@@ -82,7 +82,7 @@ public class GuiUtils {
return constructFieldWithBrowseButton(aTextField, new ActionListener() {
public void actionPerformed(ActionEvent e) {
FileChooserDescriptor descriptor = FileChooserDescriptorFactory.getDirectoryChooserDescriptor(aSearchedObjectName);
- VirtualFile file = FileChooser.chooseFile(aTextField, descriptor);
+ VirtualFile file = FileChooser.chooseFile(descriptor, aTextField, null, null);
if (file != null) {
aTextField.setText(FileUtil.toSystemDependentName(file.getPath()));
aTextField.postActionEvent();
@@ -96,7 +96,7 @@ public class GuiUtils {
return constructFieldWithBrowseButton(aFieldWithHistory, new ActionListener() {
public void actionPerformed(ActionEvent e) {
FileChooserDescriptor descriptor = FileChooserDescriptorFactory.getFileChooserDescriptor(aSearchedObjectName);
- VirtualFile file = FileChooser.chooseFile(aFieldWithHistory, descriptor);
+ VirtualFile file = FileChooser.chooseFile(descriptor, aFieldWithHistory, null, null);
if (file != null) {
try {
aFieldWithHistory.setText(VfsUtil.virtualToIoFile(file).toURL().toString());
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-api/src/com/intellij/ui/InsertPathAction.java b/platform/platform-api/src/com/intellij/ui/InsertPathAction.java
index f1c52776b9d6..848c574d8be3 100644
--- a/platform/platform-api/src/com/intellij/ui/InsertPathAction.java
+++ b/platform/platform-api/src/com/intellij/ui/InsertPathAction.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.
@@ -63,7 +63,7 @@ public class InsertPathAction extends AnAction {
}
//TODO use from openapi
//FeatureUsageTracker.getInstance().triggerFeatureUsed("ui.commandLine.insertPath");
- VirtualFile[] files = FileChooser.chooseFiles(myTextField, myDescriptor, virtualFile);
+ VirtualFile[] files = FileChooser.chooseFiles(myDescriptor, myTextField, getEventProject(e), virtualFile);
if (files.length != 0) {
myTextField.replaceSelection(files[0].getPresentableUrl());
}
diff --git a/platform/platform-api/src/com/intellij/util/concurrency/QueueProcessor.java b/platform/platform-api/src/com/intellij/util/concurrency/QueueProcessor.java
index 6f99bce00008..834e4d241bc2 100644
--- a/platform/platform-api/src/com/intellij/util/concurrency/QueueProcessor.java
+++ b/platform/platform-api/src/com/intellij/util/concurrency/QueueProcessor.java
@@ -145,7 +145,9 @@ public class QueueProcessor {
}
public void add(T t, ModalityState state) {
- myModalityState.put(new MyOverrideEquals(t), state);
+ synchronized (myQueue) {
+ myModalityState.put(new MyOverrideEquals(t), state);
+ }
doAdd(t, false);
}
diff --git a/platform/platform-impl/src/com/intellij/ide/actions/ChooseComponentsToExportDialog.java b/platform/platform-impl/src/com/intellij/ide/actions/ChooseComponentsToExportDialog.java
index 25003aee1dfc..6f12cf6a508b 100644
--- a/platform/platform-impl/src/com/intellij/ide/actions/ChooseComponentsToExportDialog.java
+++ b/platform/platform-impl/src/com/intellij/ide/actions/ChooseComponentsToExportDialog.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.
@@ -159,7 +159,7 @@ public class ChooseComponentsToExportDialog extends DialogWrapper {
else {
initialDir = null;
}
- final VirtualFile file = FileChooser.chooseFile(parent, chooserDescriptor, initialDir);
+ final VirtualFile file = FileChooser.chooseFile(chooserDescriptor, parent, null, initialDir);
if (file == null) {
return null;
}
diff --git a/platform/platform-impl/src/com/intellij/ide/diff/VirtualFileDiffElement.java b/platform/platform-impl/src/com/intellij/ide/diff/VirtualFileDiffElement.java
index 7ad3430e1848..8350d8ed9343 100644
--- a/platform/platform-impl/src/com/intellij/ide/diff/VirtualFileDiffElement.java
+++ b/platform/platform-impl/src/com/intellij/ide/diff/VirtualFileDiffElement.java
@@ -22,8 +22,8 @@ import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.application.ex.ApplicationManagerEx;
import com.intellij.openapi.diff.DiffRequest;
import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.fileChooser.FileChooser;
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
-import com.intellij.openapi.fileChooser.FileChooserFactory;
import com.intellij.openapi.fileEditor.*;
import com.intellij.openapi.fileEditor.ex.FileEditorProviderManager;
import com.intellij.openapi.fileTypes.FileTypeManager;
@@ -125,8 +125,7 @@ public class VirtualFileDiffElement extends DiffElement {
@Override
public DiffElement call() throws Exception {
final FileChooserDescriptor descriptor = getChooserDescriptor();
- final VirtualFile[] result = FileChooserFactory.getInstance()
- .createFileChooser(descriptor, project).choose(getValue(), project);
+ final VirtualFile[] result = FileChooser.chooseFiles(descriptor, project, getValue());
return result.length == 1 ? createElement(result[0]) : null;
}
};
diff --git a/platform/platform-impl/src/com/intellij/ide/plugins/InstalledPluginsManagerMain.java b/platform/platform-impl/src/com/intellij/ide/plugins/InstalledPluginsManagerMain.java
index 446cecb77a0c..c98519bdc56a 100644
--- a/platform/platform-impl/src/com/intellij/ide/plugins/InstalledPluginsManagerMain.java
+++ b/platform/platform-impl/src/com/intellij/ide/plugins/InstalledPluginsManagerMain.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.
@@ -81,7 +81,7 @@ public class InstalledPluginsManagerMain extends PluginManagerMain {
};
descriptor.setTitle("Choose Plugin File");
descriptor.setDescription("JAR and ZIP archives are accepted");
- final VirtualFile virtualFile = FileChooser.chooseFile(myActionsPanel, descriptor);
+ final VirtualFile virtualFile = FileChooser.chooseFile(descriptor, myActionsPanel, null, null);
if (virtualFile != null) {
final File file = VfsUtil.virtualToIoFile(virtualFile);
try {
diff --git a/platform/platform-impl/src/com/intellij/internal/encodings/EncodingViewer.java b/platform/platform-impl/src/com/intellij/internal/encodings/EncodingViewer.java
index ae9c9a6841be..091d5db332e6 100644
--- a/platform/platform-impl/src/com/intellij/internal/encodings/EncodingViewer.java
+++ b/platform/platform-impl/src/com/intellij/internal/encodings/EncodingViewer.java
@@ -46,7 +46,7 @@ public class EncodingViewer extends DialogWrapper {
initEncodings();
myLoadFile.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
- VirtualFile file = FileChooser.chooseFile(myPanel, FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor());
+ VirtualFile file = FileChooser.chooseFile(FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor(), myPanel, null, null);
if (file != null) {
loadFrom(file);
}
diff --git a/platform/platform-impl/src/com/intellij/openapi/diff/actions/CompareDirectoriesAction.java b/platform/platform-impl/src/com/intellij/openapi/diff/actions/CompareDirectoriesAction.java
index b9ccf6b2aa91..7f3ed2b21ef3 100644
--- a/platform/platform-impl/src/com/intellij/openapi/diff/actions/CompareDirectoriesAction.java
+++ b/platform/platform-impl/src/com/intellij/openapi/diff/actions/CompareDirectoriesAction.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.
@@ -22,8 +22,8 @@ import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.diff.DirDiffManager;
+import com.intellij.openapi.fileChooser.FileChooser;
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
-import com.intellij.openapi.fileChooser.FileChooserFactory;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
@@ -42,11 +42,11 @@ public class CompareDirectoriesAction extends AnAction {
if (files.length == 2 && files[0].isDirectory() && files[1].isDirectory()) {
src = new VirtualFileDiffElement(files[0]);
trg = new VirtualFileDiffElement(files[1]);
- } else if (files.length == 1 && files[0].isDirectory()) {
+ }
+ else if (files.length == 1 && files[0].isDirectory()) {
src = new VirtualFileDiffElement(files[0]);
final FileChooserDescriptor descriptor = new FileChooserDescriptor(false, true, false, false, false, false);
- final VirtualFile[] result = FileChooserFactory.getInstance()
- .createFileChooser(descriptor, project).choose(project.getBaseDir(), project);
+ final VirtualFile[] result = FileChooser.chooseFiles(descriptor, project, project.getBaseDir());
if (result.length == 1 && result[0] != null && result[0].isDirectory()) {
trg = new VirtualFileDiffElement(result[0]);
}
diff --git a/platform/platform-impl/src/com/intellij/openapi/diff/actions/CompareJarsAction.java b/platform/platform-impl/src/com/intellij/openapi/diff/actions/CompareJarsAction.java
index d94ebcef085b..77d3b7bf5249 100644
--- a/platform/platform-impl/src/com/intellij/openapi/diff/actions/CompareJarsAction.java
+++ b/platform/platform-impl/src/com/intellij/openapi/diff/actions/CompareJarsAction.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.
@@ -24,8 +24,8 @@ import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.diff.DirDiffManager;
+import com.intellij.openapi.fileChooser.FileChooser;
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
-import com.intellij.openapi.fileChooser.FileChooserFactory;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
@@ -33,7 +33,6 @@ import com.intellij.openapi.vfs.VirtualFile;
* @author Konstantin Bulenkov
*/
public class CompareJarsAction extends AnAction {
- //
@Override
public void actionPerformed(AnActionEvent e) {
final Project project = getEventProject(e);
@@ -45,7 +44,8 @@ public class CompareJarsAction extends AnAction {
if (files.length == 2 && isArchive(files[0]) && isArchive(files[1])) {
src = new JarFileDiffElement(files[0]);
trg = new JarFileDiffElement(files[1]);
- } else if (files.length == 1 && isArchive(files[0])) {
+ }
+ else if (files.length == 1 && isArchive(files[0])) {
src = new JarFileDiffElement(files[0]);
final FileChooserDescriptor descriptor = new FileChooserDescriptor(true, false, true, true, false, false) {
@Override
@@ -54,8 +54,7 @@ public class CompareJarsAction extends AnAction {
|| (!file.isDirectory() && isArchive(file));
}
};
- final VirtualFile[] result = FileChooserFactory.getInstance()
- .createFileChooser(descriptor, project).choose(project.getBaseDir(), project);
+ final VirtualFile[] result = FileChooser.chooseFiles(descriptor, project, project.getBaseDir());
if (result.length == 1 && result[0] != null && isArchive(result[0])) {
trg = new JarFileDiffElement(result[0]);
}
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/platform-impl/src/com/intellij/platform/DirectoryProjectGenerator.java b/platform/platform-impl/src/com/intellij/platform/DirectoryProjectGenerator.java
index 368fefd55f73..f467263db1fc 100644
--- a/platform/platform-impl/src/com/intellij/platform/DirectoryProjectGenerator.java
+++ b/platform/platform-impl/src/com/intellij/platform/DirectoryProjectGenerator.java
@@ -23,6 +23,7 @@ import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
/**
* @author yole
@@ -33,6 +34,7 @@ public interface DirectoryProjectGenerator {
@Nls
String getName();
+ @Nullable
T showGenerationSettings(final VirtualFile baseDir) throws ProcessCanceledException;
void generateProject(final Project project, final VirtualFile baseDir, final T settings, Module module);
diff --git a/platform/platform-impl/src/com/intellij/util/ui/LocalPathCellEditor.java b/platform/platform-impl/src/com/intellij/util/ui/LocalPathCellEditor.java
index 22ed5780f52f..d6977c53ef82 100644
--- a/platform/platform-impl/src/com/intellij/util/ui/LocalPathCellEditor.java
+++ b/platform/platform-impl/src/com/intellij/util/ui/LocalPathCellEditor.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2010 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.
@@ -50,8 +50,7 @@ public class LocalPathCellEditor extends AbstractTableCellEditor {
final FileChooserDescriptor d = getFileChooserDescriptor();
String initial = (String)getCellEditorValue();
VirtualFile initialFile = StringUtil.isNotEmpty(initial) ? LocalFileSystem.getInstance().findFileByPath(initial) : null;
- VirtualFile file =
- myProject != null ? FileChooser.chooseFile(myProject, d, initialFile) : FileChooser.chooseFile(table, d, initialFile);
+ VirtualFile file = FileChooser.chooseFile(d, table, myProject, initialFile);
if (file != null) {
String path = file.getPresentableUrl();
if (SystemInfo.isWindows && path.length() == 2 && Character.isLetter(path.charAt(0)) && path.charAt(1) == ':') {
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