use of org.ovirt.engine.ui.webadmin.section.main.presenter.RevealOverlayContentEvent in project ovirt-engine by oVirt.
the class BookmarkPresenterWidget method updateBookmarks.
private void updateBookmarks() {
BookmarkListModel model = bookmarkModelProvider.getModel();
Collection<Bookmark> items = model.getItems();
AbstractMainWithDetailsPresenter<?, ?, ?, ?> presenter = null;
if (getCurrentPlaceWidget() instanceof AbstractMainWithDetailsPresenter) {
presenter = (AbstractMainWithDetailsPresenter<?, ?, ?, ?>) getCurrentPlaceWidget();
}
final AbstractMainWithDetailsPresenter<?, ?, ?, ?> mainPresenter = presenter;
getView().clearBookmarks();
if (items != null && !items.isEmpty()) {
for (Bookmark bookmark : items) {
if (mainPresenter != null && isBookmarkForCurrentPlace(bookmark, mainPresenter)) {
registerHandler(getView().addBookmark(bookmark, model, event -> {
mainPresenter.applySearchString(bookmark.getValue());
// Close the overlay.
RevealOverlayContentEvent.fire(this, new RevealOverlayContentEvent(null));
event.preventDefault();
}));
} else {
getView().addBookmark(bookmark, model, null);
}
}
}
}
Aggregations