@Override
 public void addAltTextHandler(TextBoxHandler handler) {
   tbAlt.addKeyPressHandler(handler);
   tbAlt.addKeyDownHandler(handler);
   tbAlt.addKeyUpHandler(handler);
   tbAlt.addFocusHandler(handler);
   tbAlt.addClickHandler(handler);
   tbAlt.addValueChangeHandler(handler);
 }
Exemplo n.º 2
0
  private void initHandlers() {
    // Listen for mouse events on the Add button.
    addStockButton.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            addStock();
          }
        });

    // Listen for keyboard events in the input box.
    newSymbolTextBox.addKeyDownHandler(
        new KeyDownHandler() {
          @Override
          public void onKeyDown(KeyDownEvent event) {
            if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
              addStock();
            }
          }
        });
  }