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);
}
});
}
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;
}
};
}
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();
};
}
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;
}
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;
}
Aggregations