diff options
3 files changed, 7 insertions, 8 deletions
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/AdvancedEditingPropertySection.java b/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/AdvancedEditingPropertySection.java index b3f878687fc..f67c4a0f95e 100644 --- a/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/AdvancedEditingPropertySection.java +++ b/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/AdvancedEditingPropertySection.java @@ -106,6 +106,7 @@ public class AdvancedEditingPropertySection extends @Override
public void dispose() {
super.dispose();
+ ModelListener.currentEditor = null;
if (toolkit != null)
toolkit.dispose();
}
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/ModelListener.java b/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/ModelListener.java index 8e07a4391c7..db8d01c282b 100644 --- a/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/ModelListener.java +++ b/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/ModelListener.java @@ -19,18 +19,16 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener; /** - * Main listener for model changes (registered via plugin.xml). It will delegate - * to the sub-listeners for specific sub-elements (type, operation, port, ...) that - * can be found in this package - * - * @author ansgar - * + * Main listener for model changes (registered via plugin.xml). It will listen to + * change events. If an element that is a child of the element in use by the current editor + * changes, it will refresh */ public class ModelListener implements IPapyrusListener { public void notifyChanged(Notification notification) { Object notifier = notification.getNotifier(); - if (notifier instanceof EObject && currentEditor != null) { + if ((!notification.isTouch()) && + (notifier instanceof EObject) && (currentEditor != null)) { EObject notifierEObj = (EObject) notifier; while (notifierEObj != null) { if (notifierEObj == currentEditor.currentEObj) { diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext.ui/src/org/eclipse/papyrus/uml/textedit/property/xtext/ui/contributions/PropertyXtextDirectEditorConfiguration.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext.ui/src/org/eclipse/papyrus/uml/textedit/property/xtext/ui/contributions/PropertyXtextDirectEditorConfiguration.java index 98860acb908..65776cadde7 100644 --- a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext.ui/src/org/eclipse/papyrus/uml/textedit/property/xtext/ui/contributions/PropertyXtextDirectEditorConfiguration.java +++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext.ui/src/org/eclipse/papyrus/uml/textedit/property/xtext/ui/contributions/PropertyXtextDirectEditorConfiguration.java @@ -201,7 +201,7 @@ public class PropertyXtextDirectEditorConfiguration extends DefaultXtextDirectEd DestroyElementRequest destroyDefaultValueRequest = new DestroyElementRequest(property.getDefaultValue(), false); ICommand destroyDefaultValueCommand = provider.getEditCommand(destroyDefaultValueRequest); updateCommand.add(destroyDefaultValueCommand); - } else { + } else if (newDefault != null) { SetRequest setDefaultValueRequest = new SetRequest(property, UMLPackage.eINSTANCE.getProperty_Default(), newDefault); ICommand setDefaultValueCommand = provider.getEditCommand(setDefaultValueRequest); updateCommand.add(setDefaultValueCommand); |