Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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