@@ -0,0 +1,1193 @@
+/**%0A * %3CLicense%3E%0A */%0Apackage edu.colorado.csdms.wmt.client.ui.handler;%0A%0Aimport com.google.gwt.event.dom.client.ClickHandler;%0Aimport com.google.gwt.event.dom.client.KeyCodes;%0Aimport com.google.gwt.event.dom.client.KeyDownEvent;%0Aimport com.google.gwt.event.dom.client.KeyDownHandler;%0A%0A/**%0A * Calls a %7B@link ClickHandler%7D when the %3Ccode%3EEnter%3C/code%3E or %3Ccode%3EEsc%3C/code%3E%0A * key is pressed.%0A * %0A * @author Mark Piper (mark.piper@colorado.edu)%0A */%0Apublic class ModalKeyHandler implements KeyDownHandler %7B%0A%0A  private ClickHandler okHandler;%0A  private ClickHandler cancelHandler;%0A%0A  /**%0A   * Creates a new %7B@link ModalKeyHandler%7D.%0A   * %0A   * @param okHandler the handler mapped to the %22OK%22 button%0A   * @param cancelHandler the handler mapped to the %22Cancel%22 button%0A   */%0A  public ModalKeyHandler(ClickHandler okHandler, ClickHandler cancelHandler) %7B%0A    this.okHandler = okHandler;%0A    this.cancelHandler = cancelHandler;%0A  %7D%0A%0A  @Override%0A  public void onKeyDown(KeyDownEvent event) %7B%0A    Integer keyCode = event.getNativeKeyCode();%0A    if (keyCode == KeyCodes.KEY_ESCAPE) %7B%0A      cancelHandler.onClick(null);%0A    %7D else if (keyCode == KeyCodes.KEY_ENTER) %7B%0A      okHandler.onClick(null);%0A    %7D%0A  %7D%0A%7D%0A

Add ModalKeyHandler to encapsulate "Esc" and "Enter" key presses