Exemplo n.º 1
0
  /** User clicks Finish */
  @Override
  public boolean performFinish() {
    try {
      // Create file object
      IFile file = doCreateNew(new NullProgressMonitor());
      if (file == null) {
        // that's ok, as it just didn't create a file (but maybe a folder)...
        return true;
      }

      // Scroll to file in package explorer
      BasicNewResourceWizard.selectAndReveal(file, workbench.getActiveWorkbenchWindow());

      // Open editor on new file.
      IWorkbenchWindow dw = workbench.getActiveWorkbenchWindow();
      try {
        if (dw != null) {
          IWorkbenchPage page = dw.getActivePage();
          if (page != null) {
            IEditorPart openEditor = IDE.openEditor(page, file, true);
            afterEditorCreated(openEditor);
          }
        }
      } catch (PartInitException e) {
        Log.log(e);
        return false;
      }
    } catch (Exception e) {
      Log.log(e);
      return false;
    }
    return true;
  }
  /** Do the work after everything is specified. */
  @Override
  public boolean performFinish() {
    modelFile = newFileCreationPage.createNewFile();
    if (modelFile == null) {
      return false;
    }

    BasicNewResourceWizard.selectAndReveal(modelFile, workbench.getActiveWorkbenchWindow());

    return true;
  }
Exemplo n.º 3
0
  public boolean performFinish() {
    try {

      wizardPage.createType(null);
      IResource resource = wizardPage.getModifiedResource();
      BasicNewResourceWizard.selectAndReveal(resource, workbench.getActiveWorkbenchWindow());
      openResource((IFile) resource);
      BasicNewProjectResourceWizard.updatePerspective(config);

    } catch (Exception e) {
      Activator.logException(e);
      MessageDialog.openError(
          getShell(), "Error", "Error creating GWT Module. See log file for more details.");
    }
    return true;
  }
Exemplo n.º 4
0
  @Override
  protected void execute(final IProgressMonitor monitor)
      throws CoreException, InvocationTargetException, InterruptedException {
    SubMonitor subMonitor =
        SubMonitor.convert(monitor, getCreateModelProjectMessage(), getMonitorTicks());

    IProject project = createDslProject(subMonitor.newChild(1));
    createDslUiProject(subMonitor.newChild(1));

    if (getXtextProjectInfo().isCreateTestProject()) {
      createTestProject(subMonitor.newChild(1));
    }
    if (getXtextProjectInfo().isCreateFeatureProject()) {
      createFeatureProject(subMonitor.newChild(1));
    }

    IFile dslGrammarFile =
        project.getFile(getModelFolderName() + "/" + getXtextProjectInfo().getGrammarFilePath());
    BasicNewResourceWizard.selectAndReveal(
        dslGrammarFile, PlatformUI.getWorkbench().getActiveWorkbenchWindow());
    setResult(dslGrammarFile);
  }
  public boolean performFinish() {
    boolean result = true;
    mainPage.commit();

    context.setServletVersion("2.4"); // $NON-NLS-1$
    if (!context.isServletVersionConsistentToWebXML()) {
      context.setServletVersion("2.3"); // $NON-NLS-1$
    }

    IRunnableWithProgress op = new WorkspaceModifyDelegatingOperation(createOperation());
    try {
      getContainer().run(false, true, op);
    } catch (InvocationTargetException e) {
      WebUiPlugin.getPluginLog().logError(e);
    } catch (InterruptedException e) {
      WebUiPlugin.getPluginLog().logError(e);
    }
    updatePerspective();
    BasicNewResourceWizard.selectAndReveal(
        context.getProjectHandle(),
        ModelUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow());
    return result;
  }
Exemplo n.º 6
0
 protected void selectAndReveal(IResource newResource) {
   BasicNewResourceWizard.selectAndReveal(newResource, workbench.getActiveWorkbenchWindow());
 }
Exemplo n.º 7
0
 /**
  * Selects and reveals the newly added resource in all parts of the active workbench window's
  * active page.
  *
  * @see ISetSelectionTarget
  */
 public static void selectAndReveal(IResource newResource) {
   BasicNewResourceWizard.selectAndReveal(
       newResource, PlatformUI.getWorkbench().getActiveWorkbenchWindow());
 }
 private void openFile(IProgressMonitor monitor, IFile fileToOpen) {
   monitor.setTaskName("Opening file for editing...");
   BasicNewResourceWizard.selectAndReveal(
       fileToOpen, PlatformUI.getWorkbench().getActiveWorkbenchWindow());
   EclipseHelper.openFileToEdit(getShell(), fileToOpen);
 }