IDEA-125693 Creating a project in dir '~/Desktop/test' creates the project in the dir '/Applications/IntelliJ IDEA 13 CE.app/bin/test'

This commit is contained in:
Dmitry Avdeev
2014-05-30 18:04:19 +04:00
parent ae7d190059
commit 13986db9a6
3 changed files with 10 additions and 1 deletions
@@ -88,6 +88,7 @@ public class ProjectSettingsStep extends ModuleWizardStep implements SettingsSte
myFormatPanel = new ProjectFormatPanel();
myNamePathComponent = NamePathComponent.initNamePathComponent(context);
myNamePathComponent.setShouldBeAbsolute(true);
if (context.isCreatingNewProject()) {
mySettingsPanel.add(myNamePathComponent, BorderLayout.NORTH);
addExpertPanel(myModulePanel);
@@ -59,6 +59,7 @@ public class NamePathComponent extends JPanel{
private JLabel myNameLabel;
private JLabel myPathLabel;
private boolean myForceSync;
private boolean myShouldBeAbsolute;
public NamePathComponent(String nameLabelText, String pathLabelText, char nameMnemonic, char locationMnemonic, final String pathChooserTitle, final String pathChooserDescription) {
this(nameLabelText, pathLabelText, pathChooserTitle, pathChooserDescription, true);
@@ -159,7 +160,9 @@ public class NamePathComponent extends JPanel{
if (projectFileDirectory.length() == 0) {
throw new ConfigurationException(IdeBundle.message("prompt.enter.project.file.location", context.getPresentationName()));
}
if (myShouldBeAbsolute && !new File(projectFileDirectory).isAbsolute()) {
throw new ConfigurationException(StringUtil.capitalize(IdeBundle.message("file.location.should.be.absolute", context.getPresentationName())));
}
final boolean shouldPromptCreation = isPathChangedByUser();
if (!ProjectWizardUtil
.createDirectoryIfNotExists(IdeBundle.message("directory.project.file.directory", context.getPresentationName()),
@@ -297,6 +300,10 @@ public class NamePathComponent extends JPanel{
myTfPath.getDocument().addDocumentListener(adapter);
}
public void setShouldBeAbsolute(boolean shouldBeAbsolute) {
myShouldBeAbsolute = shouldBeAbsolute;
}
private class NameFieldDocument extends PlainDocument {
public NameFieldDocument() {
addDocumentListener(new DocumentAdapter() {
@@ -764,6 +764,7 @@ progress.searching.for.sources=Searching for sources in {0}. Please wait.
prompt.select.source.directory=Select Source Directory
prompt.new.project.file.name=Enter a file name to create a new {0} {1}
prompt.enter.project.file.location=Enter {0} file location
file.location.should.be.absolute={0} location path should be absolute
directory.project.file.directory=The {0} file directory\n
prompt.overwrite.project.file=The {1} file \n''{0}''\nalready exists.\nWould you like to overwrite it?
prompt.overwrite.project.folder={0} folder already exists in {1}.\nIts content may be overwritten.\nContinue?