Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsgar Radermacher2014-03-11 10:28:53 +0000
committerAnsgar Radermacher2014-03-11 12:28:53 +0000
commit7189e085bbe7e64f027d4465bd92f1717c17d76b (patch)
treed19fb5bfdb05d9c98de226c856300c98087645b2 /plugins/uml
parentfcba042613d85123a02972df2f19874ab1eacbab (diff)
downloadorg.eclipse.papyrus-7189e085bbe7e64f027d4465bd92f1717c17d76b.tar.gz
org.eclipse.papyrus-7189e085bbe7e64f027d4465bd92f1717c17d76b.tar.xz
org.eclipse.papyrus-7189e085bbe7e64f027d4465bd92f1717c17d76b.zip
Bug 315231 - [All Diagrams] Direct Edit : Xtext / Papyrus integration - better handling of model listener in org.eclipse.papyrus.uml.properties.xtext
Diffstat (limited to 'plugins/uml')
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/AdvancedEditingPropertySection.java1
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/ModelListener.java12
-rw-r--r--plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext.ui/src/org/eclipse/papyrus/uml/textedit/property/xtext/ui/contributions/PropertyXtextDirectEditorConfiguration.java2
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);

Back to the top