use of org.eclipse.che.ide.ext.java.client.project.classpath.valueproviders.pages.ClasspathPagePresenter in project che by eclipse.
the class ProjectClasspathPresenter method show.
/** Show dialog. */
public void show() {
final Resource[] resources = appContext.getResources();
Preconditions.checkState(resources != null && resources.length == 1);
final Optional<Project> project = resources[0].getRelatedProject();
Preconditions.checkState(isJavaProject(project.get()));
classpathContainer.getClasspathEntries(project.get().getLocation().toString()).then(new Operation<List<ClasspathEntryDto>>() {
@Override
public void apply(List<ClasspathEntryDto> arg) throws OperationException {
classpathResolver.resolveClasspathEntries(arg);
if (propertiesMap == null) {
propertiesMap = new HashMap<>();
for (ClasspathPagePresenter page : classpathPages) {
Set<ClasspathPagePresenter> pages = propertiesMap.get(page.getCategory());
if (pages == null) {
pages = new HashSet<>();
propertiesMap.put(page.getCategory(), pages);
}
pages.add(page);
}
view.setPages(propertiesMap);
}
view.show();
view.selectPage(propertiesMap.entrySet().iterator().next().getValue().iterator().next());
}
}).catchError(new Operation<PromiseError>() {
@Override
public void apply(PromiseError arg) throws OperationException {
notificationManager.notify("Problems with getting classpath", arg.getMessage(), FAIL, EMERGE_MODE);
}
});
}
Aggregations