예제 #1
0
 /** @see org.eclipse.jface.wizard.IWizard#addPages() */
 public void addPages() {
   super.addPages();
   mainPage = new Page(); // $NON-NLS-1$
   mainPage.setTitle("New Clojure " + kind(false));
   mainPage.setDescription("Create new top-level Clojure " + kind(true));
   addPage(mainPage);
 }
  /*
   * (non-Javadoc)
   *
   * @see org.eclipse.jface.wizard.Wizard#addPages()
   */
  @Override
  public void addPages() {
    super.addPages();
    mainPage = new NewConfigFileCreationWizardPage(getSelection(), this);
    addPage(mainPage);

    optionsPage = new NewConfigFileOptionsWizardPage();
    addPage(optionsPage);
  }
예제 #3
0
  /**
   * Add pages to the wizard.<br>
   * By default, we don't add the reference page to the base Web Project (subclasses may override).
   *
   * @see org.eclipse.jface.wizard.Wizard#addPages()
   */
  @Override
  public void addPages() {
    super.addPages();

    TemplateType[] templateTypes = getProjectTemplateTypes();
    validateProjectTemplate(templateTypes);

    LinkedHashMap<String, IStepIndicatorWizardPage> stepPages =
        new LinkedHashMap<String, IStepIndicatorWizardPage>();

    // Add the template selection page
    List<IProjectTemplate> templates =
        ProjectsPlugin.getDefault().getTemplatesManager().getTemplates(templateTypes);
    if (hasNonDefaultTemplates(templates) && selectedTemplate == null) {
      addPage(
          templatesPage =
              new ProjectTemplateSelectionPage(TEMPLATE_SELECTION_PAGE_NAME, templates));
      stepPages.put(templatesPage.getStepName(), templatesPage);
    }

    // Add the main page where we set up the project name/location
    addPage(mainPage = createMainPage());
    if (mainPage instanceof IStepIndicatorWizardPage) {
      stepPages.put(
          ((IStepIndicatorWizardPage) mainPage).getStepName(), (IStepIndicatorWizardPage) mainPage);
    }

    // Add contributed pages
    ProjectWizardContributionManager projectWizardContributionManager =
        ProjectsPlugin.getDefault().getProjectWizardContributionManager();
    IWizardPage[] extraPages =
        projectWizardContributionManager.createPages(data, getProjectNatures());
    if (!ArrayUtil.isEmpty(extraPages)) {
      for (IWizardPage page : extraPages) {
        addPage(page);
        if (page instanceof IStepIndicatorWizardPage) {
          stepPages.put(
              ((IStepIndicatorWizardPage) page).getStepName(), (IStepIndicatorWizardPage) page);
        }
      }
    }

    // Set up the steps
    stepNames = stepPages.keySet().toArray(new String[stepPages.size()]);
    if (stepNames.length > 1) {
      for (IStepIndicatorWizardPage page : stepPages.values()) {
        page.initStepIndicator(stepNames);
      }
    }

    // Finalize pages using contributors
    projectWizardContributionManager.finalizeWizardPages(getPages(), getProjectNatures());
  }
  @Override
  public void addPages() {
    super.addPages();

    mainPage =
        new WizardNewProjectCreationPage("basicNewProjectPage") // $NON-NLS-1$
        {

          @Override
          public void createControl(Composite parent) {
            super.createControl(parent);
            validatePage();
          }

          @Override
          protected boolean validatePage() {
            boolean valid = super.validatePage();
            if (!valid) {
              return false;
            }

            // Check if there's already a directory/files at the destination
            IPath location = getLocationPath();
            if (useDefaults()) {
              // needs to append the project name since getLocationPath() returns the workspace path
              // in this case
              location = location.append(getProjectName());
            }

            File file = location.toFile();
            if (file.exists()) {
              setMessage(Messages.NewSampleProjectWizard_LocationExistsMessage, WARNING);
              return true;
            }

            setErrorMessage(null);
            setMessage(null);
            return true;
          }
        };
    mainPage.setTitle(Messages.NewSampleProjectWizard_ProjectPage_Title);
    mainPage.setDescription(Messages.NewSampleProjectWizard_ProjectPage_Description);
    addPage(mainPage);

    String name = sample.getName();
    if (name != null) {
      mainPage.setInitialProjectName(name);
    }
  }