/** Finish has been pressed. */
  @SuppressWarnings("deprecation")
  public void transferStateToConfig() {
    String seamRuntimeName = jBossSeamHomeEditor.getValueAsString();
    SeamRuntime seamRuntime = SeamRuntimeManager.getInstance().findRuntimeByName(seamRuntimeName);
    if (seamRuntime != null) {
      SeamRuntimeManager.getInstance().setDefaultRuntime(seamRuntime);
    }

    if (connProfileSelEditor != null) {
      SeamCorePlugin.getDefault()
          .getPluginPreferences()
          .setValue(
              SeamProjectPreferences.SEAM_DEFAULT_CONNECTION_PROFILE,
              connProfileSelEditor.getValueAsString());
    } else {
      SeamCorePlugin.getDefault()
          .getPluginPreferences()
          .setValue(
              SeamProjectPreferences.SEAM_DEFAULT_CONNECTION_PROFILE, getJpaConnectionProfile());
      model.setStringProperty(
          ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE, getJpaConnectionProfile());
    }

    if (jBossHibernateDbTypeEditor != null) {
      SeamCorePlugin.getDefault()
          .getPluginPreferences()
          .setValue(
              SeamProjectPreferences.HIBERNATE_DEFAULT_DB_TYPE,
              this.jBossHibernateDbTypeEditor.getValueAsString());
    }

    SeamCorePlugin.getDefault()
        .getPluginPreferences()
        .setValue(
            SeamProjectPreferences.JBOSS_AS_DEFAULT_DEPLOY_AS,
            this.jBossAsDeployAsEditor.getValueAsString());

    model.setBooleanProperty(
        ISeamFacetDataModelProperties.SEAM_TEMPLATES_AND_LIBRARIES_COPYING,
        isSeamProjectWizard() || isWebProjectWizard());

    model.setBooleanProperty(
        ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING,
        libraryListEditor
                .getValueAsString()
                .equals(SeamCoreMessages.SEAM_INSTALL_WIZARD_PAGE_COPY_LIBRARIES)
            && (isSeamProjectWizard() || isWebProjectWizard()));
  }
  /*
   * Fills Code Generation group with the default package names.
   */
  private void setCodeGenerationProperties() {
    String seamProjectName =
        model.getStringProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME);

    if (seamProjectName == null) return;

    if ("".equals(sessionBeanPkgNameditor.getValueAsString()))
      sessionBeanPkgNameditor.setValue(getSessionPkgName(seamProjectName));

    if ("".equals(entityBeanPkgNameditor.getValueAsString()))
      entityBeanPkgNameditor.setValue(getEntityPkgName(seamProjectName));

    if ("".equals(testsPkgNameditor.getValueAsString()))
      testsPkgNameditor.setValue(getTestPkgName(seamProjectName));

    if (!isWebProjectWizard()) {
      if ("".equals(ejbProjectNameditor.getValueAsString()))
        ejbProjectNameditor.setValue(getEJBProjectName(seamProjectName));

      if ("".equals(earProjectNameditor.getValueAsString()))
        earProjectNameditor.setValue(getEARProjectName(seamProjectName));
    }

    if ("".equals(testProjectNameditor.getValueAsString()))
      testProjectNameditor.setValue(getTestProjectName(seamProjectName));
  }
 private boolean canTestProjectBeCreated() {
   if (isSeamProjectWizard()) {
     String seamRuntimeName = jBossSeamHomeEditor.getValueAsString();
     SeamRuntime seamRuntime = SeamRuntimeManager.getInstance().findRuntimeByName(seamRuntimeName);
     if (seamRuntime != null) {
       // bootstrap folder was removed in Seam 2.3.0.Beta1 from WFK 2.0 ER4
       // See https://issues.jboss.org/browse/JBIDE-11611
       File bootstrap = new File(seamRuntime.getHomeDir(), "bootstrap");
       return bootstrap.exists();
     }
   }
   return false;
 }
  public void propertyChanged(DataModelEvent event) {
    if (event.getPropertyName().equals(IJ2EEModuleFacetInstallDataModelProperties.CONFIG_FOLDER)) {
      model.setStringProperty(
          ISeamFacetDataModelProperties.WEB_CONTENTS_FOLDER, event.getProperty().toString());
    } else if (event.getPropertyName().equals(IFacetDataModelProperties.FACET_PROJECT_NAME)) {
      String seamProjectName = event.getProperty().toString();

      model.setStringProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME, seamProjectName);

      sessionBeanPkgNameditor.setValue(getSessionPkgName(seamProjectName));
      entityBeanPkgNameditor.setValue(getEntityPkgName(seamProjectName));
      testsPkgNameditor.setValue(getTestPkgName(seamProjectName));
      if (!isWebProjectWizard()) {
        ejbProjectNameditor.setValue(getEJBProjectName(seamProjectName));
        earProjectNameditor.setValue(getEARProjectName(seamProjectName));
      }
      testProjectNameditor.setValue(getTestProjectName(seamProjectName));

      model.setStringProperty(
          ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME,
          getSessionPkgName(seamProjectName));
      model.setStringProperty(
          ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME,
          getEntityPkgName(seamProjectName));
      model.setProperty(
          ISeamFacetDataModelProperties.TEST_PROJECT_CREATING,
          createTestProjectCheckboxeditor.getValue());
      model.setStringProperty(
          ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME, getTestPkgName(seamProjectName));
      model.setStringProperty(
          ISeamFacetDataModelProperties.SEAM_EAR_PROJECT, earProjectNameditor.getValueAsString());
      model.setStringProperty(
          ISeamFacetDataModelProperties.SEAM_EJB_PROJECT, ejbProjectNameditor.getValueAsString());
      model.setStringProperty(
          ISeamFacetDataModelProperties.SEAM_TEST_PROJECT, testProjectNameditor.getValueAsString());
    }
  }
 /*
  * test method
  */
 public String getTestsPkgName() {
   return testsPkgNameditor.getValueAsString();
 }
 /*
  * test method
  */
 public String getEntityBeanPkgName() {
   return entityBeanPkgNameditor.getValueAsString();
 }
 /*
  * test method
  */
 public String getSessionBeanPkgName() {
   return sessionBeanPkgNameditor.getValueAsString();
 }