}
@Override
public void perform( IProgressMonitor monitor ) {
Collection<ProjectElement> elements = toProjectElements();
Project destination = (Project) getDestination();
Collection<Project> projects = collectAffectedProjects(elements, destination);
Collection<String> messages = ProjectPlugin.saveProjects(projects);
if (!messages.isEmpty()) {
MessageDialog
.openError(
Display.getDefault().getActiveShell(),
"Error saving projects",
"An error occurred while attempting to save projects. Please verify you have write access to the project files and no other applications have locked the files.");
return;
}
Collection<ProjectElement> allElements = removeFromOldProjects(elements);
destination.getElementsInternal().addAll(allElements);
Collection<String> errors = ProjectPlugin.saveProjects(projects);
if (!errors.isEmpty()) {
MessageDialog