public void updateDataModel() {
   MavenImportingSettings settings = getImportingSettings();
   myImportingSettingsForm.getData(settings);
   if (getWizardContext().isCreatingNewProject()) {
     myImportingSettingsForm.updateData(getWizardContext());
   }
   suggestProjectNameAndPath(settings.getDedicatedModuleDir(), myRootPathComponent.getPath());
 }
  public MavenProjectImportStep(WizardContext wizardContext) {
    super(wizardContext);

    myImportingSettingsForm =
        new MavenImportingSettingsForm(true, wizardContext.isCreatingNewProject()) {
          public String getDefaultModuleDir() {
            return myRootPathComponent.getPath();
          }
        };

    myRootPathComponent =
        new NamePathComponent(
            "",
            ProjectBundle.message("maven.import.label.select.root"),
            ProjectBundle.message("maven.import.title.select.root"),
            "",
            false,
            false);

    JButton envSettingsButton =
        new JButton(ProjectBundle.message("maven.import.environment.settings"));
    envSettingsButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            ShowSettingsUtil.getInstance()
                .editConfigurable(myPanel, new MavenEnvironmentConfigurable());
          }
        });

    myPanel = new JPanel(new GridBagLayout());
    myPanel.setBorder(BorderFactory.createEtchedBorder());

    GridBagConstraints c = new GridBagConstraints();
    c.gridx = 0;
    c.gridy = 0;
    c.weightx = 1;
    c.fill = GridBagConstraints.HORIZONTAL;
    c.insets = JBUI.insets(4, 4, 0, 4);

    myPanel.add(myRootPathComponent, c);

    c.gridy = 1;
    c.insets = JBUI.insets(4, 4, 0, 4);
    myPanel.add(myImportingSettingsForm.createComponent(), c);

    c.gridy = 2;
    c.fill = GridBagConstraints.NONE;
    c.anchor = GridBagConstraints.NORTHEAST;
    c.weighty = 1;
    c.insets = JBUI.insets(4 + envSettingsButton.getPreferredSize().height, 4, 4, 4);
    myPanel.add(envSettingsButton, c);

    myRootPathComponent.setNameComponentVisible(false);
  }
 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());
 }