com.google.gwt.event.shared.HandlerRegistration Java Examples

The following examples show how to use com.google.gwt.event.shared.HandlerRegistration. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MaterialDropDown.java    From gwt-material with Apache License 2.0 5 votes vote down vote up
@Override
public HandlerRegistration addSelectionHandler(final SelectionHandler<Widget> handler) {
    return addHandler((SelectionHandler<Widget>) event -> {
        Widget widget = event.getSelectedItem();
        if (widget instanceof HasEnabled && ((HasEnabled) widget).isEnabled() && isEnabled()) {
            handler.onSelection(event);
        }
    }, SelectionEvent.getType());
}
 
Example #2
Source File: DefaultHandlerRegistry.java    From gwt-material with Apache License 2.0 5 votes vote down vote up
@Override
public void clearHandlers() {
    if(handlers != null) {
        for(HandlerRegistration handler : handlers) {
            removeHandler(handler);
        }
        handlers.clear();
    }
}
 
Example #3
Source File: DateCell.java    From calendar-component with Apache License 2.0 5 votes vote down vote up
@Override
protected void onDetach() {
    for (HandlerRegistration handler : handlers) {
        handler.removeHandler();
    }
    handlers.clear();

    super.onDetach();
}
 
Example #4
Source File: MaterialValueBox.java    From gwt-material with Apache License 2.0 5 votes vote down vote up
@Override
public HandlerRegistration addGestureStartHandler(final GestureStartHandler handler) {
    return valueBoxBase.addGestureStartHandler(event -> {
        if (isEnabled()) {
            handler.onGestureStart(event);
        }
    });
}
 
Example #5
Source File: MaterialValueBox.java    From gwt-material with Apache License 2.0 5 votes vote down vote up
@Override
public HandlerRegistration addGestureChangeHandler(final GestureChangeHandler handler) {
    return valueBoxBase.addGestureChangeHandler(event -> {
        if (isEnabled()) {
            handler.onGestureChange(event);
        }
    });
}
 
Example #6
Source File: MaterialStep.java    From gwt-material-addins with Apache License 2.0 5 votes vote down vote up
@Override
public HandlerRegistration addSelectionHandler(final SelectionHandler<MaterialStep> handler) {
    return this.addHandler(new SelectionHandler<MaterialStep>() {
        @Override
        public void onSelection(SelectionEvent<MaterialStep> event) {
            if (isEnabled()) {
                handler.onSelection(event);
            }
        }
    }, SelectionEvent.getType());
}
 
Example #7
Source File: MaterialFileUploader.java    From gwt-material-addins with Apache License 2.0 5 votes vote down vote up
@Override
public HandlerRegistration addCompleteHandler(final CompleteEvent.CompleteHandler<UploadFile> handler) {
    return addHandler(new CompleteEvent.CompleteHandler<UploadFile>() {
        @Override
        public void onComplete(CompleteEvent<UploadFile> event) {
            if (isEnabled()) {
                handler.onComplete(event);
            }
        }
    }, CompleteEvent.getType());
}
 
Example #8
Source File: BaseCheckBox.java    From gwt-material with Apache License 2.0 5 votes vote down vote up
@Override
public HandlerRegistration addValueChangeHandler(
        final ValueChangeHandler<Boolean> handler) {
    // Is this the first value change handler? If so, time to add handlers
    if (!valueChangeHandlerInitialized) {
        ensureDomEventHandlers();
        valueChangeHandlerInitialized = true;
    }
    return addHandler(handler, ValueChangeEvent.getType());
}
 
Example #9
Source File: MaterialAutoComplete.java    From gwt-material-addins with Apache License 2.0 5 votes vote down vote up
@Override
public HandlerRegistration addFocusHandler(FocusHandler handler) {
    return itemBox.addHandler(focusEvent -> {
        if (isEnabled()) {
            handler.onFocus(focusEvent);
        }
    }, FocusEvent.getType());
}
 
Example #10
Source File: MaterialAutoComplete.java    From gwt-material-addins with Apache License 2.0 5 votes vote down vote up
@Override
public HandlerRegistration addValueChangeHandler(final ValueChangeHandler<List<? extends Suggestion>> handler) {
    return addHandler(new ValueChangeHandler<List<? extends Suggestion>>() {
        @Override
        public void onValueChange(ValueChangeEvent<List<? extends Suggestion>> event) {
            if (isEnabled()) {
                handler.onValueChange(event);
            }
        }
    }, ValueChangeEvent.getType());
}
 
Example #11
Source File: MaterialRichEditor.java    From gwt-material-addins with Apache License 2.0 4 votes vote down vote up
@Override
public HandlerRegistration addPasteHandler(final PasteEvent.PasteEventHandler handler) {
    return addHandler(handler, PasteEvent.TYPE);
}
 
Example #12
Source File: Gallery.java    From gwtbootstrap3-extras with Apache License 2.0 4 votes vote down vote up
/**
 * Executed when the Gallery is about to be closed.
 */
public HandlerRegistration addGalleryCloseHandler(final GalleryCloseHandler handler) {
    return addHandler(handler, GalleryCloseEvent.getType());
}
 
