From 0a2c4ede957f26a57655e9af8d082c78c6c75c0e Mon Sep 17 00:00:00 2001 From: Christian W. Damus Date: Mon, 26 Jan 2015 10:00:16 -0500 Subject: 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. --- .../properties/modelelement/CustomStyleModelElement.java | 6 +++--- .../modelelement/CustomStyleModelElementFactory.java | 14 +++++++++++++- 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; + } + } -- cgit v1.2.3