Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfullbright2011-10-13 15:31:03 +0000
committerpfullbright2011-10-13 15:31:03 +0000
commit2a7aa88b12cd693a9986a0188b1bb23ddbdf1964 (patch)
tree9f1bcb3ae77d46395545763cce7663cdd369bdbe /jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt
parent7f49dcc945693757c1099d5166a65bafffce3e05 (diff)
downloadwebtools.dali-2a7aa88b12cd693a9986a0188b1bb23ddbdf1964.tar.gz
webtools.dali-2a7aa88b12cd693a9986a0188b1bb23ddbdf1964.tar.xz
webtools.dali-2a7aa88b12cd693a9986a0188b1bb23ddbdf1964.zip
fixed event suppression when one type changes, but not the other
Diffstat (limited to 'jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt')
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java27
1 files changed, 17 insertions, 10 deletions
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java
index e80dd85dfe..8a723c6430 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java
@@ -46,16 +46,22 @@ public final class SourceXmlJavaTypeAdapterAnnotation
private String value;
private String fullyQualifiedValue;
+ /*
+ * We want this event fired when the fq class changes by itself, not as a result
+ * of the non-fq class changing.
+ */
+ private boolean suppressFQValueEventNotification = false;
+
private final DeclarationAnnotationElementAdapter<String> typeDeclarationAdapter;
private final AnnotationElementAdapter<String> typeAdapter;
private String type;
private String fullyQualifiedType;
/*
- * We want these events fired when the fq classes change by themselves, not as a result
- * of the non-fq classes changing.
+ * We want this event fired when the fq class changes by itself, not as a result
+ * of the non-fq class changing.
*/
- private boolean suppressFQClassesEventNotification = false;
+ private boolean suppressFQTypeEventNotification = false;
// ********** constructors **********
@@ -114,7 +120,8 @@ public final class SourceXmlJavaTypeAdapterAnnotation
syncFullyQualifiedValue(buildFullyQualifiedValue(astRoot));
syncFullyQualifiedType(buildFullyQualifiedType(astRoot));
- this.suppressFQClassesEventNotification = false;
+ this.suppressFQValueEventNotification = false;
+ this.suppressFQTypeEventNotification = false;
}
@Override
@@ -133,7 +140,7 @@ public final class SourceXmlJavaTypeAdapterAnnotation
public void setValue(String value) {
if (this.attributeValueHasChanged(this.value, value)) {
this.value = value;
- this.suppressFQClassesEventNotification = true;
+ this.suppressFQValueEventNotification = true;
this.valueAdapter.setValue(value);
}
}
@@ -141,7 +148,7 @@ public final class SourceXmlJavaTypeAdapterAnnotation
private void syncValue(String astValue) {
String old = this.value;
this.value = astValue;
- this.suppressFQClassesEventNotification |= StringTools.stringsAreEqual(old, astValue);
+ this.suppressFQValueEventNotification |= StringTools.stringsAreEqual(old, astValue);
this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
}
@@ -160,7 +167,7 @@ public final class SourceXmlJavaTypeAdapterAnnotation
private void syncFullyQualifiedValue(String name) {
String old = this.fullyQualifiedValue;
this.fullyQualifiedValue = name;
- if (! this.suppressFQClassesEventNotification) {
+ if (! this.suppressFQValueEventNotification) {
this.firePropertyChanged(FULLY_QUALIFIED_VALUE_PROPERTY, old, name);
}
}
@@ -177,7 +184,7 @@ public final class SourceXmlJavaTypeAdapterAnnotation
public void setType(String type) {
if (this.attributeValueHasChanged(this.type, type)) {
this.type = type;
- this.suppressFQClassesEventNotification = true;
+ this.suppressFQTypeEventNotification = true;
this.typeAdapter.setValue(type);
}
}
@@ -185,7 +192,7 @@ public final class SourceXmlJavaTypeAdapterAnnotation
private void syncType(String astType) {
String old = this.type;
this.type = astType;
- this.suppressFQClassesEventNotification |= StringTools.stringsAreEqual(old, astType);
+ this.suppressFQTypeEventNotification |= StringTools.stringsAreEqual(old, astType);
this.firePropertyChanged(TYPE_PROPERTY, old, astType);
}
@@ -204,7 +211,7 @@ public final class SourceXmlJavaTypeAdapterAnnotation
private void syncFullyQualifiedType(String name) {
String old = this.fullyQualifiedType;
this.fullyQualifiedType = name;
- if (! this.suppressFQClassesEventNotification) {
+ if (! this.suppressFQTypeEventNotification) {
this.firePropertyChanged(FULLY_QUALIFIED_TYPE_PROPERTY, old, name);
}
}

Back to the top