use of edu.stanford.bmir.protege.web.shared.place.ItemSelection in project webprotege by protegeproject.
the class SelectionModel_TestCase method setupSelectionForEntity.
private void setupSelectionForEntity(OWLEntity entity) {
ItemSelection itemSelection = ItemSelection.builder().addEntity(entity).build();
when(projectPlace.getItemSelection()).thenReturn(itemSelection);
}
use of edu.stanford.bmir.protege.web.shared.place.ItemSelection in project webprotege by protegeproject.
the class PerspectiveSwitcherPresenter method goToPlaceForPerspective.
private void goToPlaceForPerspective(PerspectiveId perspectiveId) {
Place currentPlace = placeController.getWhere();
GWT.log("[PerspectiveSwitcherPresenter] Current Place: " + currentPlace);
if (!(currentPlace instanceof ProjectViewPlace)) {
return;
}
ProjectViewPlace projectPerspectivePlace = (ProjectViewPlace) currentPlace;
// Preserve the selection for the current perspective.
// (This could be optional. Previously, we carried selection over)
perspective2Selection.put(projectPerspectivePlace.getPerspectiveId(), projectPerspectivePlace.getItemSelection());
ItemSelection previousSelection = perspective2Selection.get(perspectiveId);
ProjectViewPlace.Builder builder = projectPerspectivePlace.builder();
builder.withPerspectiveId(perspectiveId);
if (previousSelection != null) {
// Restore the selection
builder.clearSelection();
builder.withSelectedItems(previousSelection);
}
ProjectViewPlace nextPlace = builder.build();
placeController.goTo(nextPlace);
}
Aggregations