public ProjectImporterDescriptorImpl(org.eclipse.che.api.project.shared.dto.ProjectImporterDescriptor origin) { this.internal = origin.isInternal(); java.util.Map<java.lang.String, java.lang.String> attributesIn = origin.getAttributes(); if (attributesIn != null) { java.util.Map<java.lang.String, java.lang.String> attributesOut = new java.util.HashMap<java.lang.String, java.lang.String>(); for (java.util.Map.Entry<String, java.lang.String> entry0 : attributesIn.entrySet()) { java.lang.String attributesIn_ = entry0.getValue(); attributesOut.put(entry0.getKey(), attributesIn_); } this.attributes = attributesOut; } this.category = origin.getCategory(); this.id = origin.getId(); this.description = origin.getDescription(); }
@Override protected void onSuccess(ProjectImporterData data) { List<ProjectImporterDescriptor> result = data.getImporters(); String defaultImporterId = data.getConfiguration().get(DEFAULT_PROJECT_IMPORTER); result.sort(getProjectImporterComparator(defaultImporterId)); ProjectImporterDescriptor defaultImporter = null; for (ProjectImporterDescriptor importer : result) { if (importer.isInternal() || importer.getCategory() == null || !importWizardRegistry.getWizardRegistrar(importer.getId()).isPresent()) { continue; } if (importersByCategory.containsKey(importer.getCategory())) { importersByCategory.get(importer.getCategory()).add(importer); } else { Set<ProjectImporterDescriptor> importersSet = new LinkedHashSet<>(); importersSet.add(importer); importersByCategory.put(importer.getCategory(), importersSet); } if (importer.getId().equals(defaultImporterId)) { defaultImporter = importer; } } setImporters(defaultImporter); }