Search in sources :

Example 1 with PerspectiveId

use of edu.stanford.bmir.protege.web.shared.perspective.PerspectiveId in project webprotege by protegeproject.

the class PerspectiveSwitcherPresenter method displayPlace.

/**
 * Displays the place.  The "tab" corresponding to the place PerspectiveId will be highlighted.  A fresh "tab" will be
 * added to the last position if there is no tab existing tab that corresponds to the place PerspectiveId.
 * @param place The place to display.  Not {@code null}.
 * @throws NullPointerException if {@code place} is {@code null}.
 */
private void displayPlace(ProjectViewPlace place) {
    GWT.log("[PerspectiveSwitcherPresenter] displayPlace: " + place);
    PerspectiveId perspectiveId = checkNotNull(place).getPerspectiveId();
    ensurePerspectiveLinkExists(perspectiveId);
    ensurePerspectiveLinkIsActive(perspectiveId);
}
Also used : PerspectiveId(edu.stanford.bmir.protege.web.shared.perspective.PerspectiveId)

Example 2 with PerspectiveId

use of edu.stanford.bmir.protege.web.shared.perspective.PerspectiveId in project webprotege by protegeproject.

the class PerspectiveSwitcherPresenter method getCurrentPlacePerspectiveId.

private Optional<PerspectiveId> getCurrentPlacePerspectiveId() {
    Place currentPlace = placeController.getWhere();
    if (!(currentPlace instanceof ProjectViewPlace)) {
        return Optional.empty();
    }
    ProjectViewPlace projectViewPlace = (ProjectViewPlace) currentPlace;
    PerspectiveId currentPlacePerspective = projectViewPlace.getPerspectiveId();
    return Optional.of(currentPlacePerspective);
}
Also used : ProjectViewPlace(edu.stanford.bmir.protege.web.shared.place.ProjectViewPlace) PerspectiveId(edu.stanford.bmir.protege.web.shared.perspective.PerspectiveId) ProjectViewPlace(edu.stanford.bmir.protege.web.shared.place.ProjectViewPlace) Place(com.google.gwt.place.shared.Place)

Example 3 with PerspectiveId

use of edu.stanford.bmir.protege.web.shared.perspective.PerspectiveId in project webprotege by protegeproject.

the class PerspectiveSwitcherPresenter method handleRemoveLinkedPerspective.

private void handleRemoveLinkedPerspective(final PerspectiveId perspectiveId) {
    perspectiveLinkManager.removeLinkedPerspective(perspectiveId, perspectiveIds -> {
        view.setPerspectiveLinks(perspectiveIds);
        Optional<PerspectiveId> currentPlacePerspective = getCurrentPlacePerspectiveId();
        if (currentPlacePerspective.isPresent() && currentPlacePerspective.get().equals(perspectiveId)) {
            // Need to change place
            PerspectiveId nextPerspective = perspectiveIds.get(0);
            goToPlaceForPerspective(nextPerspective);
        }
    });
}
Also used : PerspectiveId(edu.stanford.bmir.protege.web.shared.perspective.PerspectiveId)

Example 4 with PerspectiveId

use of edu.stanford.bmir.protege.web.shared.perspective.PerspectiveId in project webprotege by protegeproject.

the class PerspectiveSwitcherViewImpl method setPerspectiveLinks.

public void setPerspectiveLinks(List<PerspectiveId> perspectives) {
    removeAllDisplayedPerspectives();
    for (final PerspectiveId perspectiveId : perspectives) {
        addPerspectiveLink(perspectiveId);
    }
    ensureHighlightedPerspectiveLinkIsSelected();
}
Also used : PerspectiveId(edu.stanford.bmir.protege.web.shared.perspective.PerspectiveId)

Example 5 with PerspectiveId

use of edu.stanford.bmir.protege.web.shared.perspective.PerspectiveId in project webprotege by protegeproject.

the class CreateFreshPerspectiveRequestHandlerImpl method createFreshPerspective.

@Override
public void createFreshPerspective(final Callback callback) {
    InputBox.showDialog("Enter tab name", false, "", input -> {
        String trimmedInput = input.trim();
        if (trimmedInput.isEmpty()) {
            return;
        }
        callback.createNewPerspective(new PerspectiveId(trimmedInput));
    });
}
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