/** {@inheritDoc} */
  public boolean performOk() {
    try {
      if (!m_oldProjectName.equals(m_newProjectName)) {
        if (ProjectPM.doesProjectNameExist(m_newProjectName)) {

          ErrorHandlingUtil.createMessageDialog(
              MessageIDs.E_PROJECTNAME_ALREADY_EXISTS, new Object[] {m_newProjectName}, null);
          return false;
        }
      }
      if (m_isReusableCheckbox != null) {
        getProject().setIsReusable(m_isReusableCheckbox.getSelection());
      }
      if (m_isProtectedCheckbox != null) {
        getProject().setIsProtected(m_isProtectedCheckbox.getSelection());
      }
      storeAutoTestResultCleanup();

      if (!m_oldProjectName.equals(m_newProjectName)) {
        ProjectNameBP.getInstance()
            .setName(getEditSupport().getSession(), getProject().getGuid(), m_newProjectName);
      }
      fireOkPressed();
      Set<IReusedProjectPO> origReused =
          ((IProjectPropertiesPO) getEditSupport().getOriginal()).getUsedProjects();
      Set<IReusedProjectPO> newReused =
          new HashSet<IReusedProjectPO>(
              ((IProjectPropertiesPO) getEditSupport().getWorkVersion()).getUsedProjects());
      newReused.removeAll(origReused);
      getEditSupport().saveWorkVersion();
      refreshAutMainList();
      DataEventDispatcher.getInstance().fireProjectStateChanged(ProjectState.prop_modified);
      for (IReusedProjectPO reused : newReused) {
        try {
          IProjectPO reusedProject = ProjectPM.loadReusedProject(reused);
          if (reusedProject != null) {
            // incomplete database, see https://bxapps.bredex.de/bugzilla/show_bug.cgi?id=854
            ComponentNamesBP.getInstance().refreshNames(reusedProject.getId());
          }
        } catch (JBException e) {
          // Could not refresh Component Name information for
          // reused project. Log the exception.
          log.error(Messages.ErrorWhileRetrievingReusedProjectInformation, e);
        }
      }
      // FIXME zeb This updates the Test Case Browser. Once we have separate
      //           EditSupports for each property page, then we can use
      //           "real" ReusedProjectPOs instead of a placeholder.
      DataEventDispatcher.getInstance()
          .fireDataChangedListener(
              PoMaker.createReusedProjectPO("1", 1, 1), // $NON-NLS-1$
              DataState.ReuseChanged,
              UpdateState.notInEditor);
      DataEventDispatcher.getInstance()
          .fireDataChangedListener(
              GeneralStorage.getInstance().getProject(),
              DataState.Renamed,
              UpdateState.notInEditor);
      CompletenessBP.getInstance().completeProjectCheck();
    } catch (PMException e) {
      ErrorHandlingUtil.createMessageDialog(e, null, null);
    } catch (ProjectDeletedException e) {
      PMExceptionHandler.handleProjectDeletedException();
    } catch (IncompatibleTypeException ite) {
      ErrorHandlingUtil.createMessageDialog(ite, ite.getErrorMessageParams(), null);
    }

    return true;
  }
Esempio n. 2
0
 /**
  * @return The name of the referenced project, if it is available. Otherwise, <code>null</code>.
  */
 @Transient
 public String getProjectName() {
   return ProjectNameBP.getInstance().getName(getProjectGuid());
 }
Esempio n. 3
0
 /** {@inheritDoc} */
 public boolean performCancel() {
   m_newProject = null;
   Plugin.stopLongRunning();
   ProjectNameBP.getInstance().clearCache();
   return true;
 }