use of org.eclipse.m2e.editor.pom.ValueProvider in project m2e-core by eclipse-m2e.
the class DependenciesComposite method openManageDependenciesDialog.
void openManageDependenciesDialog() throws InvocationTargetException, InterruptedException {
/*
* A linked list representing the path from child to root parent pom.
* The head is the child, the tail is the root pom
*/
final List<ParentHierarchyEntry> hierarchy = new ArrayList<>();
IRunnableWithProgress projectLoader = monitor -> {
try {
IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
IMavenProjectFacade projectFacade = projectManager.create(pomEditor.getPomFile(), true, monitor);
if (projectFacade != null) {
hierarchy.addAll(new ParentGatherer(projectFacade).getParentHierarchy(monitor));
}
} catch (CoreException e) {
throw new InvocationTargetException(e);
}
};
PlatformUI.getWorkbench().getProgressService().run(false, true, projectLoader);
if (hierarchy.isEmpty()) {
// User has already been notified to fix the problem.
return;
}
final ManageDependenciesDialog manageDepDialog = new ManageDependenciesDialog(getShell(), new ValueProvider<List<org.apache.maven.model.Dependency>>() {
@Override
public List<org.apache.maven.model.Dependency> getValue() {
List<org.apache.maven.model.Dependency> toRet = new ArrayList<>();
for (DependenciesComposite.Dependency d : getDependencies()) {
toRet.add(toApacheDependency(d));
}
return toRet;
}
}, hierarchy, dependenciesEditor.getSelection());
manageDepDialog.open();
}
Aggregations