Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2015-01-26 10:00:16 -0500
committerChristian W. Damus2015-01-26 10:06:39 -0500
commit0a2c4ede957f26a57655e9af8d082c78c6c75c0e (patch)
treefbf4f997630570168f5904062dbfd8d96adf3bc5
parent707d2aa9279a909e28c1e3d59eda32f929c952a3 (diff)
downloadorg.eclipse.papyrus-0a2c4ede957f26a57655e9af8d082c78c6c75c0e.tar.gz
org.eclipse.papyrus-0a2c4ede957f26a57655e9af8d082c78c6c75c0e.tar.xz
org.eclipse.papyrus-0a2c4ede957f26a57655e9af8d082c78c6c75c0e.zip
455075: [Properties View] Providers instantiated from DataSource are never updated.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=455075 Ensure that CSS model-elements are updated properly to recompute the GMF notation views from which they derive their properties when the selection changes.
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/CustomStyleModelElement.java6
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/CustomStyleModelElementFactory.java14
2 files changed, 16 insertions, 4 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/CustomStyleModelElement.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/CustomStyleModelElement.java
index 3e09b14e723..2f8b01ec06e 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/CustomStyleModelElement.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/CustomStyleModelElement.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2012, 2014 CEA LIST and others.
+ * Copyright (c) 2012, 2015 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -9,6 +9,7 @@
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Christian W. Damus (CEA) - bug 323802
+ * Christian W. Damus - bug 455075
*
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.properties.modelelement;
@@ -38,8 +39,7 @@ public class CustomStyleModelElement extends EMFModelElement {
private DataContextElement element;
- // this.view == super.source
- private View view;
+ View view;
public CustomStyleModelElement(View source, DataContextElement context) {
this(source, null, context);
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/CustomStyleModelElementFactory.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/CustomStyleModelElementFactory.java
index 1a224adc6e5..fbe32d88ed5 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/CustomStyleModelElementFactory.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/CustomStyleModelElementFactory.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2012, 2014 CEA LIST and others.
+ * Copyright (c) 2012, 2015 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -9,6 +9,7 @@
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Christian W. Damus (CEA) - bug 417409
+ * Christian W. Damus - bug 455075
*
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.properties.modelelement;
@@ -37,4 +38,15 @@ public class CustomStyleModelElementFactory extends AbstractEMFModelElementFacto
return null;
}
+ @Override
+ protected void updateModelElement(CustomStyleModelElement modelElement, Object newSourceElement) {
+ View view = NotationHelper.findView(newSourceElement);
+ if (view == null) {
+ throw new IllegalArgumentException("Cannot resolve GMF notation view selection: " + newSourceElement);
+ }
+
+ updateEMFModelElement(modelElement, view);
+ modelElement.view = view;
+ }
+
}

Back to the top