Community
Participate
Working Groups
This is related to Data-Binding Framework. In an RCP project, I encountered a missing feature that my client wants. It is required for several screens that use data-binding to update calculations off of text control values. The client wants calculations to get updated when hitting Enter or Carriage Return on a text control. Currently, they only get updated when tabbing off. I implemented a fix in TextObservableValue by updating the keyListener code: keyListener = new KeyListener() { public void keyPressed(KeyEvent e) { if (e.character == SWT.ESC && bufferedValue != null) { // Revert the value in the text field to the model value text.setText(bufferedValue); } // Begin new code String oldValue = bufferedValue; String newValue = text.getText(); if (e.character == '\r' || e.character == '\n') { if (!newValue.equals(oldValue)) { fireValueChange(Diffs.createValueDiff(oldValue, newValue)); } } // End new code } public void keyReleased(KeyEvent e) { } }; I would like to contribute this fix, but first, I would like to get your opinion on how to generalize this solution. For example: -Is it better to allow programmers to specify characters that fire-off data-binding events in a text control, or should we keep Enter and Carriage Return hard-coded? -What other widgets need this fix/customization? For example, editable combos are another candidate for this fix. -Is this already done elsewhere? Thank you, Andy
*** This bug has been marked as a duplicate of 156264 ***