containerPage.finish();
IClasspathEntry newEntry = containerPage.getSelection();
IPath path = newEntry.getPath();
IJavaProject project = containerPage.getProject();
try {
IvyClasspathContainerImpl ivycp = new IvyClasspathContainerImpl(project, path,
new IClasspathEntry[0], new IClasspathAttribute[0]);
JavaCore.setClasspathContainer(path, new IJavaProject[] {project},
new IClasspathContainer[] {ivycp}, null);
IClasspathEntry[] entries = project.getRawClasspath();
List newEntries = new ArrayList(Arrays.asList(entries));
newEntries.add(newEntry);
entries = (IClasspathEntry[]) newEntries
.toArray(new IClasspathEntry[newEntries.size()]);
project.setRawClasspath(entries, project.getOutputLocation(), null);
ivycp.launchResolve(false, null);
} catch (JavaModelException e) {
IvyPlugin.log(e);
return false;
}
return true;