Exemple #1
0
 public void onKeyPress(KeyPressEvent event) {
   for (KeyPressPreviewHandler handler : keyPressPreviewHandlers_) {
     if (handler.previewKeyPress(event.getCharCode())) {
       event.preventDefault();
       event.stopPropagation();
       return;
     }
   }
 }
 @UiHandler("message")
 void onMessageKey(KeyPressEvent event) {
   if ((event.getCharCode() == '\n' || event.getCharCode() == KeyCodes.KEY_ENTER)
       && event.isControlKeyDown()) {
     event.preventDefault();
     event.stopPropagation();
     onSend(null);
   }
 }
Exemple #3
0
    public void onKeyPress(KeyPressEvent event) {
      // hide pattern field/label, turn off star
      if (event.getCharCode() == KeyCodes.KEY_ENTER) {
        return;
      }

      patternNameLabel.setText("");
      patternNameLabel.setVisible(false);
      patternNameField.setValue("", true);
      patternNameField.setVisible(false);
      currentSearchId = 0;
      starImage.setUrl(STAR_OFF_URL);

      if (event.getCharCode() == KeyCodes.KEY_ESCAPE) {
        autoCompletePatternField.hideSuggestionList();
        event.preventDefault();
        event.stopPropagation();
      }
    }
    public void onKeyPress(KeyPressEvent e) {
      // iOS: we do receive the event but nothing is actually printed
      // because focus moved from dummy textarea into editor

      final String charcode = e.getCharCode() + "";
      if (MyCellEditorW.this.allowAutoEdit) {
        app.getGuiManager()
            .invokeLater(
                new Runnable() {

                  public void run() {
                    String text = autoCompleteTextField.getText();
                    if (text == null || text.length() == 0) {
                      autoCompleteTextField.setText(charcode);
                    }
                  }
                });
        MyCellEditorW.this.allowAutoEdit = false;
      }

      // stopping propagation is needed to prevent
      // the prevention of the default action at another place
      e.stopPropagation();
    }