/** {@inheritDoc} */
 @Override
 public void repositoryAdded(CmrRepositoryDefinition cmrRepositoryDefinition) {
   cachedOnlineStatus.put(cmrRepositoryDefinition, cmrRepositoryDefinition.getOnlineStatus());
   SafeExecutor.asyncExec(
       new Runnable() {
         @Override
         public void run() {
           updateFormMenuManager();
         }
       },
       mainForm);
 }
  /** {@inheritDoc} */
  @Override
  public void repositoryDataUpdated(final CmrRepositoryDefinition cmrRepositoryDefinition) {
    SafeExecutor.asyncExec(
        new Runnable() {
          @Override
          public void run() {
            updateFormMenuManager();

            if (Objects.equals(displayedCmrRepositoryDefinition, cmrRepositoryDefinition)) {
              updateFormTitle();
            }
          }
        },
        mainForm);
  }
  /** {@inheritDoc} */
  @Override
  public void repositoryRemoved(final CmrRepositoryDefinition cmrRepositoryDefinition) {
    cachedOnlineStatus.remove(cmrRepositoryDefinition);
    SafeExecutor.asyncExec(
        new Runnable() {
          @Override
          public void run() {
            updateFormMenuManager();

            // if selected update
            if (Objects.equals(displayedCmrRepositoryDefinition, cmrRepositoryDefinition)) {
              selectDisplayedCmrRepositoryDefinition();
            }
          }
        },
        mainForm);
  }
 /**
  * Performs update.
  *
  * @param updateInput If the update should go to the CMRs for an updated list of profiles and
  *     environments.
  */
 private void performUpdate(final boolean updateInput) {
   if (updateInput) {
     updateProfilesAndEnvironments(
         new JobChangeAdapter() {
           @Override
           public void done(IJobChangeEvent event) {
             SafeExecutor.asyncExec(
                 new Runnable() {
                   @Override
                   public void run() {
                     mainForm.setBusy(true);
                     updateFormTitle();
                     updateFormMenuManager();
                     updateFormBody();
                     mainForm.setBusy(false);
                     mainForm.layout();
                   }
                 },
                 mainForm);
           }
         });
   } else {
     SafeExecutor.asyncExec(
         new Runnable() {
           @Override
           public void run() {
             mainForm.setBusy(true);
             updateFormTitle();
             updateFormMenuManager();
             updateFormBody();
             mainForm.setBusy(false);
             mainForm.layout();
           }
         },
         mainForm);
   }
 }