コード例 #1
0
  public boolean generate() {
    try {
      final Map overwrites = promptForOverwrite(plugins, locales);

      container.run(
          false,
          false,
          new IRunnableWithProgress() {
            public void run(IProgressMonitor monitor)
                throws InvocationTargetException, InterruptedException {
              setProgressMonitor(monitor);
              try {
                internationalizePlugins(plugins, locales, overwrites);
              } catch (final Exception ex) {
                Display.getDefault()
                    .syncExec(
                        new Runnable() {
                          public void run() {
                            PDEPlugin.logException(
                                ex,
                                ex.getMessage(),
                                PDEUIMessages
                                    .InternationalizeWizard_NLSFragmentGenerator_errorMessage);
                          }
                        });
              }
            }
          });
    } catch (Exception e) {
      PDEPlugin.logException(e);
    }
    return true;
  }
コード例 #2
0
ファイル: GitCloneWizard.java プロジェクト: abhishekbh/egit
 /** @param container */
 public void runCloneOperation(IWizardContainer container) {
   try {
     container.run(
         true,
         true,
         new IRunnableWithProgress() {
           public void run(IProgressMonitor monitor)
               throws InvocationTargetException, InterruptedException {
             executeCloneOperation(cloneOperation, monitor);
           }
         });
   } catch (InvocationTargetException e) {
     Activator.handleError(UIText.GitCloneWizard_failed, e.getCause(), true);
   } catch (InterruptedException e) {
     // nothing to do
   }
 }
コード例 #3
0
  /**
   * {@inheritDoc}
   *
   * @see org.eclipse.jface.wizard.Wizard#performFinish()
   */
  @Override
  public boolean performFinish() {
    try {
      IWizardContainer iWizardContainer = this.getContainer();

      IRunnableWithProgress projectCreation =
          new IRunnableWithProgress() {
            public void run(IProgressMonitor monitor) {
              createProject(monitor);
            }
          };
      iWizardContainer.run(false, false, projectCreation);

      // Update the perspective.
      BasicNewProjectResourceWizard.updatePerspective(this.configurationElement);
      return true;
    } catch (InvocationTargetException e) {
      AcceleoUIActivator.log(e, true);
    } catch (InterruptedException e) {
      AcceleoUIActivator.log(e, true);
    }
    return false;
  }