Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-03-27 12:24:29 -0400
committerCamille Letavernier2014-03-27 12:24:29 -0400
commit8219c110e97ae2b3be22738cf470a3e4281c4a73 (patch)
treef0d24ce0d267427333b38d0bc608ed3851a2fdd8 /plugins
parent1eb28d11e147be4960464706bf4977277889c6aa (diff)
downloadorg.eclipse.papyrus-8219c110e97ae2b3be22738cf470a3e4281c4a73.tar.gz
org.eclipse.papyrus-8219c110e97ae2b3be22738cf470a3e4281c4a73.tar.xz
org.eclipse.papyrus-8219c110e97ae2b3be22738cf470a3e4281c4a73.zip
431366: [CSS] The CSS Theme is not taken into account when the model is
deployed in a plug-in https://bugs.eclipse.org/bugs/show_bug.cgi?id=431366 - Fix the ProjectCSSEngine - Fix the showCompartmentTitle test (Don't use Commands as there is no EditingDomain)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ModelCSSEngine.java24
1 files changed, 14 insertions, 10 deletions
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ModelCSSEngine.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ModelCSSEngine.java
index 901717f2adb..a14cb2dfdbf 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ModelCSSEngine.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ModelCSSEngine.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2012, 2014 CEA LIST and others.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,7 +9,7 @@
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Christian W. Damus (CEA) - bug 429422
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.css.engine;
@@ -30,11 +30,11 @@ import org.w3c.dom.Element;
/**
* An extended CSS Engine for an EMF Resource (A Model). This engine
* is a child of the WorkspaceCSSEngine.
- *
+ *
* It should not be used directly.
- *
+ *
* @author Camille Letavernier
- *
+ *
* @see DiagramCSSEngine
*/
@SuppressWarnings("restriction")
@@ -44,19 +44,23 @@ public class ModelCSSEngine extends ExtendedCSSEngineImpl {
/**
* Creates a ModelCSSEngine for the requested resource.
- *
+ *
* @param model
*/
public ModelCSSEngine(Resource model) {
- super(getProjectCSSEngine(model));
+ super(getParentCSSEngine(model));
this.model = model;
}
- private static ExtendedCSSEngine getProjectCSSEngine(Resource resource) {
+ private static ExtendedCSSEngine getParentCSSEngine(Resource resource) {
+ ExtendedCSSEngine result;
if(resource instanceof CSSNotationResource) {
- return ((CSSNotationResource)resource).getProjectEngine();
+ result = ((CSSNotationResource)resource).getProjectEngine();
+ } else {
+ result = ProjectCSSEngine.createEngine(resource);
}
- return ProjectCSSEngine.createEngine(resource);
+
+ return result == null ? WorkspaceCSSEngine.instance : result;
}
@Override

Back to the top