use of org.eclipse.jdt.core.ClasspathContainerInitializer in project eclipse.jdt.ls by eclipse.
the class SourceAttachmentCommand method updateContainerClasspath.
private static void updateContainerClasspath(IJavaProject javaProject, IPath containerPath, IClasspathEntry newEntry) throws CoreException {
IClasspathContainer container = JavaCore.getClasspathContainer(containerPath, javaProject);
List<IClasspathEntry> newEntries = updateElements(container.getClasspathEntries(), newEntry, (entry) -> {
return entry.getEntryKind() == newEntry.getEntryKind() && entry.getPath().equals(newEntry.getPath());
});
IClasspathContainer updatedContainer = new UpdatedClasspathContainer(container, newEntries.toArray(new IClasspathEntry[0]));
ClasspathContainerInitializer initializer = JavaCore.getClasspathContainerInitializer(containerPath.segment(0));
if (initializer != null) {
initializer.requestClasspathContainerUpdate(containerPath, javaProject, updatedContainer);
}
}
Aggregations