Search in sources :

Example 1 with BookmarkListGroupItem

use of org.ovirt.engine.ui.webadmin.widget.bookmark.BookmarkListGroupItem in project ovirt-engine by oVirt.

the class BookmarkView method addBookmark.

@Override
public HandlerRegistration addBookmark(Bookmark bookmark, BookmarkListModel model, ClickHandler handler) {
    emptyBookmarksColumn.setVisible(false);
    BookmarkListGroupItem item = new BookmarkListGroupItem(bookmark, bookmarkListGroup.getWidgetCount());
    item.addEditClickHandler(event -> {
        model.setSelectedItem(bookmark);
        model.executeCommand(model.getEditCommand());
    });
    item.addRemoveClickHandler(event -> {
        model.setSelectedItem(bookmark);
        model.executeCommand(model.getRemoveCommand());
    });
    bookmarkListGroup.add(item);
    HandlerRegistration handlerRegistration = null;
    if (handler != null) {
        handlerRegistration = item.addAnchorClickHandler(handler);
    }
    return handlerRegistration;
}
Also used : HandlerRegistration(com.google.web.bindery.event.shared.HandlerRegistration) BookmarkListGroupItem(org.ovirt.engine.ui.webadmin.widget.bookmark.BookmarkListGroupItem)

Aggregations

HandlerRegistration (com.google.web.bindery.event.shared.HandlerRegistration)1 BookmarkListGroupItem (org.ovirt.engine.ui.webadmin.widget.bookmark.BookmarkListGroupItem)1