for ( File projectFile : selectedProjectFiles )
{
monitor.subTask( projectFile.getName() );
try
{
Project project = ProjectsImporter.getProject( new FileInputStream( projectFile ),
projectFile.getAbsolutePath() );
if ( projectsHandler.isProjectNameAlreadyTaken( project.getName() ) )
{
PluginUtils
.logError(
NLS
.bind(
Messages.getString( "ImportProjectsWizard.ErrorImportingProject" ), //$NON-NLS-1$
new String[]
{ project.getName() } ), null );
ViewUtils
.displayErrorMessageDialog(
Messages.getString( "ImportProjectsWizard.ImportError" ), //$NON-NLS-1$
NLS
.bind(
Messages.getString( "ImportProjectsWizard.ErrorImportingProject" ) //$NON-NLS-1$
+ "\n" //$NON-NLS-1$
+ Messages
.getString( "ImportProjectsWizard.ErrorProjectNameExists" ), //$NON-NLS-1$
new String[]
{ project.getName() } ) );
}
else
{
projectsHandler.addProject( project );
}