private static NamePathComponent initNamePathComponent(WizardContext context) { NamePathComponent component = new NamePathComponent( IdeBundle.message("label.project.name"), IdeBundle.message("label.project.files.location"), IdeBundle.message( "title.select.project.file.directory", IdeBundle.message("project.new.wizard.project.identification")), IdeBundle.message( "description.select.project.file.directory", StringUtil.capitalize( IdeBundle.message("project.new.wizard.project.identification"))), true, false); final String baseDir = context.getProjectFileDirectory(); final String projectName = context.getProjectName(); final String initialProjectName = projectName != null ? projectName : ProjectWizardUtil.findNonExistingFileName(baseDir, "untitled", ""); component.setPath( projectName == null ? (baseDir + File.separator + initialProjectName) : baseDir); component.setNameValue(initialProjectName); component.getNameComponent().select(0, initialProjectName.length()); return component; }
public void updateStep() { if (!myRootPathComponent.isPathChangedByUser()) { final VirtualFile rootDirectory = getBuilder().getRootDirectory(); final String path; if (rootDirectory != null) { path = rootDirectory.getPath(); } else { path = getWizardContext().getProjectFileDirectory(); } myRootPathComponent.setPath(FileUtil.toSystemDependentName(path)); myRootPathComponent.getPathComponent().selectAll(); } myImportingSettingsForm.setData(getImportingSettings()); }