Example usage for com.google.gwt.event.dom.client BlurHandler onBlur

List of usage examples for com.google.gwt.event.dom.client BlurHandler onBlur

Introduction

In this page you can find the example usage for com.google.gwt.event.dom.client BlurHandler onBlur.

Prototype

void onBlur(BlurEvent event);

Source Link

Document

Called when BlurEvent is fired.

Usage

From source file:gwt.material.design.addins.client.autocomplete.MaterialAutoComplete.java

License:Apache License

@Override
public HandlerRegistration addBlurHandler(BlurHandler handler) {
    return itemBox.addHandler(blurEvent -> {
        if (isEnabled()) {
            handler.onBlur(blurEvent);
        }//from   w  w  w  .j  a  v  a 2 s  .  c  o  m
    }, BlurEvent.getType());
}

From source file:gwt.material.design.client.ui.MaterialListValueBox.java

License:Apache License

@Override
public HandlerRegistration addBlurHandler(final BlurHandler handler) {
    return addDomHandler(new BlurHandler() {
        @Override//from   w  w w.  j a v  a2s.  c  o m
        public void onBlur(BlurEvent event) {
            if (isEnabled()) {
                handler.onBlur(event);
            }
        }
    }, BlurEvent.getType());
}

From source file:gwt.material.design.components.client.base.widget.MaterialWidget.java

License:Apache License

@Override
public HandlerRegistration addBlurHandler(BlurHandler handler) {
    return addDomHandler(event -> {
        if (isEnabled())
            handler.onBlur(event);
    }, BlurEvent.getType());/* www  .j  av a 2  s  .  c  o  m*/
}

From source file:org.jbpm.form.builder.ng.model.common.handler.EventHelper.java

License:Apache License

protected static void onBlurEvent(final Widget widget, Event event) {
    BlurEvent bevent = new BlurEvent() {
        @Override//from  w  ww  .  j av a  2 s  . co m
        public Object getSource() {
            return widget;
        }
    };
    bevent.setNativeEvent(event);
    List<BlurHandler> handlers = BLUR_HANDLERS.get(widget);
    if (handlers != null) {
        for (BlurHandler handler : handlers) {
            handler.onBlur(bevent);
        }
    }
}

From source file:org.rstudio.core.client.widget.TextBoxWithCue.java

License:Open Source License

private void hookEvents() {
    unhookEvents();/*from  w w  w. j ava 2s  .c  o m*/

    FocusHandler focusHandler = new FocusHandler() {
        public void onFocus(FocusEvent event) {
            if (DomUtils.hasFocus(getElement())) {
                if (isCueMode()) {
                    setText("");
                    removeStyleName(CUE_STYLE);
                }
            }
        }
    };

    BlurHandler blurHandler = new BlurHandler() {
        public void onBlur(BlurEvent event) {
            if (getText().length() == 0) {
                addStyleName(CUE_STYLE);
                setText(cueText_);
            }
        }
    };

    registrations_ = new HandlerRegistration[] { addFocusHandler(focusHandler), addBlurHandler(blurHandler),
            WindowEx.addFocusHandler(focusHandler), WindowEx.addBlurHandler(blurHandler) };

    blurHandler.onBlur(null);
}