Search in sources :

Example 1 with ItemSelection

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

Example 2 with 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);
}
Also used : ProjectViewPlace(edu.stanford.bmir.protege.web.shared.place.ProjectViewPlace) ProjectViewPlace(edu.stanford.bmir.protege.web.shared.place.ProjectViewPlace) Place(com.google.gwt.place.shared.Place) ItemSelection(edu.stanford.bmir.protege.web.shared.place.ItemSelection)

Aggregations

ItemSelection (edu.stanford.bmir.protege.web.shared.place.ItemSelection)2 Place (com.google.gwt.place.shared.Place)1 ProjectViewPlace (edu.stanford.bmir.protege.web.shared.place.ProjectViewPlace)1