Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2015-05-27 09:03:56 -0400
committerCamille Letavernier2015-05-27 09:04:46 -0400
commit123b94cab9901091d692456475b6c8ea94842d2c (patch)
tree34f252a88c6850f7e3a59e3c41b12758407e7504
parent2e75551978e7b0da994662c5682bada6615cb240 (diff)
downloadorg.eclipse.papyrus-123b94cab9901091d692456475b6c8ea94842d2c.tar.gz
org.eclipse.papyrus-123b94cab9901091d692456475b6c8ea94842d2c.tar.xz
org.eclipse.papyrus-123b94cab9901091d692456475b6c8ea94842d2c.zip
468345: [CSS - Properties View] When creating a new ModelStyleSheet,
several commands are executed: need to undo several times https://bugs.eclipse.org/bugs/show_bug.cgi?id=468345 - Partial fix (See Bug 468345 / Comment 1) Change-Id: I64acb5dea67be212f2a56f910d65939da20b11fb Signed-off-by: Camille Letavernier <camille.letavernier@cea.fr>
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/creation/StyleSheetFactory.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/creation/StyleSheetFactory.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/creation/StyleSheetFactory.java
index 0b826f92253..708bc39b6a7 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/creation/StyleSheetFactory.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/creation/StyleSheetFactory.java
@@ -16,7 +16,9 @@ import java.util.Collection;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheet;
import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StylesheetsPackage;
+import org.eclipse.papyrus.infra.widgets.creation.IAtomicOperationExecutor;
import org.eclipse.papyrus.views.properties.creation.EcorePropertyEditorFactory;
import org.eclipse.swt.widgets.Control;
@@ -44,6 +46,26 @@ public class StyleSheetFactory extends EcorePropertyEditorFactory {
}
/**
+ * @see org.eclipse.papyrus.views.properties.creation.PropertyEditorFactory#getOperationExecutor(java.lang.Object)
+ *
+ * @param context
+ * @return
+ */
+ @Override
+ public IAtomicOperationExecutor getOperationExecutor(Object context) {
+ if (context instanceof StyleSheet) {
+ StyleSheet stylesheet = (StyleSheet) context;
+ if (stylesheet.eResource() == null) {
+ // Bug 468345: Use the current Notation::view instead, since we're creating the stylesheet in this object's resource
+ // Ensure that further edition occurs in a proper nested transaction
+ return super.getOperationExecutor(this.context);
+ }
+ }
+
+ return super.getOperationExecutor(context);
+ }
+
+ /**
* Return the objects as-is. The factory is not responsible for storing them
*/
@Override

Back to the top