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);
}
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);
}
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);
}
});
}
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();
}
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));
});
}
Aggregations