mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup
This commit is contained in:
+7
-9
@@ -22,7 +22,6 @@
|
||||
*/
|
||||
package com.intellij.openapi.roots.ui.configuration;
|
||||
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.ide.util.BrowseFilesListener;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
|
||||
@@ -30,7 +29,7 @@ import com.intellij.openapi.fileChooser.FileChooserFactory;
|
||||
import com.intellij.openapi.project.ProjectBundle;
|
||||
import com.intellij.openapi.roots.CompilerModuleExtension;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.ui.DocumentAdapter;
|
||||
import com.intellij.ui.FieldPanel;
|
||||
@@ -48,7 +47,6 @@ import java.awt.event.ActionListener;
|
||||
import java.io.IOException;
|
||||
|
||||
public class BuildElementsEditor extends ModuleElementsEditor {
|
||||
private static final Icon ICON = AllIcons.Modules.Output;
|
||||
private JRadioButton myInheritCompilerOutput;
|
||||
@SuppressWarnings({"FieldCanBeLocal"})
|
||||
private JRadioButton myPerModuleCompilerOutput;
|
||||
@@ -153,7 +151,7 @@ public class BuildElementsEditor extends ModuleElementsEditor {
|
||||
else {
|
||||
final String compilerOutputUrl = getCompilerExtension().getCompilerOutputUrl();
|
||||
if (compilerOutputUrl != null) {
|
||||
myOutputPathPanel.setText(FileUtil.toSystemDependentName(VfsUtil.urlToPath(compilerOutputUrl)));
|
||||
myOutputPathPanel.setText(FileUtil.toSystemDependentName(VfsUtilCore.urlToPath(compilerOutputUrl)));
|
||||
}
|
||||
}
|
||||
final VirtualFile testsOutputPath = getCompilerExtension().getCompilerOutputPathForTests();
|
||||
@@ -163,7 +161,7 @@ public class BuildElementsEditor extends ModuleElementsEditor {
|
||||
else {
|
||||
final String testsOutputUrl = getCompilerExtension().getCompilerOutputUrlForTests();
|
||||
if (testsOutputUrl != null) {
|
||||
myTestsOutputPathPanel.setText(FileUtil.toSystemDependentName(VfsUtil.urlToPath(testsOutputUrl)));
|
||||
myTestsOutputPathPanel.setText(FileUtil.toSystemDependentName(VfsUtilCore.urlToPath(testsOutputUrl)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -203,7 +201,7 @@ public class BuildElementsEditor extends ModuleElementsEditor {
|
||||
catch (IOException e) {
|
||||
canonicalPath = path;
|
||||
}
|
||||
commitPathRunnable.saveUrl(VfsUtil.pathToUrl(FileUtil.toSystemIndependentName(canonicalPath)));
|
||||
commitPathRunnable.saveUrl(VfsUtilCore.pathToUrl(FileUtil.toSystemIndependentName(canonicalPath)));
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -247,9 +245,9 @@ public class BuildElementsEditor extends ModuleElementsEditor {
|
||||
public void moduleCompileOutputChanged(final String baseUrl, final String moduleName) {
|
||||
if (getCompilerExtension().isCompilerOutputPathInherited()) {
|
||||
if (baseUrl != null) {
|
||||
myOutputPathPanel.setText(FileUtil.toSystemDependentName(VfsUtil.urlToPath(baseUrl + "/" + CompilerModuleExtension
|
||||
myOutputPathPanel.setText(FileUtil.toSystemDependentName(VfsUtilCore.urlToPath(baseUrl + "/" + CompilerModuleExtension
|
||||
.PRODUCTION + "/" + moduleName)));
|
||||
myTestsOutputPathPanel.setText(FileUtil.toSystemDependentName(VfsUtil.urlToPath(baseUrl + "/" + CompilerModuleExtension
|
||||
myTestsOutputPathPanel.setText(FileUtil.toSystemDependentName(VfsUtilCore.urlToPath(baseUrl + "/" + CompilerModuleExtension
|
||||
.TEST + "/" + moduleName)));
|
||||
}
|
||||
else {
|
||||
@@ -263,7 +261,7 @@ public class BuildElementsEditor extends ModuleElementsEditor {
|
||||
return getModel().getModuleExtension(CompilerModuleExtension.class);
|
||||
}
|
||||
|
||||
private static interface CommitPathRunnable {
|
||||
private interface CommitPathRunnable {
|
||||
void saveUrl(String url);
|
||||
}
|
||||
|
||||
|
||||
+6
-7
@@ -29,7 +29,6 @@ import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.module.ModifiableModuleModel;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.module.ModuleManager;
|
||||
import com.intellij.openapi.roots.impl.ModifiableModelCommitter;
|
||||
import com.intellij.openapi.options.ConfigurationException;
|
||||
import com.intellij.openapi.options.ShowSettingsUtil;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -38,7 +37,7 @@ import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.openapi.roots.ContentEntry;
|
||||
import com.intellij.openapi.roots.ModifiableRootModel;
|
||||
import com.intellij.openapi.roots.ModuleRootModel;
|
||||
import com.intellij.openapi.roots.impl.ProjectRootManagerImpl;
|
||||
import com.intellij.openapi.roots.impl.ModifiableModelCommitter;
|
||||
import com.intellij.openapi.roots.ui.configuration.actions.ModuleDeleteProvider;
|
||||
import com.intellij.openapi.roots.ui.configuration.projectRoot.ModuleStructureConfigurable;
|
||||
import com.intellij.openapi.roots.ui.configuration.projectRoot.ProjectSdksModel;
|
||||
@@ -48,11 +47,12 @@ import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.Computable;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.packaging.artifacts.Artifact;
|
||||
import com.intellij.packaging.artifacts.ModifiableArtifactModel;
|
||||
import com.intellij.projectImport.ProjectImportBuilder;
|
||||
import com.intellij.util.containers.HashMap;
|
||||
import com.intellij.util.graph.GraphGenerator;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -224,8 +224,8 @@ public class ModulesConfigurator implements ModulesProvider, ModuleEditor.Change
|
||||
|
||||
public void apply() throws ConfigurationException {
|
||||
// validate content and source roots
|
||||
final Map<VirtualFile, String> contentRootToModuleNameMap = new com.intellij.util.containers.HashMap<VirtualFile, String>();
|
||||
final Map<VirtualFile, VirtualFile> srcRootsToContentRootMap = new com.intellij.util.containers.HashMap<VirtualFile, VirtualFile>();
|
||||
final Map<VirtualFile, String> contentRootToModuleNameMap = new HashMap<VirtualFile, String>();
|
||||
final Map<VirtualFile, VirtualFile> srcRootsToContentRootMap = new HashMap<VirtualFile, VirtualFile>();
|
||||
for (final ModuleEditor moduleEditor : myModuleEditors) {
|
||||
final ModifiableRootModel rootModel = moduleEditor.getModifiableRootModel();
|
||||
final ContentEntry[] contents = rootModel.getContentEntries();
|
||||
@@ -246,7 +246,7 @@ public class ModulesConfigurator implements ModulesProvider, ModuleEditor.Change
|
||||
if (anotherContentRoot != null) {
|
||||
final String problematicModule;
|
||||
final String correctModule;
|
||||
if (VfsUtil.isAncestor(anotherContentRoot, contentRoot, true)) {
|
||||
if (VfsUtilCore.isAncestor(anotherContentRoot, contentRoot, true)) {
|
||||
problematicModule = contentRootToModuleNameMap.get(anotherContentRoot);
|
||||
correctModule = contentRootToModuleNameMap.get(contentRoot);
|
||||
}
|
||||
@@ -277,7 +277,6 @@ public class ModulesConfigurator implements ModulesProvider, ModuleEditor.Change
|
||||
}
|
||||
}
|
||||
|
||||
final ProjectRootManagerImpl projectRootManager = ProjectRootManagerImpl.getInstanceImpl(myProject);
|
||||
final List<ModifiableRootModel> models = new ArrayList<ModifiableRootModel>(myModuleEditors.size());
|
||||
for (ModuleEditor moduleEditor : myModuleEditors) {
|
||||
moduleEditor.canApply();
|
||||
|
||||
Reference in New Issue
Block a user