use of edu.stanford.bmir.protege.web.shared.perspective.ResetPerspectiveLayoutResult in project webprotege by protegeproject.
the class ResetPerspectiveLayoutActionHandler method execute.
@Nonnull
@Override
public ResetPerspectiveLayoutResult execute(@Nonnull ResetPerspectiveLayoutAction action, @Nonnull ExecutionContext executionContext) {
ProjectId projectId = action.getProjectId();
PerspectiveId perspectiveId = action.getPerspectiveId();
PerspectiveLayout defaultLayout = store.getPerspectiveLayout(projectId, perspectiveId);
// Only reset the perspective if there is a default for it
UserId userId = executionContext.getUserId();
if (defaultLayout.getRootNode().isPresent()) {
store.clearPerspectiveLayout(projectId, userId, perspectiveId);
}
PerspectiveLayout perspectiveLayout = store.getPerspectiveLayout(projectId, userId, perspectiveId);
return new ResetPerspectiveLayoutResult(perspectiveLayout);
}
Aggregations