Search in sources :

Example 41 with HandlerRegistration

use of com.google.gwt.event.shared.HandlerRegistration in project activityinfo by bedatadriven.

the class AppCacheSynchronizer method execute.

@Override
public void execute(final AsyncCallback<Void> callback) {
    final HandlerRegistration progressRegistration = appCache.addProgressHandler(this);
    appCache.ensureUpToDate(new AsyncCallback<Void>() {

        @Override
        public void onSuccess(Void result) {
            if (appCache.getStatus() == Status.UPDATE_READY) {
                callback.onFailure(new SyncException(SyncErrorType.NEW_VERSION));
            } else {
                progressRegistration.removeHandler();
                callback.onSuccess(result);
            }
        }

        @Override
        public void onFailure(Throwable caught) {
            callback.onFailure(caught);
        }
    });
}
Also used : HandlerRegistration(com.google.gwt.event.shared.HandlerRegistration)

Example 42 with HandlerRegistration

use of com.google.gwt.event.shared.HandlerRegistration in project activityinfo by bedatadriven.

the class FilterPanelSet method addValueChangeHandler.

@Override
public HandlerRegistration addValueChangeHandler(ValueChangeHandler<Filter> handler) {
    final HandlerRegistration reg = ensureHandlers().addHandler(ValueChangeEvent.getType(), handler);
    return new HandlerRegistration() {

        @Override
        public void removeHandler() {
            reg.removeHandler();
            if (manager.getHandlerCount(ValueChangeEvent.getType()) == 0) {
                for (HandlerRegistration myReg : myRegistrations) {
                    myReg.removeHandler();
                }
            }
            manager = null;
        }
    };
}
Also used : HandlerRegistration(com.google.gwt.event.shared.HandlerRegistration)

Example 43 with HandlerRegistration

use of com.google.gwt.event.shared.HandlerRegistration in project webprotege by protegeproject.

the class ExpandingTextBoxImpl method addAnchorClickedHandler.

@Override
public HandlerRegistration addAnchorClickedHandler(AnchorClickedHandler handler) {
    final HandlerRegistration anchorClickReg = addHandler(handler, AnchorClickedEvent.TYPE);
    final HandlerRegistration clickReg = anchor.addClickHandler(event -> fireEvent(new AnchorClickedEvent(ExpandingTextBoxImpl.this)));
    return () -> {
        clickReg.removeHandler();
        anchorClickReg.removeHandler();
    };
}
Also used : HandlerRegistration(com.google.gwt.event.shared.HandlerRegistration) AnchorClickedEvent(edu.stanford.bmir.protege.web.client.anchor.AnchorClickedEvent)

Example 44 with HandlerRegistration

use of com.google.gwt.event.shared.HandlerRegistration in project ovirt-engine by oVirt.

the class BaseListModelSuggestBox method addKeyPressHandler.

@Override
public HandlerRegistration addKeyPressHandler(KeyPressHandler handler) {
    HandlerRegistration handlerRegistration = asSuggestBox().addKeyPressHandler(handler);
    handlerRegistrations.add(handlerRegistration);
    return handlerRegistration;
}
Also used : HandlerRegistration(com.google.gwt.event.shared.HandlerRegistration)

Example 45 with HandlerRegistration

use of com.google.gwt.event.shared.HandlerRegistration in project ovirt-engine by oVirt.

the class BaseListModelSuggestBox method addKeyDownHandler.

@Override
public HandlerRegistration addKeyDownHandler(KeyDownHandler handler) {
    HandlerRegistration handlerRegistration = asSuggestBox().addKeyDownHandler(handler);
    handlerRegistrations.add(handlerRegistration);
    return handlerRegistration;
}
Also used : HandlerRegistration(com.google.gwt.event.shared.HandlerRegistration)

Aggregations

HandlerRegistration (com.google.gwt.event.shared.HandlerRegistration)48 Test (org.junit.Test)7 MouseEvent (com.google.gwt.event.dom.client.MouseEvent)4 ViewEvent (org.kie.workbench.common.stunner.core.client.shape.view.event.ViewEvent)4 NodeMouseEnterEvent (com.ait.lienzo.client.core.event.NodeMouseEnterEvent)2 NodeMouseEnterHandler (com.ait.lienzo.client.core.event.NodeMouseEnterHandler)2 NodeMouseExitEvent (com.ait.lienzo.client.core.event.NodeMouseExitEvent)2 NodeMouseExitHandler (com.ait.lienzo.client.core.event.NodeMouseExitHandler)2 JavaScriptObject (com.google.gwt.core.client.JavaScriptObject)2 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)2 Widget (com.google.gwt.user.client.ui.Widget)2 Map (java.util.Map)2 MouseDoubleClickEvent (org.kie.workbench.common.stunner.core.client.shape.view.event.MouseDoubleClickEvent)2 MouseEnterEvent (org.kie.workbench.common.stunner.core.client.shape.view.event.MouseEnterEvent)2 CommandWithArg (org.rstudio.core.client.CommandWithArg)2 Mutable (org.rstudio.core.client.Mutable)2 Attribute (com.ait.lienzo.client.core.Attribute)1 AbstractNodeGestureEvent (com.ait.lienzo.client.core.event.AbstractNodeGestureEvent)1 NodeGestureChangeEvent (com.ait.lienzo.client.core.event.NodeGestureChangeEvent)1 NodeGestureChangeHandler (com.ait.lienzo.client.core.event.NodeGestureChangeHandler)1