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); } }
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(); } }