コード例 #1
0
 /**
  * {@inheritDoc}
  *
  * @see org.eclipse.jface.wizard.Wizard#canFinish()
  */
 @Override
 public boolean canFinish() {
   IWizardContainer iWizardContainer = this.getContainer();
   IWizardPage currentPage = iWizardContainer.getCurrentPage();
   if (currentPage instanceof WizardNewProjectCreationPage) {
     return newProjectPage.isPageComplete();
   }
   return newProjectPage.isPageComplete() && newAcceleoModulesCreationPage.isPageComplete();
 }
コード例 #2
0
 private void runInUI() {
   IWizard wizard = page.getWizard();
   if (wizard != null) {
     IWizardContainer container = wizard.getContainer();
     if (container != null) {
       page.setPageComplete(optionsStatus);
       container.updateButtons();
     }
   }
 }
コード例 #3
0
 private void worked() {
   Shell shell = container.getShell();
   Display display = shell.getDisplay();
   if (display != null && !shell.isDisposed()) {
     display.readAndDispatch();
   }
 }
コード例 #4
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;
  }
コード例 #5
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;
  }
コード例 #6
0
 /** @throws java.lang.Exception */
 @Before
 public void setUp() throws Exception {
   final BusinessObjectModelRepositoryStore store = mock(BusinessObjectModelRepositoryStore.class);
   when(store.getChildren()).thenReturn(Collections.singletonList(fileStore));
   final BusinessObjectData data =
       aBusinessData()
           .havingDataType(BusinessObjectDataTypeBuilder.aBusinessObjectDataType())
           .build();
   final Pool pool = aPool().build();
   pool.getData().add(data);
   wizardPageUnderTest =
       new BusinessObjectDataWizardPage(pool, data, store, newHashSet("data1"), hintImageProvider);
   doReturn(realmWithDisplay.createImage()).when(hintImageProvider).getHintImage();
   wizardPageUnderTest.setWizard(wizardWithContainer);
   when(wizardWithContainer.getContainer()).thenReturn(wizardContainer);
   when(wizardContainer.getShell()).thenReturn(realmWithDisplay.getShell());
 }
コード例 #7
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
   }
 }