Search in sources :

Example 1 with WizardPage

use of org.eclipse.che.ide.api.wizard.WizardPage in project che by eclipse.

the class ImportProjectWizardPresenter method getWizardForImporter.

/** Creates or returns import wizard for the specified importer. */
private ImportWizard getWizardForImporter(@NotNull ProjectImporterDescriptor importer) {
    if (wizardsCache.containsKey(importer)) {
        return wizardsCache.get(importer);
    }
    final ImportWizardRegistrar wizardRegistrar = wizardRegistry.getWizardRegistrar(importer.getId());
    if (wizardRegistrar == null) {
        // should never occur
        throw new IllegalStateException("WizardRegistrar for the importer " + importer.getId() + " isn't registered.");
    }
    List<Provider<? extends WizardPage<MutableProjectConfig>>> pageProviders = wizardRegistrar.getWizardPages();
    final ImportWizard importWizard = createDefaultWizard();
    for (Provider<? extends WizardPage<MutableProjectConfig>> provider : pageProviders) {
        importWizard.addPage(provider.get(), 1, false);
    }
    wizardsCache.put(importer, importWizard);
    return importWizard;
}
Also used : ImportWizardRegistrar(org.eclipse.che.ide.api.project.wizard.ImportWizardRegistrar) MutableProjectConfig(org.eclipse.che.ide.api.project.MutableProjectConfig) ImportWizard(org.eclipse.che.ide.projectimport.wizard.ImportWizard) WizardPage(org.eclipse.che.ide.api.wizard.WizardPage) Provider(com.google.inject.Provider)

Example 2 with WizardPage

use of org.eclipse.che.ide.api.wizard.WizardPage 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

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