Search in sources :

Example 1 with GetProjectDetailsAction

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());
        }
    }
}
Also used : HasProjectId(edu.stanford.bmir.protege.web.shared.project.HasProjectId) ProjectId(edu.stanford.bmir.protege.web.shared.project.ProjectId) GetProjectDetailsAction(edu.stanford.bmir.protege.web.shared.project.GetProjectDetailsAction)

Aggregations

GetProjectDetailsAction (edu.stanford.bmir.protege.web.shared.project.GetProjectDetailsAction)1 HasProjectId (edu.stanford.bmir.protege.web.shared.project.HasProjectId)1 ProjectId (edu.stanford.bmir.protege.web.shared.project.ProjectId)1