@Override
  public void addPages() {
    WizardPage newProjectCreationPage =
        newProjectCreationPage("NewProjectCreationPage"); // $NON-NLS-1$

    newProjectCreationPage.setTitle(UIPlugin.getLocalString(getWizardPageTitleKey()));
    newProjectCreationPage.setDescription(UIPlugin.getLocalString(getWizardPageDescriptionKey()));

    addPage(newProjectCreationPage);
  }
 @Override
 public boolean validateDestinationGroup() {
   if ("".equals(passwordField.getText())) {
     setErrorMessage(UIPlugin.getLocalString("_UI_EnterPassword"));
     return false;
   }
   return super.validateDestinationGroup();
 }
 public ModuleExportToForgeWizardPage(IStructuredSelection selection) {
   this("moduleExportToForge", selection); // $NON-NLS-1$
   setTitle(UIPlugin.getLocalString("_UI_ExportModulesToForge"));
   setDescription(UIPlugin.getLocalString("_UI_ExportModulesToForge_desc"));
 }
 @Override
 public void init(IWorkbench workbench, IStructuredSelection selection) {
   setDefaultPageImageDescriptor(
       UIPlugin.getImageDesc("full/wizban/NewPuppetProject.png")); // $NON-NLS-1$
   setWindowTitle(UIPlugin.getLocalString(getWizardWindowTitleKey()));
 }
  @Override
  public boolean performFinish() {
    try {
      project = null;
      getContainer()
          .run(
              false,
              false,
              new WorkspaceModifyOperation() {

                @Override
                protected void execute(IProgressMonitor progressMonitor)
                    throws InvocationTargetException {
                  SubMonitor monitor = SubMonitor.convert(progressMonitor, 100);
                  try {
                    String projectName = projectContainer.segment(0);
                    if (projectLocation == null)
                      projectLocation =
                          ResourcesPlugin.getWorkspace()
                              .getRoot()
                              .getLocation()
                              .append(projectName);
                    File projectDir = projectLocation.toFile();
                    if (projectDir.exists() && !mayHaveExistingContents()) {
                      if (!MessageDialog.openConfirm(
                          getShell(),
                          UIPlugin.getLocalString("_UI_Confirm_Overwrite"),
                          UIPlugin.getLocalString(
                              "_UI_Directory_not_empty", projectDir.getAbsolutePath())))
                        // User don't want us to overwrite
                        return;

                      FileUtils.rmR(projectDir);
                    }

                    project =
                        ResourceUtil.createProject(
                            projectContainer,
                            URI.createFileURI(projectDir.getAbsolutePath()),
                            Collections.<IProject>emptyList(),
                            monitor.newChild(1));

                    initializeProjectContents(monitor.newChild(80));
                  } catch (Exception exception) {
                    throw new InvocationTargetException(exception);
                  } finally {
                    progressMonitor.done();
                  }
                }
              });
      return project != null;
    } catch (InvocationTargetException e) {
      Throwable t = e.getTargetException();
      String title = UIPlugin.getLocalString("_UI_CreateProject_title");
      if (t instanceof PartInitException)
        DialogUtil.openError(getShell(), title, t.getMessage(), (PartInitException) t);
      else if (t instanceof CoreException)
        ErrorDialog.openError(getShell(), title, t.getMessage(), ((CoreException) t).getStatus());
      else MessageDialog.openError(getShell(), title, t.getMessage());
    } catch (InterruptedException e) {
    }
    return false;
  }