use of com.google.web.bindery.event.shared.HandlerRegistration in project gwt-material by GwtMaterialDesign.
the class GroupValidator method remove.
/**
* Removes a field from the validation group.
*
* @param <T> the generic type
* @param field the field
* @return true, if successful
*/
public <T extends Widget & HasValidators<?>> boolean remove(final T field) {
fields.remove(field);
HandlerRegistration reg = registrations.remove(field);
if (reg != null) {
reg.removeHandler();
return true;
}
return false;
}
use of com.google.web.bindery.event.shared.HandlerRegistration 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;
}
use of com.google.web.bindery.event.shared.HandlerRegistration in project webprotege by protegeproject.
the class AbstractResultCachingStrategy method registerProjectEventHandler.
protected <T> void registerProjectEventHandler(Event.Type<T> type, T handler) {
HandlerRegistration reg = eventBus.addHandlerToSource(checkNotNull(type), projectId, checkNotNull(handler));
handlerRegistrations.add(reg);
}
use of com.google.web.bindery.event.shared.HandlerRegistration in project webprotege by protegeproject.
the class EventManager method addHandler.
public <T extends EventHandler> HandlerRegistration addHandler(Event.Type<T> type, T handler) {
final HandlerRegistration handlerRegistration = eventBus.addHandler(type, handler);
registeredHandlers.add(handlerRegistration);
return handlerRegistration;
}
use of com.google.web.bindery.event.shared.HandlerRegistration in project webprotege by protegeproject.
the class HandlerRegistrationManager method registerHandlerToProject.
public <H> void registerHandlerToProject(ProjectId projectId, Event.Type<H> type, H handler) {
HandlerRegistration registration = eventBus.addHandlerToSource(type, projectId, handler);
addHandlerRegistration(registration);
}
Aggregations