use of org.eclipse.che.ide.api.project.NewProjectConfigImpl in project che by eclipse.
the class ProjectWizardPresenter method onProjectTemplateSelected.
@Override
public void onProjectTemplateSelected(ProjectTemplateDescriptor projectTemplate) {
final MutableProjectConfig dataObject = wizard.getDataObject();
wizard = importWizard == null ? importWizard = createDefaultWizard(dataObject, IMPORT) : importWizard;
wizard.navigateToFirst();
// set dataObject's values from projectTemplate
final NewProjectConfig newProjectConfig = new NewProjectConfigImpl(projectTemplate);
dataObject.setType(newProjectConfig.getType());
dataObject.setSource(newProjectConfig.getSource());
dataObject.setAttributes(newProjectConfig.getAttributes());
dataObject.setOptions(newProjectConfig.getOptions());
dataObject.setCommands(projectTemplate.getCommands());
}
use of org.eclipse.che.ide.api.project.NewProjectConfigImpl in project che by eclipse.
the class CategoriesPagePresenter method updateProjectConfigs.
private void updateProjectConfigs(String newProjectPath, ProjectTemplateDescriptor projectTemplate) {
final List<NewProjectConfigDto> configDtoList = projectTemplate.getProjects();
if (newProjectPath.equals("/")) {
return;
}
final String templatePath = projectTemplate.getPath();
final List<NewProjectConfig> updatedConfigs = new ArrayList<>(configDtoList.size());
for (NewProjectConfigDto configDto : configDtoList) {
final NewProjectConfig newConfig = new NewProjectConfigImpl(configDto);
final String projectPath = configDto.getPath();
if (projectPath.startsWith(templatePath)) {
final String path = projectPath.replaceFirst(templatePath, newProjectPath);
newConfig.setPath(path);
}
updatedConfigs.add(newConfig);
}
dataObject.setProjects(updatedConfigs);
}
Aggregations