Search in sources :

Example 1 with ImportWizard

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

use of org.eclipse.che.ide.projectimport.wizard.ImportWizard in project che by eclipse.

the class ImportProjectWizardPresenter method createDefaultWizard.

/** Creates and returns 'default' project wizard with pre-defined pages only. */
private ImportWizard createDefaultWizard() {
    final MutableProjectConfig dataObject = new MutableProjectConfig();
    final ImportWizard importWizard = importWizardFactory.newWizard(dataObject);
    importWizard.setUpdateDelegate(this);
    // add pre-defined first page
    importWizard.addPage(mainPage);
    return importWizard;
}
Also used : MutableProjectConfig(org.eclipse.che.ide.api.project.MutableProjectConfig) ImportWizard(org.eclipse.che.ide.projectimport.wizard.ImportWizard)

Aggregations

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