Search in sources :

Example 1 with ProjectWizard

use of org.eclipse.che.ide.projecttype.wizard.ProjectWizard in project che by eclipse.

the class ProjectWizardPresenter method createDefaultWizard.

/** Creates and returns 'default' project wizard with pre-defined pages only. */
private ProjectWizard createDefaultWizard(@Nullable MutableProjectConfig dataObject, @NotNull ProjectWizardMode mode) {
    final ProjectWizard projectWizard = projectWizardFactory.newWizard(dataObject, mode);
    projectWizard.setUpdateDelegate(this);
    // add pre-defined pages - first and last
    projectWizard.addPage(categoriesPage);
    return projectWizard;
}
Also used : ProjectWizard(org.eclipse.che.ide.projecttype.wizard.ProjectWizard)

Example 2 with ProjectWizard

use of org.eclipse.che.ide.projecttype.wizard.ProjectWizard in project che by eclipse.

the class ProjectWizardPresenter method getWizardForProjectType.

/** Creates or returns project wizard for the specified projectType with the given dataObject. */
private ProjectWizard getWizardForProjectType(@NotNull ProjectTypeDto projectType, @NotNull MutableProjectConfig configDto) {
    if (wizardsCache.containsKey(projectType)) {
        return wizardsCache.get(projectType);
    }
    final ProjectWizardRegistrar wizardRegistrar = wizardRegistry.getWizardRegistrar(projectType.getId());
    if (wizardRegistrar == null) {
        // should never occur
        throw new IllegalStateException("WizardRegistrar for the project type " + projectType.getId() + " isn't registered.");
    }
    List<Provider<? extends WizardPage<MutableProjectConfig>>> pageProviders = wizardRegistrar.getWizardPages();
    final ProjectWizard projectWizard = createDefaultWizard(configDto, wizardMode);
    for (Provider<? extends WizardPage<MutableProjectConfig>> provider : pageProviders) {
        projectWizard.addPage(provider.get(), 1, false);
    }
    wizardsCache.put(projectType, projectWizard);
    return projectWizard;
}
Also used : MutableProjectConfig(org.eclipse.che.ide.api.project.MutableProjectConfig) WizardPage(org.eclipse.che.ide.api.wizard.WizardPage) ProjectWizard(org.eclipse.che.ide.projecttype.wizard.ProjectWizard) ProjectWizardRegistrar(org.eclipse.che.ide.api.project.type.wizard.ProjectWizardRegistrar) Provider(com.google.inject.Provider)

Aggregations

ProjectWizard (org.eclipse.che.ide.projecttype.wizard.ProjectWizard)2 Provider (com.google.inject.Provider)1 MutableProjectConfig (org.eclipse.che.ide.api.project.MutableProjectConfig)1 ProjectWizardRegistrar (org.eclipse.che.ide.api.project.type.wizard.ProjectWizardRegistrar)1 WizardPage (org.eclipse.che.ide.api.wizard.WizardPage)1