Search in sources :

Example 1 with HandlerRegistration

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;
}
Also used : HandlerRegistration(com.google.web.bindery.event.shared.HandlerRegistration)

Example 2 with HandlerRegistration

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;
}
Also used : HandlerRegistration(com.google.web.bindery.event.shared.HandlerRegistration) BookmarkListGroupItem(org.ovirt.engine.ui.webadmin.widget.bookmark.BookmarkListGroupItem)

Example 3 with 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);
}
Also used : HandlerRegistration(com.google.web.bindery.event.shared.HandlerRegistration)

Example 4 with HandlerRegistration

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;
}
Also used : HandlerRegistration(com.google.web.bindery.event.shared.HandlerRegistration)

Example 5 with 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);
}
Also used : HandlerRegistration(com.google.web.bindery.event.shared.HandlerRegistration)

Aggregations

HandlerRegistration (com.google.web.bindery.event.shared.HandlerRegistration)10 Callback (com.google.gwt.core.client.Callback)1 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)1 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)1 FileReader (com.googlecode.gwtphonegap.client.file.FileReader)1 Call (org.eclipse.che.api.promises.client.callback.CallbackPromiseHelper.Call)1 CallbackPromiseHelper.createFromCallback (org.eclipse.che.api.promises.client.callback.CallbackPromiseHelper.createFromCallback)1 EditorPartPresenter (org.eclipse.che.ide.api.editor.EditorPartPresenter)1 DocumentHandle (org.eclipse.che.ide.api.editor.document.DocumentHandle)1 ActivePartChangedEvent (org.eclipse.che.ide.api.event.ActivePartChangedEvent)1 ActivePartChangedHandler (org.eclipse.che.ide.api.event.ActivePartChangedHandler)1 AnchorListItem (org.gwtbootstrap3.client.ui.AnchorListItem)1 BookmarkListGroupItem (org.ovirt.engine.ui.webadmin.widget.bookmark.BookmarkListGroupItem)1