Example #13
Source File: ImageHover.java    From document-management-system with GNU General Public License v2.0 4 votes vote down vote up
public HandlerRegistration addMouseOutHandler(MouseOutHandler handler) {
	return addDomHandler(handler, MouseOutEvent.getType());
}
 
Example #14
Source File: DateTimePickerBase.java    From gwtbootstrap3-extras with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override
public HandlerRegistration addShowHandler(final ShowHandler showHandler) {
    return addHandler(showHandler, ShowEvent.getType());
}
 
Example #15
Source File: DateRangePicker.java    From gwt-material-addins with Apache License 2.0 4 votes vote down vote up
@Override
public HandlerRegistration addApplyHandler(ApplyEvent.ApplyEventHandler handler) {
    return addHandler(handler, ApplyEvent.getType());
}
 
Example #16
Source File: BaseCycleView.java    From mvp4g with Apache License 2.0 4 votes vote down vote up
public HandlerRegistration addUnloadHandler(UnloadHandler handler) {
  return addHandler(handler,
                    UnloadEvent.TYPE);
}
 
Example #17
Source File: Tile.java    From gwt-ol with Apache License 2.0 4 votes vote down vote up
/**
 * Triggered when a tile finishes loading.
 */
@JsOverlay
public final HandlerRegistration addTileLoadEndListener(final EventListener<Tile.Event> listener) {
    return OLUtil.observe(this, "tileloadend", listener);
}
 
Example #18
Source File: InputSuggest.java    From putnami-web-toolkit with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public HandlerRegistration addValueChangeHandler(ValueChangeHandler<T> handler) {
	return addHandler(handler, ValueChangeEvent.getType());
}
 
Example #19
Source File: HandlerPanel.java    From appinventor-extensions with Apache License 2.0 4 votes vote down vote up
public HandlerRegistration addTouchEndHandler(TouchEndHandler handler) {
  return addDomHandler(handler, TouchEndEvent.getType());
}
 
Example #20
Source File: InstructorDetails.java    From unitime with Apache License 2.0 4 votes vote down vote up
@Override
public HandlerRegistration addValueChangeHandler(ValueChangeHandler<Integer> handler) {
	return addHandler(handler, ValueChangeEvent.getType());
}
 
Example #21
Source File: DateRangePicker.java    From gwt-material-addins with Apache License 2.0 4 votes vote down vote up
@Override
public HandlerRegistration addOpenCalendarHandler(OpenCalendarEvent.OpenCalendarEventHandler handler) {
    return addHandler(handler, OpenCalendarEvent.getType());
}
 
Example #22
Source File: UniTimeFilterBox.java    From unitime with Apache License 2.0 4 votes vote down vote up
@Override
public HandlerRegistration addFocusHandler(FocusHandler handler) {
	return iFilter.getWidget().addFocusHandler(handler);
}
 
Example #23
Source File: DefaultHandlerRegistry.java    From gwt-material with Apache License 2.0 4 votes vote down vote up
@Override
public void removeHandler(HandlerRegistration registration) {
    if (registration != null) {
        registration.removeHandler();
    }
}
 
Example #24
Source File: CourseFinderFreeTime.java    From unitime with Apache License 2.0 4 votes vote down vote up
@Override
public HandlerRegistration addValueChangeHandler(ValueChangeHandler<RequestedCourse> handler) {
	return addHandler(handler, ValueChangeEvent.getType());
}
 
Example #25
Source File: LoadingStatePanel.java    From gwt-material-addins with Apache License 2.0 4 votes vote down vote up
@Override
public HandlerRegistration addErrorHandler(ErrorEvent.ErrorHandler handler) {
    return addHandler(handler, ErrorEvent.getType());
}
 
Example #26
Source File: Anchor.java    From putnami-web-toolkit with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public HandlerRegistration addKeyUpHandler(KeyUpHandler handler) {
	return this.addDomHandler(handler, KeyUpEvent.getType());
}
 
Example #27
Source File: Gallery.java    From gwtbootstrap3-extras with Apache License 2.0 4 votes vote down vote up
/**
 * Executed after the slide change transition.
 */
public HandlerRegistration addGallerySlideEndHandler(final GallerySlideEndHandler handler) {
    return addHandler(handler, GallerySlideEndEvent.getType());
}
 
Example #28
Source File: CourseFinderFreeTime.java    From unitime with Apache License 2.0 4 votes vote down vote up
@Override
public HandlerRegistration addResponseHandler(ResponseHandler handler) {
	return addHandler(handler, ResponseEvent.getType());
}
 
Example #29
Source File: CourseRequestBox.java    From unitime with Apache License 2.0 4 votes vote down vote up
@Override
public HandlerRegistration addValueChangeHandler(ValueChangeHandler<RequestedCourse> handler) {
	return addHandler(handler, ValueChangeEvent.getType());
}
 
Example #30
Source File: IntervalSelector.java    From unitime with Apache License 2.0 4 votes vote down vote up
@Override
public HandlerRegistration addValueChangeHandler(ValueChangeHandler<IntervalSelector<T>.Interval> handler) {
	return addHandler(handler, ValueChangeEvent.getType());
}