Search in sources :

Example 1 with GetCollectionItemsAction

use of edu.stanford.bmir.protege.web.shared.collection.GetCollectionItemsAction in project webprotege by protegeproject.

the class CollectionItemListPresenter method refresh.

public void refresh(Runnable runnable) {
    Place place = placeController.getWhere();
    if (!(place instanceof CollectionViewPlace)) {
        return;
    }
    CollectionViewPlace collectionViewPlace = (CollectionViewPlace) place;
    dispatchServiceManager.execute(new GetCollectionItemsAction(collectionViewPlace.getProjectId(), collectionViewPlace.getCollectionId(), PageRequest.requestPage(view.getPageNumber())), busy -> {
    }, result -> {
        Page<CollectionItem> page = result.getElementIdPage();
        view.setPageCount(page.getPageCount());
        view.setPageNumber(page.getPageNumber());
        view.setElements(page.getPageElements());
        collectionViewPlace.getSelection().ifPresent(view::setSelection);
        runnable.run();
    });
}
Also used : CollectionViewPlace(edu.stanford.bmir.protege.web.shared.place.CollectionViewPlace) CollectionItem(edu.stanford.bmir.protege.web.shared.collection.CollectionItem) GetCollectionItemsAction(edu.stanford.bmir.protege.web.shared.collection.GetCollectionItemsAction) CollectionViewPlace(edu.stanford.bmir.protege.web.shared.place.CollectionViewPlace) Place(com.google.gwt.place.shared.Place)

Aggregations

Place (com.google.gwt.place.shared.Place)1 CollectionItem (edu.stanford.bmir.protege.web.shared.collection.CollectionItem)1 GetCollectionItemsAction (edu.stanford.bmir.protege.web.shared.collection.GetCollectionItemsAction)1 CollectionViewPlace (edu.stanford.bmir.protege.web.shared.place.CollectionViewPlace)1