From c3b3603256ecb90cf4ab56b12cb97d839cabbe5f Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Tue, 22 May 2012 18:56:04 +0400 Subject: [PATCH] Use constant --- .../com/intellij/ide/impl/NewProjectUtil.java | 6 ++--- .../newProjectWizard/ProjectNameStep.java | 5 ++-- .../util/projectWizard/ProjectNameStep.java | 15 +++++------ .../checkout/ProjectDirCheckoutListener.java | 26 ++++++++++++++----- .../ProjectOpenProcessorBase.java | 4 +-- .../intellij/openapi/project/ProjectUtil.java | 5 ++-- .../codeEditor/printing/PrintManager.java | 7 +++-- .../impl/ConversionContextImpl.java | 5 ++-- .../actions/ModuleDeleteProvider.java | 3 ++- .../PlatformProjectViewStructureProvider.java | 4 +-- .../ide/RecentProjectsManagerBase.java | 5 ++-- .../com/intellij/ide/impl/ProjectUtil.java | 7 ++--- .../impl/stores/ProjectStoreImpl.java | 2 +- .../PlatformProjectOpenProcessor.java | 5 ++-- .../src/messages/VcsBundle.properties | 2 +- .../com/intellij/core/CoreProjectLoader.java | 4 +-- .../impl/ModulePathMacroManager.java | 3 ++- .../plugins/github/GithubShareAction.java | 17 +++++++++++- 18 files changed, 79 insertions(+), 46 deletions(-) diff --git a/java/idea-ui/src/com/intellij/ide/impl/NewProjectUtil.java b/java/idea-ui/src/com/intellij/ide/impl/NewProjectUtil.java index 5bb0502d480b..31c8b4da9b64 100644 --- a/java/idea-ui/src/com/intellij/ide/impl/NewProjectUtil.java +++ b/java/idea-ui/src/com/intellij/ide/impl/NewProjectUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -79,12 +79,12 @@ public class NewProjectUtil { try { if (StorageScheme.DIRECTORY_BASED == dialog.getStorageScheme()) { - final File ideaDir = new File(projectFilePath + File.separator + ".idea"); + final File ideaDir = new File(projectFilePath, Project.DIRECTORY_STORE_FOLDER); if (!ideaDir.exists() && !ideaDir.mkdirs()) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { - Messages.showErrorDialog("Unable to create '.idea' directory at: " + projectFilePath, "Project initialization failed"); + Messages.showErrorDialog("Unable to create '.idea' directory at: " + projectFilePath, "Project Initialization Failed"); } }); diff --git a/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/ProjectNameStep.java b/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/ProjectNameStep.java index cadc59d215f2..d3762a8d0903 100644 --- a/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/ProjectNameStep.java +++ b/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/ProjectNameStep.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import com.intellij.ide.util.projectWizard.importSources.impl.ProjectFromSources import com.intellij.openapi.application.ApplicationInfo; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.options.ConfigurationException; +import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.Messages; import com.intellij.openapi.util.text.StringUtil; import com.intellij.projectImport.ProjectFormatPanel; @@ -111,7 +112,7 @@ public class ProjectNameStep extends ModuleWizardStep { return getProjectFileDirectory() + "/" + myNamePathComponent.getNameValue() + ProjectFileType.DOT_DEFAULT_EXTENSION; } else { - return getProjectFileDirectory() + "/" + ".idea"; + return getProjectFileDirectory() + "/" + Project.DIRECTORY_STORE_FOLDER; } } else { diff --git a/java/idea-ui/src/com/intellij/ide/util/projectWizard/ProjectNameStep.java b/java/idea-ui/src/com/intellij/ide/util/projectWizard/ProjectNameStep.java index e5c2be752ee5..4ceaff1e3615 100644 --- a/java/idea-ui/src/com/intellij/ide/util/projectWizard/ProjectNameStep.java +++ b/java/idea-ui/src/com/intellij/ide/util/projectWizard/ProjectNameStep.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ import com.intellij.ide.highlighter.ProjectFileType; import com.intellij.openapi.application.ApplicationInfo; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.options.ConfigurationException; -import com.intellij.openapi.project.ProjectUtil; +import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.Messages; import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.text.StringUtil; @@ -118,18 +118,17 @@ public class ProjectNameStep extends ModuleWizardStep { boolean shouldContinue = true; final String path = myWizardContext.isCreatingNewProject() && myWizardContext.getProjectStorageFormat() == DIRECTORY_BASED - ? getProjectFileDirectory() + "/" + ProjectUtil.DIRECTORY_BASED_PROJECT_DIR - : getProjectFilePath(); + ? getProjectFileDirectory() + "/" + Project.DIRECTORY_STORE_FOLDER : getProjectFilePath(); final File projectFile = new File(path); if (projectFile.exists()) { final String title = myWizardContext.isCreatingNewProject() ? IdeBundle.message("title.new.project") : IdeBundle.message("title.add.module"); final String message = myWizardContext.isCreatingNewProject() && myWizardContext.getProjectStorageFormat() == DIRECTORY_BASED - ? IdeBundle.message("prompt.overwrite.project.folder", ProjectUtil.DIRECTORY_BASED_PROJECT_DIR, - projectFile.getParentFile().getAbsolutePath()) - : IdeBundle.message("prompt.overwrite.project.file", projectFile.getAbsolutePath(), - myWizardContext.getPresentationName()); + ? IdeBundle.message("prompt.overwrite.project.folder", + Project.DIRECTORY_STORE_FOLDER, projectFile.getParentFile().getAbsolutePath()) + : IdeBundle.message("prompt.overwrite.project.file", + projectFile.getAbsolutePath(), myWizardContext.getPresentationName()); int answer = Messages.showYesNoDialog(message, title, Messages.getQuestionIcon()); shouldContinue = answer == 0; } diff --git a/java/idea-ui/src/com/intellij/openapi/vcs/checkout/ProjectDirCheckoutListener.java b/java/idea-ui/src/com/intellij/openapi/vcs/checkout/ProjectDirCheckoutListener.java index 5dbf42c56ce3..4909d7657b50 100644 --- a/java/idea-ui/src/com/intellij/openapi/vcs/checkout/ProjectDirCheckoutListener.java +++ b/java/idea-ui/src/com/intellij/openapi/vcs/checkout/ProjectDirCheckoutListener.java @@ -1,3 +1,18 @@ +/* + * 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.vcs.checkout; import com.intellij.ide.impl.ProjectUtil; @@ -9,16 +24,15 @@ import java.io.File; /** * @author irengrig - * Date: 5/27/11 - * Time: 12:57 PM + * @since 5/27/11 */ public class ProjectDirCheckoutListener implements CheckoutListener { @Override public boolean processCheckedOutDirectory(Project project, File directory) { - if (new File(directory, ".idea").exists()) { - int rc = Messages - .showYesNoDialog(project, VcsBundle.message("checkout.open.project.dir.prompt", ProjectCheckoutListener.getProductNameWithArticle(), - directory.getPath()), VcsBundle.message("checkout.title"), Messages.getQuestionIcon()); + if (new File(directory, Project.DIRECTORY_STORE_FOLDER).exists()) { + String message = VcsBundle.message("checkout.open.project.dir.prompt", + ProjectCheckoutListener.getProductNameWithArticle(), directory.getPath()); + int rc = Messages.showYesNoDialog(project, message, VcsBundle.message("checkout.title"), Messages.getQuestionIcon()); if (rc == 0) { ProjectUtil.openProject(directory.getPath(), project, false); } diff --git a/java/idea-ui/src/com/intellij/projectImport/ProjectOpenProcessorBase.java b/java/idea-ui/src/com/intellij/projectImport/ProjectOpenProcessorBase.java index fc7bec2af9f1..7ede6a8a3f66 100644 --- a/java/idea-ui/src/com/intellij/projectImport/ProjectOpenProcessorBase.java +++ b/java/idea-ui/src/com/intellij/projectImport/ProjectOpenProcessorBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -151,7 +151,7 @@ public abstract class ProjectOpenProcessorBase e } wizardContext.setProjectJdk(jdk); - final String dotIdeaFilePath = wizardContext.getProjectFileDirectory() + File.separator + ".idea"; + final String dotIdeaFilePath = wizardContext.getProjectFileDirectory() + File.separator + Project.DIRECTORY_STORE_FOLDER; final String projectFilePath = wizardContext.getProjectFileDirectory() + File.separator + wizardContext.getProjectName() + ProjectFileType.DOT_DEFAULT_EXTENSION; diff --git a/platform/lang-api/src/com/intellij/openapi/project/ProjectUtil.java b/platform/lang-api/src/com/intellij/openapi/project/ProjectUtil.java index 189f0d112d1c..58155b2a8819 100644 --- a/platform/lang-api/src/com/intellij/openapi/project/ProjectUtil.java +++ b/platform/lang-api/src/com/intellij/openapi/project/ProjectUtil.java @@ -41,7 +41,8 @@ import javax.swing.*; * @author max */ public class ProjectUtil { - @NonNls public static final String DIRECTORY_BASED_PROJECT_DIR = ".idea"; + /** @deprecated use {@linkplain Project#DIRECTORY_STORE_FOLDER} (to remove in IDEA 13) */ + @SuppressWarnings("UnusedDeclaration") @NonNls public static final String DIRECTORY_BASED_PROJECT_DIR = Project.DIRECTORY_STORE_FOLDER; private ProjectUtil() { } @@ -129,7 +130,7 @@ public class ProjectUtil { public static boolean isProjectOrWorkspaceFile(final VirtualFile file, final FileType fileType) { if (fileType instanceof InternalFileType) return true; - return file.getPath().contains("/"+ DIRECTORY_BASED_PROJECT_DIR +"/"); + return file.getPath().contains("/"+ Project.DIRECTORY_STORE_FOLDER +"/"); } @NotNull diff --git a/platform/lang-impl/src/com/intellij/codeEditor/printing/PrintManager.java b/platform/lang-impl/src/com/intellij/codeEditor/printing/PrintManager.java index aa7faeb2a359..60cc1716b09b 100644 --- a/platform/lang-impl/src/com/intellij/codeEditor/printing/PrintManager.java +++ b/platform/lang-impl/src/com/intellij/codeEditor/printing/PrintManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,6 @@ import com.intellij.openapi.editor.highlighter.EditorHighlighter; import com.intellij.openapi.fileTypes.FileTypes; import com.intellij.openapi.progress.*; import com.intellij.openapi.project.Project; -import com.intellij.openapi.project.ProjectUtil; import com.intellij.psi.PsiDirectory; import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiElement; @@ -168,7 +167,7 @@ class PrintManager { if(isRecursive) { PsiDirectory[] directories = psiDirectory.getSubdirectories(); for (PsiDirectory directory : directories) { - if (!ProjectUtil.DIRECTORY_BASED_PROJECT_DIR.equals(directory.getName())) { + if (!Project.DIRECTORY_STORE_FOLDER.equals(directory.getName())) { addToPsiFileList(directory, filesList, isRecursive); } } @@ -199,7 +198,7 @@ class PrintManager { pageFormat.setOrientation(PageFormat.LANDSCAPE); paperWidth -= topMargin + bottomMargin; paperHeight -= leftMargin + rightMargin; - paper.setImageableArea(topMargin, rightMargin, paperWidth, paperHeight); + paper.setImageableArea(rightMargin, topMargin, paperWidth, paperHeight); } pageFormat.setPaper(paper); return pageFormat; diff --git a/platform/lang-impl/src/com/intellij/conversion/impl/ConversionContextImpl.java b/platform/lang-impl/src/com/intellij/conversion/impl/ConversionContextImpl.java index 182efd3e61f9..662f83029d90 100644 --- a/platform/lang-impl/src/com/intellij/conversion/impl/ConversionContextImpl.java +++ b/platform/lang-impl/src/com/intellij/conversion/impl/ConversionContextImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import com.intellij.openapi.components.ExpandMacroToPathMap; import com.intellij.openapi.components.StorageScheme; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.module.impl.ModuleManagerImpl; +import com.intellij.openapi.project.Project; import com.intellij.openapi.roots.impl.libraries.LibraryImpl; import com.intellij.openapi.roots.libraries.LibraryTablesRegistrar; import com.intellij.openapi.util.Condition; @@ -82,7 +83,7 @@ public class ConversionContextImpl implements ConversionContext { if (myProjectFile.isDirectory()) { myStorageScheme = StorageScheme.DIRECTORY_BASED; myProjectBaseDir = myProjectFile; - mySettingsBaseDir = new File(myProjectBaseDir.getAbsolutePath(), ".idea"); + mySettingsBaseDir = new File(myProjectBaseDir.getAbsolutePath(), Project.DIRECTORY_STORE_FOLDER); modulesFile = new File(mySettingsBaseDir, "modules.xml"); myWorkspaceFile = new File(mySettingsBaseDir, "workspace.xml"); } diff --git a/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/actions/ModuleDeleteProvider.java b/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/actions/ModuleDeleteProvider.java index 778fa7c4e0ee..1f1da6ee17a1 100644 --- a/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/actions/ModuleDeleteProvider.java +++ b/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/actions/ModuleDeleteProvider.java @@ -61,7 +61,8 @@ public class ModuleDeleteProvider implements DeleteProvider, TitledHandler { for (Module module : modules) { final File moduleFile = new File(module.getModuleFilePath()); final File projectFile = new File(module.getProject().getProjectFilePath()); - if (moduleFile.getParent().equals(projectFile.getParent()) && moduleFile.getParentFile().getName().equals(".idea")) { + if (moduleFile.getParent().equals(projectFile.getParent()) && + moduleFile.getParentFile().getName().equals(Project.DIRECTORY_STORE_FOLDER)) { return true; } } diff --git a/platform/lang-impl/src/com/intellij/platform/PlatformProjectViewStructureProvider.java b/platform/lang-impl/src/com/intellij/platform/PlatformProjectViewStructureProvider.java index f3fa3450af7d..bd2681310c9a 100644 --- a/platform/lang-impl/src/com/intellij/platform/PlatformProjectViewStructureProvider.java +++ b/platform/lang-impl/src/com/intellij/platform/PlatformProjectViewStructureProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,7 @@ public class PlatformProjectViewStructureProvider implements TreeStructureProvid for (AbstractTreeNode moduleChild : moduleChildren) { if (moduleChild instanceof PsiDirectoryNode) { final PsiDirectory value = ((PsiDirectoryNode)moduleChild).getValue(); - if (value.getName().equals(".idea") && Registry.is("projectView.hide.dot.idea")) { + if (value.getName().equals(Project.DIRECTORY_STORE_FOLDER) && Registry.is("projectView.hide.dot.idea")) { continue; } } diff --git a/platform/platform-impl/src/com/intellij/ide/RecentProjectsManagerBase.java b/platform/platform-impl/src/com/intellij/ide/RecentProjectsManagerBase.java index ceeec0f3c3e2..35fe31fb3443 100644 --- a/platform/platform-impl/src/com/intellij/ide/RecentProjectsManagerBase.java +++ b/platform/platform-impl/src/com/intellij/ide/RecentProjectsManagerBase.java @@ -24,7 +24,6 @@ import com.intellij.openapi.components.PersistentStateComponent; import com.intellij.openapi.project.Project; import com.intellij.openapi.project.ProjectManager; import com.intellij.openapi.project.ProjectManagerAdapter; -import com.intellij.openapi.project.ProjectUtil; import com.intellij.openapi.ui.Messages; import com.intellij.openapi.util.Ref; import com.intellij.openapi.util.SystemInfo; @@ -77,7 +76,7 @@ public abstract class RecentProjectsManagerBase implements PersistentStateCompon } if (myState.lastPath != null) { File lastFile = new File(myState.lastPath); - if (lastFile.isDirectory() && !new File(lastFile, ProjectUtil.DIRECTORY_BASED_PROJECT_DIR).exists()) { + if (lastFile.isDirectory() && !new File(lastFile, Project.DIRECTORY_STORE_FOLDER).exists()) { myState.lastPath = null; } } @@ -246,7 +245,7 @@ public abstract class RecentProjectsManagerBase implements PersistentStateCompon public static boolean isValidProjectPath(String projectPath) { final File file = new File(projectPath); - return file.exists() && (!file.isDirectory() || new File(file, ProjectUtil.DIRECTORY_BASED_PROJECT_DIR).exists()); + return file.exists() && (!file.isDirectory() || new File(file, Project.DIRECTORY_STORE_FOLDER).exists()); } private class MyProjectManagerListener extends ProjectManagerAdapter { diff --git a/platform/platform-impl/src/com/intellij/ide/impl/ProjectUtil.java b/platform/platform-impl/src/com/intellij/ide/impl/ProjectUtil.java index 8d1732e88c5a..c72131529adf 100644 --- a/platform/platform-impl/src/com/intellij/ide/impl/ProjectUtil.java +++ b/platform/platform-impl/src/com/intellij/ide/impl/ProjectUtil.java @@ -102,7 +102,7 @@ public class ProjectUtil { } if (path.endsWith(ProjectFileType.DOT_DEFAULT_EXTENSION) || - virtualFile.isDirectory() && virtualFile.findChild(com.intellij.openapi.project.ProjectUtil.DIRECTORY_BASED_PROJECT_DIR) != null) { + virtualFile.isDirectory() && virtualFile.findChild(Project.DIRECTORY_STORE_FOLDER) != null) { return openProject(path, projectToClose, forceOpenInNewFrame); } @@ -145,8 +145,9 @@ public class ProjectUtil { return null; } - if (file.isDirectory() && !new File(file, com.intellij.openapi.project.ProjectUtil.DIRECTORY_BASED_PROJECT_DIR).exists()) { - Messages.showErrorDialog(IdeBundle.message("error.project.file.does.not.exist", new File(file, com.intellij.openapi.project.ProjectUtil.DIRECTORY_BASED_PROJECT_DIR).getPath()), CommonBundle.getErrorTitle()); + if (file.isDirectory() && !new File(file, Project.DIRECTORY_STORE_FOLDER).exists()) { + String message = IdeBundle.message("error.project.file.does.not.exist", new File(file, Project.DIRECTORY_STORE_FOLDER).getPath()); + Messages.showErrorDialog(message, CommonBundle.getErrorTitle()); return null; } diff --git a/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/ProjectStoreImpl.java b/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/ProjectStoreImpl.java index 7c25f4a98211..d9d5059bd4a3 100644 --- a/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/ProjectStoreImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/ProjectStoreImpl.java @@ -285,7 +285,7 @@ class ProjectStoreImpl extends BaseFileConfigurableStoreImpl implements IProject final VirtualFile baseDir = getProjectBaseDir(); assert baseDir != null : "project file: " + getProjectFile(); - final VirtualFile ideaDir = baseDir.findChild(".idea"); + final VirtualFile ideaDir = baseDir.findChild(Project.DIRECTORY_STORE_FOLDER); if (ideaDir != null && ideaDir.isValid()) { final VirtualFile nameFile = ideaDir.findChild(".name"); if (nameFile != null && nameFile.isValid()) { diff --git a/platform/platform-impl/src/com/intellij/platform/PlatformProjectOpenProcessor.java b/platform/platform-impl/src/com/intellij/platform/PlatformProjectOpenProcessor.java index a7b06b60a032..5b931e46d00f 100644 --- a/platform/platform-impl/src/com/intellij/platform/PlatformProjectOpenProcessor.java +++ b/platform/platform-impl/src/com/intellij/platform/PlatformProjectOpenProcessor.java @@ -30,6 +30,7 @@ import com.intellij.openapi.project.impl.ProjectManagerImpl; import com.intellij.openapi.startup.StartupManager; import com.intellij.openapi.ui.DialogWrapper; import com.intellij.openapi.util.Ref; +import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.wm.ToolWindowManager; import com.intellij.projectImport.ProjectAttachProcessor; @@ -93,7 +94,7 @@ public class PlatformProjectOpenProcessor extends ProjectOpenProcessor { if (!baseDir.isDirectory()) { baseDir = virtualFile.getParent(); while (baseDir != null) { - if (new File(baseDir.getPath(), ".idea").exists()) { + if (new File(FileUtil.toSystemDependentName(baseDir.getPath()), Project.DIRECTORY_STORE_FOLDER).exists()) { break; } baseDir = baseDir.getParent(); @@ -103,7 +104,7 @@ public class PlatformProjectOpenProcessor extends ProjectOpenProcessor { } } - final File projectDir = new File(baseDir.getPath(), ".idea"); + final File projectDir = new File(FileUtil.toSystemDependentName(baseDir.getPath()), Project.DIRECTORY_STORE_FOLDER); Project[] openProjects = ProjectManager.getInstance().getOpenProjects(); if (!forceOpenInNewFrame && openProjects.length > 0) { diff --git a/platform/platform-resources-en/src/messages/VcsBundle.properties b/platform/platform-resources-en/src/messages/VcsBundle.properties index 335c78606e83..931c2770b753 100644 --- a/platform/platform-resources-en/src/messages/VcsBundle.properties +++ b/platform/platform-resources-en/src/messages/VcsBundle.properties @@ -405,7 +405,7 @@ show.diff.progress.title=Loading content... show.diff.progress.title.detailed=Loading content for {0} checkout.open.project.prompt=You have checked out {0} project file:\n{1}\nWould you like to open it? checkout.open.project.dir.prompt=You have checked out {0} project:\n{1}\nWould you like to open it? -checkout.title=Checkout from Version Control +checkout.title=Checkout From Version Control checkout.create.project.prompt=Would you like to create {0} project for the sources you have checked out to {1}? checkout.open.directory.prompt=Would you like to open the directory {0}? new.changelist.duplicate.name.error=A changelist with that name already exists diff --git a/platform/projectModel-impl/src/com/intellij/core/CoreProjectLoader.java b/platform/projectModel-impl/src/com/intellij/core/CoreProjectLoader.java index 4751b1f8811a..0aa2cd6bd96a 100644 --- a/platform/projectModel-impl/src/com/intellij/core/CoreProjectLoader.java +++ b/platform/projectModel-impl/src/com/intellij/core/CoreProjectLoader.java @@ -40,7 +40,7 @@ import java.io.IOException; */ public class CoreProjectLoader { public static void loadProject(MockProject project, @NotNull VirtualFile virtualFile) throws IOException, JDOMException { - if (virtualFile.isDirectory() && virtualFile.findChild(".idea") != null) { + if (virtualFile.isDirectory() && virtualFile.findChild(Project.DIRECTORY_STORE_FOLDER) != null) { project.setBaseDir(virtualFile); loadDirectoryProject(project, virtualFile); } @@ -51,7 +51,7 @@ public class CoreProjectLoader { } private static void loadDirectoryProject(Project project, VirtualFile projectDir) throws IOException, JDOMException { - VirtualFile dotIdea = projectDir.findChild(".idea"); + VirtualFile dotIdea = projectDir.findChild(Project.DIRECTORY_STORE_FOLDER); VirtualFile modulesXml = dotIdea.findChild("modules.xml"); StorageData storageData = loadStorageFile(project, modulesXml); final Element moduleManagerState = storageData.getState("ProjectModuleManager"); diff --git a/platform/projectModel-impl/src/com/intellij/openapi/components/impl/ModulePathMacroManager.java b/platform/projectModel-impl/src/com/intellij/openapi/components/impl/ModulePathMacroManager.java index 996b0711b5c1..64344d657826 100644 --- a/platform/projectModel-impl/src/com/intellij/openapi/components/impl/ModulePathMacroManager.java +++ b/platform/projectModel-impl/src/com/intellij/openapi/components/impl/ModulePathMacroManager.java @@ -21,6 +21,7 @@ import com.intellij.application.options.ReplacePathToMacroMap; import com.intellij.openapi.application.PathMacros; import com.intellij.openapi.components.ExpandMacroToPathMap; import com.intellij.openapi.module.Module; +import com.intellij.openapi.project.Project; import org.jetbrains.annotations.Nullable; import java.io.File; @@ -67,7 +68,7 @@ public class ModulePathMacroManager extends BasePathMacroManager { // rather than the .idea directory itself is considered the module root // (so that a Ruby IDE project doesn't break if its directory is moved together with the .idea directory) File moduleDirParent = moduleDirFile.getParentFile(); - if (moduleDirParent != null && moduleDirFile.getName().equals(".idea")) { + if (moduleDirParent != null && moduleDirFile.getName().equals(Project.DIRECTORY_STORE_FOLDER)) { moduleDirFile = moduleDirParent; } String moduleDir = moduleDirFile.getPath(); diff --git a/plugins/github/src/org/jetbrains/plugins/github/GithubShareAction.java b/plugins/github/src/org/jetbrains/plugins/github/GithubShareAction.java index d306f0b6e297..68ddeee657bf 100644 --- a/plugins/github/src/org/jetbrains/plugins/github/GithubShareAction.java +++ b/plugins/github/src/org/jetbrains/plugins/github/GithubShareAction.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.jetbrains.plugins.github; import com.intellij.notification.Notification; @@ -285,7 +300,7 @@ public class GithubShareAction extends DumbAwareAction { } for (VirtualFile file : changeListManager.getUnversionedFiles()) { - if (file.getPath().contains(".idea")) { + if (file.getPath().contains(Project.DIRECTORY_STORE_FOLDER)) { continue; } if (readmeFile != null && readmeFile.equals(file)) {