Search in sources :

Example 6 with PerspectiveId

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);
}
Also used : UserId(edu.stanford.bmir.protege.web.shared.user.UserId) ProjectId(edu.stanford.bmir.protege.web.shared.project.ProjectId) PerspectiveId(edu.stanford.bmir.protege.web.shared.perspective.PerspectiveId) PerspectiveLayout(edu.stanford.bmir.protege.web.shared.perspective.PerspectiveLayout) GetPerspectiveLayoutResult(edu.stanford.bmir.protege.web.shared.perspective.GetPerspectiveLayoutResult) Nonnull(javax.annotation.Nonnull)

Example 7 with PerspectiveId

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);
}
Also used : GetPerspectivesResult(edu.stanford.bmir.protege.web.shared.perspective.GetPerspectivesResult) UserId(edu.stanford.bmir.protege.web.shared.user.UserId) ProjectId(edu.stanford.bmir.protege.web.shared.project.ProjectId) PerspectiveId(edu.stanford.bmir.protege.web.shared.perspective.PerspectiveId) Nonnull(javax.annotation.Nonnull)

Example 8 with PerspectiveId

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);
}
Also used : AbstractUiAction(edu.stanford.bmir.protege.web.client.action.AbstractUiAction) PerspectiveId(edu.stanford.bmir.protege.web.shared.perspective.PerspectiveId) PopupMenu(edu.stanford.bmir.protege.web.client.library.popupmenu.PopupMenu) UiHandler(com.google.gwt.uibinder.client.UiHandler)

Example 9 with PerspectiveId

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);
}
Also used : UserId(edu.stanford.bmir.protege.web.shared.user.UserId) ProjectId(edu.stanford.bmir.protege.web.shared.project.ProjectId) PerspectiveId(edu.stanford.bmir.protege.web.shared.perspective.PerspectiveId) PerspectiveLayout(edu.stanford.bmir.protege.web.shared.perspective.PerspectiveLayout) ResetPerspectiveLayoutResult(edu.stanford.bmir.protege.web.shared.perspective.ResetPerspectiveLayoutResult) Nonnull(javax.annotation.Nonnull)

Example 10 with PerspectiveId

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);
}
Also used : PerspectiveId(edu.stanford.bmir.protege.web.shared.perspective.PerspectiveId)

Aggregations

PerspectiveId (edu.stanford.bmir.protege.web.shared.perspective.PerspectiveId)12 ProjectId (edu.stanford.bmir.protege.web.shared.project.ProjectId)3 UserId (edu.stanford.bmir.protege.web.shared.user.UserId)3 Nonnull (javax.annotation.Nonnull)3 PerspectiveLayout (edu.stanford.bmir.protege.web.shared.perspective.PerspectiveLayout)2 Place (com.google.gwt.place.shared.Place)1 MatchResult (com.google.gwt.regexp.shared.MatchResult)1 UiHandler (com.google.gwt.uibinder.client.UiHandler)1 AbstractUiAction (edu.stanford.bmir.protege.web.client.action.AbstractUiAction)1 PopupMenu (edu.stanford.bmir.protege.web.client.library.popupmenu.PopupMenu)1 GetPerspectiveLayoutResult (edu.stanford.bmir.protege.web.shared.perspective.GetPerspectiveLayoutResult)1 GetPerspectivesResult (edu.stanford.bmir.protege.web.shared.perspective.GetPerspectivesResult)1 ResetPerspectiveLayoutResult (edu.stanford.bmir.protege.web.shared.perspective.ResetPerspectiveLayoutResult)1 ProjectViewPlace (edu.stanford.bmir.protege.web.shared.place.ProjectViewPlace)1 Before (org.junit.Before)1 DefaultPrefixManager (org.semanticweb.owlapi.util.DefaultPrefixManager)1 OWLDataFactoryImpl (uk.ac.manchester.cs.owl.owlapi.OWLDataFactoryImpl)1