コード例 #1
0
  @Override
  public void addPages() {
    WizardPage newProjectCreationPage =
        newProjectCreationPage("NewProjectCreationPage"); // $NON-NLS-1$

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

    addPage(newProjectCreationPage);
  }
コード例 #2
0
 @Override
 public boolean validateDestinationGroup() {
   if ("".equals(passwordField.getText())) {
     setErrorMessage(UIPlugin.getLocalString("_UI_EnterPassword"));
     return false;
   }
   return super.validateDestinationGroup();
 }
コード例 #3
0
 public ModuleExportToForgeWizardPage(IStructuredSelection selection) {
   this("moduleExportToForge", selection); // $NON-NLS-1$
   setTitle(UIPlugin.getLocalString("_UI_ExportModulesToForge"));
   setDescription(UIPlugin.getLocalString("_UI_ExportModulesToForge_desc"));
 }
コード例 #4
0
 @Override
 public void init(IWorkbench workbench, IStructuredSelection selection) {
   setDefaultPageImageDescriptor(
       UIPlugin.getImageDesc("full/wizban/NewPuppetProject.png")); // $NON-NLS-1$
   setWindowTitle(UIPlugin.getLocalString(getWizardWindowTitleKey()));
 }
コード例 #5
0
  @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;
  }