use of edu.stanford.bmir.protege.web.shared.project.GetProjectDetailsAction in project webprotege by protegeproject.
the class ActiveProjectManagerImpl method getActiveProjectDetails.
@Override
public void getActiveProjectDetails(Consumer<Optional<ProjectDetails>> projectDetailsConsumer) {
if (cachedProjectDetails.isPresent()) {
projectDetailsConsumer.accept(cachedProjectDetails);
} else {
Optional<ProjectId> activeProjectId = getActiveProjectId();
if (activeProjectId.isPresent()) {
dispatchServiceManager.execute(new GetProjectDetailsAction(activeProjectId.get()), result -> {
GWT.log("[ActiveProjectManagerImpl] Got details: " + result.getProjectDetails());
cachedProjectDetails = Optional.of(result.getProjectDetails());
projectDetailsConsumer.accept(cachedProjectDetails);
});
} else {
projectDetailsConsumer.accept(Optional.empty());
}
}
}
Aggregations