Example usage for com.google.gwt.event.dom.client HasKeyDownHandlers addKeyDownHandler

List of usage examples for com.google.gwt.event.dom.client HasKeyDownHandlers addKeyDownHandler

Introduction

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

Prototype

HandlerRegistration addKeyDownHandler(KeyDownHandler handler);

Source Link

Document

Adds a KeyDownEvent handler.

Usage

From source file:com.threerings.gwt.ui.EnterClickAdapter.java

License:Open Source License

/**
 * Binds a listener to the supplied target text box that triggers the supplied click handler
 * when enter is pressed on the text box.
 *///from w w  w .  j a v  a  2s  . c o m
public static HandlerRegistration bind(HasKeyDownHandlers target, ClickHandler onEnter) {
    return target.addKeyDownHandler(new EnterClickAdapter(onEnter));
}

From source file:org.rstudio.studio.client.workbench.views.source.NewPlumberAPI.java

License:Open Source License

private void addTextFieldValidator(HasKeyDownHandlers widget) {
    widget.addKeyDownHandler(new KeyDownHandler() {
        @Override/*from ww  w .  ja v a 2s .c om*/
        public void onKeyDown(KeyDownEvent event) {
            Scheduler.get().scheduleDeferred(new ScheduledCommand() {
                @Override
                public void execute() {
                    validateAPIName();
                }
            });
        }
    });
}

From source file:org.rstudio.studio.client.workbench.views.source.NewShinyWebApplication.java

License:Open Source License

private void addTextFieldValidator(HasKeyDownHandlers widget) {
    widget.addKeyDownHandler(new KeyDownHandler() {
        @Override//from   www . j a va  2 s.co  m
        public void onKeyDown(KeyDownEvent event) {
            Scheduler.get().scheduleDeferred(new ScheduledCommand() {
                @Override
                public void execute() {
                    validateAppName();
                }
            });
        }
    });
}