Skip to main content
summaryrefslogtreecommitdiffstats
path: root/jpa
diff options
context:
space:
mode:
authorbvosburgh2010-05-12 17:46:46 +0000
committerbvosburgh2010-05-12 17:46:46 +0000
commita162fa5666ece586486b55bcdce6dbe9fe45ab20 (patch)
tree8933d12d050d133f8d1fd2e2d0fb95acd680b82b /jpa
parentf345e075a96c99b2a2f74f1e6885a1e1aaf6b480 (diff)
downloadwebtools.dali-a162fa5666ece586486b55bcdce6dbe9fe45ab20.tar.gz
webtools.dali-a162fa5666ece586486b55bcdce6dbe9fe45ab20.tar.xz
webtools.dali-a162fa5666ece586486b55bcdce6dbe9fe45ab20.zip
[222258] problems with XML and text fields
Diffstat (limited to 'jpa')
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/utility/swt/TextFieldModelBinding.java25
1 files changed, 21 insertions, 4 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/utility/swt/TextFieldModelBinding.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/utility/swt/TextFieldModelBinding.java
index a2a8c867f7..5bb0c4e54f 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/utility/swt/TextFieldModelBinding.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/utility/swt/TextFieldModelBinding.java
@@ -59,6 +59,11 @@ class TextFieldModelBinding {
*/
private final DisposeListener textFieldDisposeListener;
+ /**
+ * Hmm...
+ */
+ private boolean settingTextFieldText = false;
+
// ********** constructor **********
@@ -139,11 +144,21 @@ class TextFieldModelBinding {
private void setTextFieldText(String text) {
// the text model can be null, but the text field cannot
- if (text == null) {
- text = "";
- }
+ this.setTextFieldText_((text == null) ? "" : text);
+ }
+
+ private void setTextFieldText_(String text) {
if ( ! text.equals(this.textField.getText())) { // ???
+ this.setTextFieldText__(text);
+ }
+ }
+
+ private void setTextFieldText__(String text) {
+ this.settingTextFieldText = true;
+ try {
this.textField.setText(text);
+ } finally {
+ this.settingTextFieldText = false;
}
}
@@ -151,7 +166,9 @@ class TextFieldModelBinding {
// ********** text field events **********
/* private */ void textFieldModified() {
- this.setTextModelText(this.textField.getText());
+ if ( ! this.settingTextFieldText) {
+ this.setTextModelText(this.textField.getText());
+ }
}
private void setTextModelText(String text) {

Back to the top