use of edu.stanford.bmir.protege.web.shared.perspective.PerspectiveId in project webprotege by protegeproject.
the class GetPerspectiveLayoutActionHandler method execute.
@Nonnull
@Override
public GetPerspectiveLayoutResult execute(@Nonnull GetPerspectiveLayoutAction action, @Nonnull ExecutionContext executionContext) {
PerspectiveId perspectiveId = action.getPerspectiveId();
ProjectId projectId = action.getProjectId();
UserId userId = action.getUserId();
PerspectiveLayout perspectiveLayout = perspectiveLayoutStore.getPerspectiveLayout(projectId, userId, perspectiveId);
return new GetPerspectiveLayoutResult(perspectiveLayout);
}
use of edu.stanford.bmir.protege.web.shared.perspective.PerspectiveId in project webprotege by protegeproject.
the class GetPerspectivesActionHandler method execute.
@Nonnull
@Override
public GetPerspectivesResult execute(@Nonnull GetPerspectivesAction action, @Nonnull ExecutionContext executionContext) {
ProjectId projectId = action.getProjectId();
UserId userId = action.getUserId();
ImmutableList<PerspectiveId> perspectives = perspectivesManager.getPerspectives(projectId, userId);
return new GetPerspectivesResult(perspectives);
}
use of edu.stanford.bmir.protege.web.shared.perspective.PerspectiveId in project webprotege by protegeproject.
the class PerspectiveSwitcherViewImpl method handleNewPerspectiveButtonClicked.
@UiHandler("newTabButton")
protected void handleNewPerspectiveButtonClicked(ClickEvent clickEvent) {
if (!addPerspectiveAllowed) {
return;
}
PopupMenu popupMenu = new PopupMenu();
for (final PerspectiveId perspectiveId : bookmarkedPerspectives) {
AbstractUiAction action = new AbstractUiAction(perspectiveId.getId()) {
@Override
public void execute() {
addBookMarkedPerspectiveLinkHandler.handleAddBookmarkedPerspective(perspectiveId);
}
};
action.setEnabled(!displayedPerspectives.contains(perspectiveId));
popupMenu.addItem(action);
}
popupMenu.addSeparator();
popupMenu.addItem(messages.perspective_addBlankTab() + "\u2026", () -> addPerspectiveLinkRequestHandler.handleAddNewPerspectiveLinkRequest());
popupMenu.showRelativeTo(newTabButton);
}
use of edu.stanford.bmir.protege.web.shared.perspective.PerspectiveId 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);
}
use of edu.stanford.bmir.protege.web.shared.perspective.PerspectiveId in project webprotege by protegeproject.
the class LoadProjectInNewWindowRequestHandlerImpl method handleOpenInNewWindow.
private void handleOpenInNewWindow(ImmutableList<PerspectiveId> perspectives, ProjectId projectId) {
PerspectiveId perspectiveId;
if (perspectives.isEmpty()) {
perspectiveId = new PerspectiveId("Other");
} else {
perspectiveId = perspectives.get(0);
}
handleOpenInNewWindow(projectId, perspectiveId);
}
Aggregations