mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
Generated
+2
-2
@@ -1,11 +1,11 @@
|
||||
<component name="libraryTable">
|
||||
<library name="miglayout-swing">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/community/lib/miglayout-swing.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/lib/miglayout-swing.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$PROJECT_DIR$/community/lib/src/miglayout-sources.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/lib/src/miglayout-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
+2
-2
@@ -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));
|
||||
}
|
||||
|
||||
+4
-3
@@ -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) {
|
||||
|
||||
+2
-2
@@ -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<DirectoryCopy
|
||||
public List<? extends DirectoryCopyPackagingElement> 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<DirectoryCopyPackagingElement> list = new ArrayList<DirectoryCopyPackagingElement>();
|
||||
for (VirtualFile file : files) {
|
||||
list.add(new DirectoryCopyPackagingElement(file.getPath()));
|
||||
|
||||
+3
-5
@@ -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<Extracte
|
||||
return super.isFileSelectable(file);
|
||||
}
|
||||
};
|
||||
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<PackagingElement<?>> list = new ArrayList<PackagingElement<?>>();
|
||||
final PackagingElementFactory factory = PackagingElementFactory.getInstance();
|
||||
for (VirtualFile file : files) {
|
||||
|
||||
+3
-5
@@ -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<FileCopyPackagingE
|
||||
public List<? extends FileCopyPackagingElement> 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<FileCopyPackagingElement> list = new ArrayList<FileCopyPackagingElement>();
|
||||
for (VirtualFile file : files) {
|
||||
list.add(new FileCopyPackagingElement(file.getPath()));
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
+2
-2
@@ -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<E extends CompositeElem
|
||||
}
|
||||
};
|
||||
descriptor.setTitle("Specify Path to MANIFEST.MF file");
|
||||
final VirtualFile file = FileChooser.chooseFile(myContext.getProject(), descriptor, null);
|
||||
final VirtualFile file = FileChooser.chooseFile(descriptor, myContext.getProject(), null);
|
||||
if (file == null) return;
|
||||
|
||||
ManifestFileUtil.addManifestFileToLayout(file.getPath(), myContext, myElement);
|
||||
|
||||
+2
-2
@@ -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.
|
||||
@@ -154,7 +154,7 @@ public class ExcludedEntriesConfigurable implements UnnamedConfigurable {
|
||||
selected = myExcludeEntryDescriptions.size();
|
||||
}
|
||||
int savedSelected = selected;
|
||||
VirtualFile[] chosen = FileChooser.chooseFiles(myProject, descriptor);
|
||||
VirtualFile[] chosen = FileChooser.chooseFiles(descriptor, myProject, null);
|
||||
for (final VirtualFile chosenFile : chosen) {
|
||||
if (isFileExcluded(chosenFile)) {
|
||||
continue;
|
||||
|
||||
+2
-2
@@ -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.
|
||||
@@ -276,7 +276,7 @@ public class AttachSourcesNotificationProvider implements EditorNotifications.Pr
|
||||
descriptor.setDescription(ProjectBundle.message("library.attach.sources.description"));
|
||||
final Library firstLibrary = libraries.get(0).getLibrary();
|
||||
VirtualFile[] roots = firstLibrary != null ? firstLibrary.getFiles(OrderRootType.CLASSES) : VirtualFile.EMPTY_ARRAY;
|
||||
VirtualFile[] candidates = FileChooser.chooseFiles(myProject, descriptor, roots.length == 0 ? null : PathUtil.getLocalFile(roots[0]));
|
||||
VirtualFile[] candidates = FileChooser.chooseFiles(descriptor, myProject, roots.length == 0 ? null : PathUtil.getLocalFile(roots[0]));
|
||||
final VirtualFile[] files = PathUIUtils.scanAndSelectDetectedJavaSourceRoots(myParentComponent, candidates);
|
||||
if (files.length == 0) {
|
||||
return new ActionCallback.Rejected();
|
||||
|
||||
+2
-2
@@ -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.
|
||||
@@ -43,7 +43,7 @@ public abstract class CustomLibraryDescriptionBase extends CustomLibraryDescript
|
||||
final FileChooserDescriptor descriptor = new FileChooserDescriptor(false, false, true, false, false, true);
|
||||
descriptor.setTitle(IdeBundle.message("new.library.file.chooser.title"));
|
||||
descriptor.setDescription(IdeBundle.message("new.library.file.chooser.description"));
|
||||
final VirtualFile[] files = FileChooser.chooseFiles(parentComponent, descriptor, contextDirectory);
|
||||
final VirtualFile[] files = FileChooser.chooseFiles(descriptor, parentComponent, null, contextDirectory);
|
||||
if (files.length == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -32,11 +32,12 @@ import java.io.File;
|
||||
public class FileAppearanceServiceImpl extends FileAppearanceService {
|
||||
private static CellAppearanceEx EMPTY = new CellAppearanceEx() {
|
||||
@Override
|
||||
public void customize(SimpleColoredComponent component) { }
|
||||
public void customize(@NotNull SimpleColoredComponent component) { }
|
||||
|
||||
@Override
|
||||
public void customize(@NotNull HtmlListCellRenderer renderer) { }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getText() { return ""; }
|
||||
};
|
||||
|
||||
@@ -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.
|
||||
@@ -91,7 +91,7 @@ public class AnnotationsEditor extends ModuleElementsEditor {
|
||||
FileChooserDescriptor myDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
|
||||
myDescriptor.setTitle(ProjectBundle.message("add.external.annotations.path.title"));
|
||||
myDescriptor.setDescription(ProjectBundle.message("add.external.annotations.path.description"));
|
||||
VirtualFile[] files = FileChooser.chooseFiles(myTable, myDescriptor);
|
||||
VirtualFile[] files = FileChooser.chooseFiles(myDescriptor, myTable, myProject, null);
|
||||
final MyTableModel tableModel = (MyTableModel)myTable.getModel();
|
||||
boolean changes = false;
|
||||
for (final VirtualFile file : files) {
|
||||
|
||||
@@ -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.
|
||||
@@ -94,7 +94,7 @@ public class JavadocEditor extends ModuleElementsEditor {
|
||||
FileChooserDescriptor myDescriptor = FileChooserDescriptorFactory.createMultipleJavaPathDescriptor();
|
||||
myDescriptor.setTitle(ProjectBundle.message("module.javadoc.add.path.title"));
|
||||
myDescriptor.setDescription(ProjectBundle.message("module.javadoc.add.path.prompt"));
|
||||
VirtualFile[] files = FileChooser.chooseFiles(myTable, myDescriptor);
|
||||
VirtualFile[] files = FileChooser.chooseFiles(myDescriptor, myTable, myProject, null);
|
||||
final MyTableModel tableModel = (MyTableModel)myTable.getModel();
|
||||
boolean changes = false;
|
||||
for (final VirtualFile file : files) {
|
||||
|
||||
+5
-4
@@ -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.
|
||||
@@ -19,6 +19,7 @@ import com.intellij.openapi.actionSystem.LangDataKeys;
|
||||
import com.intellij.openapi.fileChooser.FileChooser;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.OrderRootType;
|
||||
import com.intellij.openapi.roots.impl.libraries.LibraryTableBase;
|
||||
import com.intellij.openapi.roots.libraries.Library;
|
||||
@@ -148,7 +149,8 @@ public class CreateModuleLibraryChooser implements ClasspathElementChooser<Libra
|
||||
}
|
||||
chooserDescriptor.putUserData(LangDataKeys.MODULE_CONTEXT, myModule);
|
||||
|
||||
final VirtualFile[] files = FileChooser.chooseFiles(myParentComponent, chooserDescriptor, myModule.getProject().getBaseDir());
|
||||
final Project project = myModule.getProject();
|
||||
final VirtualFile[] files = FileChooser.chooseFiles(chooserDescriptor, myParentComponent, project, project.getBaseDir());
|
||||
if (files.length == 0) return Collections.emptyList();
|
||||
|
||||
List<LibraryRootsComponentDescriptor> suitableDescriptors = new ArrayList<LibraryRootsComponentDescriptor>();
|
||||
@@ -167,8 +169,7 @@ public class CreateModuleLibraryChooser implements ClasspathElementChooser<Libra
|
||||
else {
|
||||
rootsComponentDescriptor = myDefaultDescriptor;
|
||||
}
|
||||
List<OrderRoot> chosenRoots = RootDetectionUtil.detectRoots(Arrays.asList(files), myParentComponent, myModule.getProject(),
|
||||
rootsComponentDescriptor);
|
||||
List<OrderRoot> chosenRoots = RootDetectionUtil.detectRoots(Arrays.asList(files), myParentComponent, project, rootsComponentDescriptor);
|
||||
|
||||
final List<OrderRoot> roots = filterAlreadyAdded(chosenRoots);
|
||||
if (roots.isEmpty()) {
|
||||
|
||||
+5
-3
@@ -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("<This Module>", 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 "<This Module>";
|
||||
|
||||
+2
-2
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
+15
@@ -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) {
|
||||
|
||||
+2
-2
@@ -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()));
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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());
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
|
||||
+1
-6
@@ -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());
|
||||
|
||||
+1
-1
@@ -181,7 +181,7 @@ public class a {
|
||||
}
|
||||
|
||||
void forEachParam(java.io.File x) {
|
||||
for (java.io.File f: <error descr="Cannot resolve symbol 'f'">f</error>.listFiles()) {
|
||||
for (java.io.File f: <error descr="Variable 'f' might not have been initialized">f</error>.listFiles()) {
|
||||
forEachParam(f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
@@ -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<VirtualFile> added = new ArrayList<VirtualFile>(files.length);
|
||||
for (VirtualFile vFile : files) {
|
||||
|
||||
-216
@@ -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());
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -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<String, Map<String, Set<OfflineProblemDescriptor>>> resMap =
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
+2
-2
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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<IntentionActionMetaData> list = IntentionManagerSettings.getInstance().getMetaData();
|
||||
final File root = VfsUtil.virtualToIoFile(file);
|
||||
|
||||
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
+5
-2
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
-8
@@ -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();
|
||||
|
||||
+5
-3
@@ -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 {
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
+1
-11
@@ -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.
|
||||
*
|
||||
|
||||
+6
-30
@@ -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.<br/>
|
||||
* Warning: resulting string is not OS-dependent - <b>do not</b> 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 {
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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<Boolean> NATIVE_MAC_FILE_CHOOSER_ENABLED = DataKey.create("native.mac.file.chooser.enabled");
|
||||
DataKey<Boolean> 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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
+2
-1
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
+4
-3
@@ -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<TextSection> mySections = new ArrayList<TextSection>();
|
||||
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();
|
||||
|
||||
-27
@@ -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);
|
||||
}
|
||||
+2
-13
@@ -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;
|
||||
|
||||
@@ -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<T> 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;
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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<T> extends ListCellRendererWrapper<T>
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
@@ -145,7 +145,9 @@ public class QueueProcessor<T> {
|
||||
}
|
||||
|
||||
public void add(T t, ModalityState state) {
|
||||
myModalityState.put(new MyOverrideEquals(t), state);
|
||||
synchronized (myQueue) {
|
||||
myModalityState.put(new MyOverrideEquals(t), state);
|
||||
}
|
||||
doAdd(t, false);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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<VirtualFile> {
|
||||
@Override
|
||||
public DiffElement<VirtualFile> 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;
|
||||
}
|
||||
};
|
||||
|
||||
+2
-2
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
+5
-5
@@ -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]);
|
||||
}
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
|
||||
-5
@@ -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<VirtualFile> selectedFiles = Arrays.asList(myFileSystemTree.getSelectedFiles());
|
||||
return VfsUtil.toVirtualFileArray(FileChooserUtil.getChosenFiles(myChooserDescriptor, selectedFiles));
|
||||
|
||||
@@ -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<VirtualFile> selectedFiles = Arrays.asList(getSelectedFiles());
|
||||
return VfsUtil.toVirtualFileArray(FileChooserUtil.getChosenFiles(myTreeStructure.getChooserDescriptor(), selectedFiles));
|
||||
}
|
||||
|
||||
private <T> List<T> collectSelectedElements(final Function<FileElement, T> converter) {
|
||||
final TreePath[] paths = myTree.getSelectionPaths();
|
||||
if (paths == null) return Collections.emptyList();
|
||||
|
||||
@@ -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<T> {
|
||||
@Nls
|
||||
String getName();
|
||||
|
||||
@Nullable
|
||||
T showGenerationSettings(final VirtualFile baseDir) throws ProcessCanceledException;
|
||||
|
||||
void generateProject(final Project project, final VirtualFile baseDir, final T settings, Module module);
|
||||
|
||||
@@ -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) == ':') {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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<Object, String> myValueMap;
|
||||
|
||||
public MappingListCellRenderer(final Map<Object, String> valueMap) {
|
||||
myValueMap = valueMap;
|
||||
}
|
||||
|
||||
public MappingListCellRenderer(final Pair<Object, String>... valuePairs) {
|
||||
myValueMap = new HashMap<Object, String>();
|
||||
for (Pair<Object, String> valuePair : valuePairs) {
|
||||
myValueMap.put(valuePair.getFirst(), valuePair.getSecond());
|
||||
}
|
||||
}
|
||||
|
||||
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
|
||||
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
|
||||
String newValue = myValueMap.get(value);
|
||||
if (newValue != null) {
|
||||
setText(newValue);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -2326,22 +2326,6 @@ public class UIUtil {
|
||||
myLineSpacing = 1.0f;
|
||||
}
|
||||
|
||||
/** @deprecated use {@linkplain #withLineSpacing(float)} (to remove in IDEA 12) */
|
||||
@SuppressWarnings("UnusedDeclaration")
|
||||
public TextPainter(final float lineSpacing) {
|
||||
myDrawShadow = isUnderAquaLookAndFeel();
|
||||
myShadowColor = Gray._220;
|
||||
myLineSpacing = lineSpacing;
|
||||
}
|
||||
|
||||
/** @deprecated use {@linkplain #withShadow(boolean, java.awt.Color)} and {@linkplain #withLineSpacing(float)} (to remove in IDEA 12) */
|
||||
@SuppressWarnings("UnusedDeclaration")
|
||||
public TextPainter(final boolean drawShadow, final Color shadowColor, final float lineSpacing) {
|
||||
myDrawShadow = drawShadow;
|
||||
myShadowColor = shadowColor;
|
||||
myLineSpacing = lineSpacing;
|
||||
}
|
||||
|
||||
public TextPainter withShadow(final boolean drawShadow) {
|
||||
myDrawShadow = drawShadow;
|
||||
return this;
|
||||
|
||||
+2
-2
@@ -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.
|
||||
@@ -577,7 +577,7 @@ public class ApplyPatchDifferentiatedDialog extends DialogWrapper {
|
||||
private class NewBaseSelector implements Runnable {
|
||||
public void run() {
|
||||
final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
|
||||
VirtualFile selectedFile = FileChooser.chooseFile(myProject, descriptor);
|
||||
VirtualFile selectedFile = FileChooser.chooseFile(descriptor, myProject, null);
|
||||
if (selectedFile == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
@@ -795,7 +795,7 @@ public class InjectionsSettingsUI implements SearchableConfigurable.Parent, NonD
|
||||
final SplitterProportionsData splitterData = new SplitterProportionsDataImpl();
|
||||
splitterData.externalizeFromDimensionService("IntelliLang.ImportSettingsKey.SplitterProportions");
|
||||
|
||||
final VirtualFile file = FileChooser.chooseFile(myProject, descriptor);
|
||||
final VirtualFile file = FileChooser.chooseFile(descriptor, myProject, null);
|
||||
if (file == null) return;
|
||||
try {
|
||||
final Configuration cfg = Configuration.load(file.getInputStream());
|
||||
|
||||
+2
-1
@@ -93,6 +93,7 @@ public final class AndroidDesignerEditorPanel extends DesignerEditorPanel {
|
||||
myProfileAction = new ProfileAction(this, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
myPSIChangeListener.setInitialize();
|
||||
myActionPanel.update();
|
||||
if (myRootComponent == null) {
|
||||
myPSIChangeListener.activate();
|
||||
@@ -403,7 +404,7 @@ public final class AndroidDesignerEditorPanel extends DesignerEditorPanel {
|
||||
if (StringUtil.isEmpty(exception.getPresentableMessage())) {
|
||||
Throwable[] causes = exception.getCauses();
|
||||
if (causes.length == 0) {
|
||||
info.myThrowable = new RenderingException(AndroidBundle.message("android.layout.preview.default.error.message"));
|
||||
info.myThrowable = new Exception(AndroidBundle.message("android.layout.preview.default.error.message"), exception);
|
||||
}
|
||||
else if (causes.length == 1) {
|
||||
info.myThrowable = causes[0];
|
||||
|
||||
+11
-8
@@ -26,28 +26,31 @@ import com.intellij.util.Alarm;
|
||||
import com.intellij.util.containers.ComparatorUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
/**
|
||||
* @author Alexander Lobas
|
||||
*/
|
||||
public class ExternalPSIChangeListener extends PsiTreeChangeAdapter {
|
||||
private final Alarm myAlarm = new Alarm();
|
||||
private final JComponent myComponent;
|
||||
private final AndroidDesignerEditorPanel myDesigner;
|
||||
private final PsiFile myFile;
|
||||
private final int myDelayMillis;
|
||||
private final Runnable myRunnable;
|
||||
private volatile boolean myRunState;
|
||||
private volatile boolean myInitialize;
|
||||
private String myContent;
|
||||
|
||||
public ExternalPSIChangeListener(JComponent component, PsiFile file, int delayMillis, Runnable runnable) {
|
||||
myComponent = component;
|
||||
public ExternalPSIChangeListener(AndroidDesignerEditorPanel designer, PsiFile file, int delayMillis, Runnable runnable) {
|
||||
myDesigner = designer;
|
||||
myFile = file;
|
||||
myDelayMillis = delayMillis;
|
||||
myRunnable = runnable;
|
||||
myContent = getContent();
|
||||
}
|
||||
|
||||
public void setInitialize() {
|
||||
myInitialize = true;
|
||||
}
|
||||
|
||||
public void start() {
|
||||
if (!myRunState) {
|
||||
myRunState = true;
|
||||
@@ -66,7 +69,7 @@ public class ExternalPSIChangeListener extends PsiTreeChangeAdapter {
|
||||
public void activate() {
|
||||
if (!myRunState) {
|
||||
start();
|
||||
if (!ComparatorUtil.equalsNullable(myContent, getContent())) {
|
||||
if (!ComparatorUtil.equalsNullable(myContent, getContent()) || myDesigner.getRootComponent() == null) {
|
||||
addRequest();
|
||||
}
|
||||
myContent = null;
|
||||
@@ -104,11 +107,11 @@ public class ExternalPSIChangeListener extends PsiTreeChangeAdapter {
|
||||
myAlarm.addRequest(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (myRunState) {
|
||||
if (myRunState && myInitialize) {
|
||||
runnable.run();
|
||||
}
|
||||
}
|
||||
}, myDelayMillis, ModalityState.stateForComponent(myComponent));
|
||||
}, myDelayMillis, ModalityState.stateForComponent(myDesigner));
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
* 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.android.designer.designSurface.layout;
|
||||
|
||||
import com.intellij.android.designer.designSurface.AbstractEditOperation;
|
||||
import com.intellij.android.designer.model.RadViewComponent;
|
||||
import com.intellij.android.designer.model.table.RadTableLayoutComponent;
|
||||
import com.intellij.designer.designSurface.FeedbackLayer;
|
||||
import com.intellij.designer.designSurface.OperationContext;
|
||||
import com.intellij.designer.model.RadComponent;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Alexander Lobas
|
||||
*/
|
||||
public class TableLayoutOperation extends AbstractEditOperation {
|
||||
private GridFeedback myFeedback;
|
||||
|
||||
public TableLayoutOperation(RadComponent container, OperationContext context) {
|
||||
super(container, context);
|
||||
}
|
||||
|
||||
private void createFeedback() {
|
||||
if (myFeedback == null) {
|
||||
FeedbackLayer layer = myContext.getArea().getFeedbackLayer();
|
||||
myFeedback = new GridFeedback();
|
||||
myFeedback.setBounds(myContainer.getBounds(layer));
|
||||
layer.add(myFeedback);
|
||||
layer.repaint();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showFeedback() {
|
||||
createFeedback();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void eraseFeedback() {
|
||||
if (myFeedback != null) {
|
||||
FeedbackLayer layer = myContext.getArea().getFeedbackLayer();
|
||||
layer.remove(myFeedback);
|
||||
layer.repaint();
|
||||
myFeedback = null;
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Feedback
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public static final Color COLOR = new Color(80, 110, 160);
|
||||
|
||||
private class GridFeedback extends JComponent {
|
||||
@Override
|
||||
protected void paintComponent(Graphics g) {
|
||||
super.paintComponent(g);
|
||||
g.setColor(COLOR);
|
||||
|
||||
Rectangle bounds = getBounds();
|
||||
bounds.x = bounds.y = 0;
|
||||
|
||||
int[] columnWidths = ((RadTableLayoutComponent)myContainer).getColumnWidths();
|
||||
|
||||
if (columnWidths != null && columnWidths.length > 0) {
|
||||
int x = bounds.x;
|
||||
|
||||
for (int i = 0; i < columnWidths.length; i++) {
|
||||
int width = columnWidths[i];
|
||||
|
||||
if (width > 0) {
|
||||
x += width;
|
||||
|
||||
if (i != columnWidths.length - 1 || x < bounds.getMinX()) {
|
||||
g.drawLine(x, bounds.y, x, bounds.y + bounds.height);
|
||||
}
|
||||
}
|
||||
else {
|
||||
g.drawLine(x + 2, bounds.y, x + 2, bounds.y + bounds.height);
|
||||
}
|
||||
}
|
||||
|
||||
bounds.width = Math.max(bounds.width, x - bounds.x);
|
||||
}
|
||||
|
||||
List<RadComponent> children = myContainer.getChildren();
|
||||
RadComponent last = children.isEmpty() ? null : children.get(children.size() - 1);
|
||||
|
||||
for (RadComponent child : children) {
|
||||
Rectangle childBounds = child.getBounds(this);
|
||||
int y = childBounds.y + childBounds.height + ((RadViewComponent)child).getMargins().height;
|
||||
|
||||
if (child != last || y < bounds.getMaxY()) {
|
||||
g.drawLine(bounds.x, y, bounds.x + bounds.width, y);
|
||||
}
|
||||
}
|
||||
|
||||
g.drawRect(bounds.x, bounds.y, bounds.width, bounds.height);
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
@@ -57,4 +57,14 @@ public class RadCaptionTableColumn extends RadVisualComponent {
|
||||
public void addStaticDecorators(List<StaticDecorator> decorators, List<RadComponent> selection) {
|
||||
decorators.add(myDecorator);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDelete() {
|
||||
return false; // TODO: Auto-generated method stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete() throws Exception {
|
||||
// TODO: Auto-generated method stub
|
||||
}
|
||||
}
|
||||
+5
@@ -58,4 +58,9 @@ public class RadCaptionTableRow extends RadVisualComponent {
|
||||
public void addStaticDecorators(List<StaticDecorator> decorators, List<RadComponent> selection) {
|
||||
decorators.add(myDecorator);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete() throws Exception {
|
||||
myComponent.delete();
|
||||
}
|
||||
}
|
||||
+24
-15
@@ -19,6 +19,7 @@ import com.intellij.android.designer.designSurface.*;
|
||||
import com.intellij.android.designer.designSurface.AbstractEditOperation;
|
||||
import com.intellij.android.designer.designSurface.layout.ResizeOperation;
|
||||
import com.intellij.android.designer.designSurface.layout.TableLayoutDecorator;
|
||||
import com.intellij.android.designer.designSurface.layout.TableLayoutOperation;
|
||||
import com.intellij.android.designer.model.RadViewComponent;
|
||||
import com.intellij.android.designer.model.RadViewLayout;
|
||||
import com.intellij.android.designer.model.RadViewLayoutWithData;
|
||||
@@ -60,8 +61,7 @@ public class RadTableLayout extends RadViewLayoutWithData implements ILayoutDeco
|
||||
}
|
||||
return null;
|
||||
}
|
||||
// XXX
|
||||
return null;
|
||||
return new TableLayoutOperation(myContainer, context);
|
||||
}
|
||||
if (context.is(ResizeOperation.TYPE)) {
|
||||
return new ResizeOperation(context);
|
||||
@@ -138,7 +138,23 @@ public class RadTableLayout extends RadViewLayoutWithData implements ILayoutDeco
|
||||
|
||||
@Override
|
||||
public ICaption getCaption(RadComponent component) {
|
||||
return myContainer == component && myContainer.getParent().getLayout() instanceof ICaptionDecorator ? null : this;
|
||||
if (myContainer == component) {
|
||||
// skip for caption parent, example: ...( Caption( TableLayout ) )
|
||||
RadComponent parent = myContainer.getParent();
|
||||
if (parent.getLayout() instanceof ICaptionDecorator) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// skip for caption parent.parent, example: ...( TableLayout( TableRowLayout( TableLayout ) ) )
|
||||
parent = parent.getParent();
|
||||
if (parent != null && parent.getLayout() instanceof ICaptionDecorator) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if (myContainer.getChildren().isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -149,19 +165,11 @@ public class RadTableLayout extends RadViewLayoutWithData implements ILayoutDeco
|
||||
List<RadComponent> components = new ArrayList<RadComponent>();
|
||||
|
||||
if (horizontal) {
|
||||
if (children.isEmpty()) {
|
||||
components.add(new RadCaptionTableColumn(container, 0, container.getBounds().width));
|
||||
int columnOffset = 0;
|
||||
for (int columnWidth : container.getColumnWidths()) {
|
||||
components.add(new RadCaptionTableColumn(container, columnOffset, Math.max(columnWidth, 2)));
|
||||
columnOffset += columnWidth;
|
||||
}
|
||||
else {
|
||||
int columnOffset = 0;
|
||||
for (int columnWidth : container.getColumnWidths()) {
|
||||
components.add(new RadCaptionTableColumn(container, columnOffset, Math.max(columnWidth, 2)));
|
||||
columnOffset += columnWidth;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (children.isEmpty()) {
|
||||
components.add(new RadCaptionTableRow(container));
|
||||
}
|
||||
else {
|
||||
for (RadComponent component : children) {
|
||||
@@ -179,6 +187,7 @@ public class RadTableLayout extends RadViewLayoutWithData implements ILayoutDeco
|
||||
@NotNull
|
||||
public RadLayout getCaptionLayout(final EditableArea mainArea, boolean horizontal) {
|
||||
if (horizontal) {
|
||||
// TODO
|
||||
return myCaptionColumnLayout;
|
||||
}
|
||||
|
||||
|
||||
+4
@@ -17,6 +17,7 @@ package com.intellij.android.designer.model.table;
|
||||
|
||||
import com.android.ide.common.rendering.api.ViewInfo;
|
||||
import com.intellij.android.designer.model.RadViewContainer;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
@@ -45,6 +46,9 @@ public class RadTableLayoutComponent extends RadViewContainer {
|
||||
}
|
||||
catch (Throwable e) {
|
||||
}
|
||||
if (myColumnWidths == null) {
|
||||
myColumnWidths = ArrayUtil.EMPTY_INT_ARRAY;
|
||||
}
|
||||
}
|
||||
return myColumnWidths;
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
@@ -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.
|
||||
@@ -33,11 +33,13 @@ import com.intellij.openapi.compiler.CompileScope;
|
||||
import com.intellij.openapi.compiler.CompileStatusNotification;
|
||||
import com.intellij.openapi.compiler.CompilerManager;
|
||||
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.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.progress.ProgressManager;
|
||||
import com.intellij.openapi.progress.Task;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.ModuleRootManager;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
|
||||
@@ -116,7 +118,8 @@ class ApkStep extends ExportSignedPackageWizardStep {
|
||||
return getContentRootPath(module);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
final Project project = wizard.getProject();
|
||||
myProguardConfigFilePathField.getButton().addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@@ -129,8 +132,8 @@ class ApkStep extends ExportSignedPackageWizardStep {
|
||||
if (defaultFile == null && facet != null) {
|
||||
defaultFile = AndroidRootUtil.getMainContentRoot(facet);
|
||||
}
|
||||
final VirtualFile file = FileChooser.chooseFile(myContentPanel, FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor(),
|
||||
defaultFile);
|
||||
final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor();
|
||||
final VirtualFile file = FileChooser.chooseFile(descriptor, myContentPanel, project, defaultFile);
|
||||
if (file != null) {
|
||||
myProguardConfigFilePathField.setText(FileUtil.toSystemDependentName(file.getPath()));
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
@@ -19,6 +19,7 @@ package org.jetbrains.android.exportSignedPackage;
|
||||
import com.intellij.ide.util.PropertiesComponent;
|
||||
import com.intellij.ide.wizard.CommitStepException;
|
||||
import com.intellij.openapi.fileChooser.FileChooser;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
|
||||
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
@@ -204,7 +205,8 @@ class KeystoreStep extends ExportSignedPackageWizardStep {
|
||||
path = defaultLocation != null ? defaultLocation : "";
|
||||
}
|
||||
VirtualFile f = LocalFileSystem.getInstance().findFileByPath(path);
|
||||
VirtualFile file = FileChooser.chooseFile(myContentPanel, FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor(), f);
|
||||
FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor();
|
||||
VirtualFile file = FileChooser.chooseFile(descriptor, myContentPanel, myWizard.getProject(), f);
|
||||
if (file != null) {
|
||||
myKeystoreLocationField.setText(FileUtil.toSystemDependentName(file.getPath()));
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
@@ -151,8 +151,8 @@ public class AndroidFacetEditorTab extends FacetEditorTab {
|
||||
if (defaultFile == null) {
|
||||
defaultFile = AndroidRootUtil.getMainContentRoot(facet);
|
||||
}
|
||||
final VirtualFile file = FileChooser.chooseFile(myContentPanel, FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor(),
|
||||
defaultFile);
|
||||
final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor();
|
||||
final VirtualFile file = FileChooser.chooseFile(descriptor, myContentPanel, project, defaultFile);
|
||||
if (file != null) {
|
||||
myProguardConfigFileTextField.setText(FileUtil.toSystemDependentName(file.getPath()));
|
||||
}
|
||||
@@ -686,7 +686,8 @@ public class AndroidFacetEditorTab extends FacetEditorTab {
|
||||
}
|
||||
}
|
||||
}
|
||||
VirtualFile file = FileChooser.chooseFile(myContentPanel, FileChooserDescriptorFactory.createSingleFolderDescriptor(), initialFile);
|
||||
final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
|
||||
VirtualFile file = FileChooser.chooseFile(descriptor, myContentPanel, myContext.getProject(), initialFile);
|
||||
if (file != null) {
|
||||
myTextField.setText(FileUtil.toSystemDependentName(file.getPath()));
|
||||
}
|
||||
@@ -741,21 +742,21 @@ public class AndroidFacetEditorTab extends FacetEditorTab {
|
||||
initialFile = LocalFileSystem.getInstance().findFileByPath(p);
|
||||
}
|
||||
}
|
||||
return FileChooser
|
||||
.chooseFiles(myContentPanel, new FileChooserDescriptor(chooseFile, !chooseFile, false, false, false, chooseMultiple) {
|
||||
@Override
|
||||
public boolean isFileVisible(VirtualFile file, boolean showHiddenFiles) {
|
||||
if (!super.isFileVisible(file, showHiddenFiles)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!file.isDirectory() && !chooseFile) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return filter == null || filter.value(file);
|
||||
final FileChooserDescriptor descriptor = new FileChooserDescriptor(chooseFile, !chooseFile, false, false, false, chooseMultiple) {
|
||||
@Override
|
||||
public boolean isFileVisible(VirtualFile file, boolean showHiddenFiles) {
|
||||
if (!super.isFileVisible(file, showHiddenFiles)) {
|
||||
return false;
|
||||
}
|
||||
}, initialFile);
|
||||
|
||||
if (!file.isDirectory() && !chooseFile) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return filter == null || filter.value(file);
|
||||
}
|
||||
};
|
||||
return FileChooser.chooseFiles(descriptor, myContentPanel, myContext.getProject(), initialFile);
|
||||
}
|
||||
|
||||
private static class MyManifestFilter implements Condition<VirtualFile> {
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ public class AndroidLogcatToolWindowFactory implements ToolWindowFactory {
|
||||
public static final String TOOL_WINDOW_ID = AndroidBundle.message("android.logcat.title");
|
||||
|
||||
public void createToolWindowContent(final Project project, final ToolWindow toolWindow) {
|
||||
toolWindow.setIcon(AndroidUtils.ANDROID_ICON);
|
||||
toolWindow.setIcon(AndroidUtils.ANDROID_TOOLWINDOW_ICON);
|
||||
toolWindow.setAvailable(true, null);
|
||||
toolWindow.setToHideOnEmptyContent(true);
|
||||
toolWindow.setTitle(TOOL_WINDOW_ID);
|
||||
|
||||
@@ -97,6 +97,7 @@ public class AndroidUtils {
|
||||
private static final Logger LOG = Logger.getInstance("#org.jetbrains.android.util.AndroidUtils");
|
||||
|
||||
// Icons
|
||||
public static final Icon ANDROID_TOOLWINDOW_ICON = IconLoader.getIcon("/icons/androidToolWindow.png");
|
||||
public static final Icon ANDROID_ICON = IconLoader.getIcon("/icons/android.png");
|
||||
public static final Icon DDMS_ICON = IconLoader.getIcon("/icons/ddms.png");
|
||||
public static final Icon RESTART_LOGCAT_ICON = IconLoader.getIcon("/icons/restartLogcat.png");
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -62,7 +62,7 @@ final class AntBuildFileNodeDescriptor extends AntNodeDescriptor {
|
||||
return !Comparing.equal(myAppearance, oldAppearence);
|
||||
}
|
||||
|
||||
public void customize(SimpleColoredComponent component) {
|
||||
public void customize(@NotNull SimpleColoredComponent component) {
|
||||
if (myAppearance != null) {
|
||||
myAppearance.customize(component);
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
@@ -34,7 +34,6 @@ import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.fileChooser.FileChooser;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
|
||||
import com.intellij.openapi.fileEditor.OpenFileDescriptor;
|
||||
import com.intellij.openapi.fileTypes.FileTypeManager;
|
||||
import com.intellij.openapi.fileTypes.StdFileTypes;
|
||||
import com.intellij.openapi.keymap.Keymap;
|
||||
import com.intellij.openapi.keymap.KeymapManagerListener;
|
||||
@@ -206,7 +205,7 @@ public class AntExplorer extends SimpleToolWindowPanel implements DataProvider,
|
||||
final FileChooserDescriptor descriptor = createXmlDescriptor();
|
||||
descriptor.setTitle(AntBundle.message("select.ant.build.file.dialog.title"));
|
||||
descriptor.setDescription(AntBundle.message("select.ant.build.file.dialog.description"));
|
||||
final VirtualFile[] files = FileChooser.chooseFiles(myProject, descriptor);
|
||||
final VirtualFile[] files = FileChooser.chooseFiles(descriptor, myProject, null);
|
||||
if (files.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -30,7 +30,7 @@ abstract class AntNodeDescriptor extends NodeDescriptor implements CellAppearanc
|
||||
|
||||
public abstract boolean isAutoExpand();
|
||||
|
||||
public void customize(SimpleColoredComponent component) {
|
||||
public void customize(@NotNull SimpleColoredComponent component) {
|
||||
component.append(toString(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ abstract class AntNodeDescriptor extends NodeDescriptor implements CellAppearanc
|
||||
renderer.append(toString(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getText() {
|
||||
return toString();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -137,7 +137,7 @@ final class AntTargetNodeDescriptor extends AntNodeDescriptor {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void customize(SimpleColoredComponent component) {
|
||||
public void customize(@NotNull SimpleColoredComponent component) {
|
||||
getHighlightedText().customize(component);
|
||||
component.setIcon(getOpenIcon());
|
||||
String toolTipText = getTarget().getNotEmptyDescription();
|
||||
|
||||
@@ -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,12 +15,10 @@
|
||||
*/
|
||||
package com.intellij.lang.ant.config.impl;
|
||||
|
||||
import com.intellij.openapi.fileChooser.FileChooser;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
|
||||
import com.intellij.openapi.roots.ui.CellAppearanceEx;
|
||||
import com.intellij.openapi.roots.ui.FileAppearanceService;
|
||||
import com.intellij.openapi.roots.ui.ModifiableCellAppearanceEx;
|
||||
import com.intellij.openapi.util.Factory;
|
||||
import com.intellij.openapi.util.IconLoader;
|
||||
import com.intellij.openapi.util.WriteExternalException;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
@@ -38,14 +36,17 @@ import java.util.List;
|
||||
|
||||
public class AllJarsUnderDirEntry implements AntClasspathEntry {
|
||||
private static final Icon ALL_JARS_IN_DIR_ICON = IconLoader.getIcon("/ant/allJarsInDir.png");
|
||||
private final File myDir;
|
||||
@NonNls static final String DIR = "dir";
|
||||
@NonNls private static final String JAR_SUFFIX = ".jar";
|
||||
|
||||
private static final Function<VirtualFile, AntClasspathEntry> CREATE_FROM_VIRTUAL_FILE = new Function<VirtualFile, AntClasspathEntry>() {
|
||||
public AntClasspathEntry fun(VirtualFile file) {
|
||||
return fromVirtualFile(file);
|
||||
}
|
||||
};
|
||||
@NonNls public static final String JAR_SUFFIX = ".jar";
|
||||
|
||||
@NonNls static final String DIR = "dir";
|
||||
|
||||
private final File myDir;
|
||||
|
||||
public AllJarsUnderDirEntry(final File dir) {
|
||||
myDir = dir;
|
||||
@@ -85,17 +86,10 @@ public class AllJarsUnderDirEntry implements AntClasspathEntry {
|
||||
return new AllJarsUnderDirEntry(file.getPath());
|
||||
}
|
||||
|
||||
public static class AddEntriesFactory implements Factory<List<AntClasspathEntry>> {
|
||||
private final JComponent myParentComponent;
|
||||
|
||||
public AddEntriesFactory(final JComponent component) {
|
||||
myParentComponent = component;
|
||||
}
|
||||
|
||||
public List<AntClasspathEntry> create() {
|
||||
VirtualFile[] files = FileChooser.chooseFiles(myParentComponent, FileChooserDescriptorFactory.createMultipleFoldersDescriptor());
|
||||
if (files.length == 0) return null;
|
||||
return ContainerUtil.map(files, CREATE_FROM_VIRTUAL_FILE);
|
||||
@SuppressWarnings("ClassNameSameAsAncestorName")
|
||||
public static class AddEntriesFactory extends AntClasspathEntry.AddEntriesFactory {
|
||||
public AddEntriesFactory(final JComponent parentComponent) {
|
||||
super(parentComponent, FileChooserDescriptorFactory.createMultipleFoldersDescriptor(), CREATE_FROM_VIRTUAL_FILE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,20 @@
|
||||
*/
|
||||
package com.intellij.lang.ant.config.impl;
|
||||
|
||||
import com.intellij.openapi.fileChooser.FileChooser;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
|
||||
import com.intellij.openapi.roots.ui.CellAppearanceEx;
|
||||
import com.intellij.openapi.util.InvalidDataException;
|
||||
import com.intellij.openapi.util.NullableFactory;
|
||||
import com.intellij.openapi.util.WriteExternalException;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.PathUtil;
|
||||
import com.intellij.util.config.Externalizer;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jdom.Element;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
@@ -49,4 +56,23 @@ public interface AntClasspathEntry {
|
||||
void addFilesTo(List<File> files);
|
||||
|
||||
CellAppearanceEx getAppearance();
|
||||
|
||||
abstract class AddEntriesFactory implements NullableFactory<List<AntClasspathEntry>> {
|
||||
private final JComponent myParentComponent;
|
||||
private final FileChooserDescriptor myDescriptor;
|
||||
private final Function<VirtualFile,AntClasspathEntry> myMapper;
|
||||
|
||||
public AddEntriesFactory(final JComponent parentComponent,
|
||||
final FileChooserDescriptor descriptor,
|
||||
final Function<VirtualFile, AntClasspathEntry> mapper) {
|
||||
myParentComponent = parentComponent;
|
||||
myDescriptor = descriptor;
|
||||
myMapper = mapper;
|
||||
}
|
||||
|
||||
public List<AntClasspathEntry> create() {
|
||||
final VirtualFile[] files = FileChooser.chooseFiles(myDescriptor, myParentComponent, null, null);
|
||||
return files.length == 0 ? null : ContainerUtil.map(files, myMapper);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,11 +15,9 @@
|
||||
*/
|
||||
package com.intellij.lang.ant.config.impl;
|
||||
|
||||
import com.intellij.openapi.fileChooser.FileChooser;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
|
||||
import com.intellij.openapi.roots.ui.CellAppearanceEx;
|
||||
import com.intellij.openapi.roots.ui.FileAppearanceService;
|
||||
import com.intellij.openapi.util.Factory;
|
||||
import com.intellij.openapi.util.InvalidDataException;
|
||||
import com.intellij.openapi.util.WriteExternalException;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
@@ -27,7 +25,6 @@ import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.VirtualFileManager;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.PathUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jdom.Element;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
@@ -36,12 +33,11 @@ import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
public class SinglePathEntry implements AntClasspathEntry {
|
||||
private static final Function<VirtualFile, AntClasspathEntry> CREATE_FROM_VIRTUAL_FILE =
|
||||
new Function<VirtualFile, AntClasspathEntry>() {
|
||||
public AntClasspathEntry fun(VirtualFile singlePathEntry) {
|
||||
return fromVirtulaFile(singlePathEntry);
|
||||
}
|
||||
};
|
||||
private static final Function<VirtualFile, AntClasspathEntry> CREATE_FROM_VIRTUAL_FILE = new Function<VirtualFile, AntClasspathEntry>() {
|
||||
public AntClasspathEntry fun(VirtualFile singlePathEntry) {
|
||||
return fromVirtualFile(singlePathEntry);
|
||||
}
|
||||
};
|
||||
|
||||
@NonNls static final String PATH = "path";
|
||||
|
||||
@@ -77,22 +73,14 @@ public class SinglePathEntry implements AntClasspathEntry {
|
||||
return myFile.getAbsolutePath();
|
||||
}
|
||||
|
||||
public static SinglePathEntry fromVirtulaFile(VirtualFile file) {
|
||||
private static SinglePathEntry fromVirtualFile(VirtualFile file) {
|
||||
return new SinglePathEntry(file.getPresentableUrl());
|
||||
}
|
||||
|
||||
public static class AddEntriesFactory implements Factory<List<AntClasspathEntry>> {
|
||||
private final JComponent myParentComponent;
|
||||
|
||||
@SuppressWarnings("ClassNameSameAsAncestorName")
|
||||
public static class AddEntriesFactory extends AntClasspathEntry.AddEntriesFactory {
|
||||
public AddEntriesFactory(final JComponent parentComponent) {
|
||||
myParentComponent = parentComponent;
|
||||
}
|
||||
|
||||
public List<AntClasspathEntry> create() {
|
||||
VirtualFile[] files = FileChooser.chooseFiles(myParentComponent, new FileChooserDescriptor(false, true, true, true, false, true));
|
||||
if (files.length == 0) return null;
|
||||
return ContainerUtil.map(files, CREATE_FROM_VIRTUAL_FILE);
|
||||
super(parentComponent, new FileChooserDescriptor(false, true, true, true, false, true), CREATE_FROM_VIRTUAL_FILE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,6 +20,7 @@ import com.intellij.lang.ant.config.impl.AntInstallation;
|
||||
import com.intellij.lang.ant.config.impl.AntReference;
|
||||
import com.intellij.lang.ant.config.impl.GlobalAntConfiguration;
|
||||
import com.intellij.openapi.fileChooser.FileChooser;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
@@ -214,7 +215,8 @@ public class AntSetPanel {
|
||||
}
|
||||
|
||||
public AntInstallation create() {
|
||||
VirtualFile file = FileChooser.chooseFile(myParent, FileChooserDescriptorFactory.createSingleFolderDescriptor(), null);
|
||||
FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
|
||||
VirtualFile file = FileChooser.chooseFile(descriptor, myParent, null, null);
|
||||
if (file == null) return null;
|
||||
try {
|
||||
final AntInstallation inst = AntInstallation.fromHome(file.getPresentableUrl());
|
||||
|
||||
@@ -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.
|
||||
@@ -195,7 +195,7 @@ public class CopyrightProfilesPanel extends MasterDetailsComponent implements Se
|
||||
}
|
||||
};
|
||||
descriptor.setTitle("Choose file containing copyright notice");
|
||||
final VirtualFile file = FileChooser.chooseFile(myProject, descriptor);
|
||||
final VirtualFile file = FileChooser.chooseFile(descriptor, myProject, null);
|
||||
if (file == null) return;
|
||||
|
||||
final List<CopyrightProfile> copyrightProfiles = ExternalOptionHelper.loadOptions(VfsUtil.virtualToIoFile(file));
|
||||
|
||||
@@ -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.
|
||||
@@ -77,7 +77,7 @@ public class CheckoutHelper {
|
||||
descriptor.setTitle(CvsBundle.message("dialog.description.select.a.directory.to.check.out.the.files.to"));
|
||||
VirtualFile suggestedCheckoutFolder =
|
||||
LocalFileSystem.getInstance().findFileByPath(pathToSuggestedFolder.replace(File.separatorChar, '/'));
|
||||
return FileChooser.chooseFile(myPanel, descriptor, suggestedCheckoutFolder);
|
||||
return FileChooser.chooseFile(descriptor, myPanel, null, suggestedCheckoutFolder);
|
||||
}
|
||||
|
||||
private boolean requestLocation() {
|
||||
|
||||
@@ -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.
|
||||
@@ -113,23 +113,19 @@ public class IdeaJdkConfigurable implements AdditionalDataConfigurable {
|
||||
JPanel wholePanel = new JPanel(new GridBagLayout());
|
||||
wholePanel.add(mySandboxHomeLabel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0.0, 1.0, GridBagConstraints.WEST,
|
||||
GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
|
||||
wholePanel.add(GuiUtils.constructFieldWithBrowseButton(mySandboxHome,
|
||||
new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
FileChooserDescriptor descriptor = FileChooserDescriptorFactory
|
||||
.createSingleFolderDescriptor();
|
||||
descriptor.setTitle(DevKitBundle.message("sandbox.home"));
|
||||
descriptor.setDescription(
|
||||
DevKitBundle.message("sandbox.purpose"));
|
||||
VirtualFile file = FileChooser.chooseFile(mySandboxHome, descriptor, null);
|
||||
if (file != null) {
|
||||
mySandboxHome.setText(FileUtil.toSystemDependentName(file.getPath()));
|
||||
}
|
||||
myModified = true;
|
||||
}
|
||||
}),
|
||||
new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 1.0, 1.0, GridBagConstraints.EAST,
|
||||
GridBagConstraints.HORIZONTAL, new Insets(0, 30, 0, 0), 0, 0));
|
||||
wholePanel.add(GuiUtils.constructFieldWithBrowseButton(mySandboxHome, new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
|
||||
descriptor.setTitle(DevKitBundle.message("sandbox.home"));
|
||||
descriptor.setDescription(DevKitBundle.message("sandbox.purpose"));
|
||||
VirtualFile file = FileChooser.chooseFile(descriptor, mySandboxHome, null, null);
|
||||
if (file != null) {
|
||||
mySandboxHome.setText(FileUtil.toSystemDependentName(file.getPath()));
|
||||
}
|
||||
myModified = true;
|
||||
}
|
||||
}), new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 1.0, 1.0, GridBagConstraints.EAST,
|
||||
GridBagConstraints.HORIZONTAL, new Insets(0, 30, 0, 0), 0, 0));
|
||||
|
||||
wholePanel.add(myInternalJreLabel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0, 1, GridBagConstraints.WEST,
|
||||
GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user