Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-06-30 13:00:58 +0000
committerCamille Letavernier2014-06-30 13:00:58 +0000
commit64d78c04c79d7f790bb65439f8f880e4ef3265c0 (patch)
treeb65819192aa4da47fa699468ff3e3320f183a3e5 /plugins
parenta8db868b58a7f1c07d1a6da4089c3af140060e09 (diff)
downloadorg.eclipse.papyrus-64d78c04c79d7f790bb65439f8f880e4ef3265c0.tar.gz
org.eclipse.papyrus-64d78c04c79d7f790bb65439f8f880e4ef3265c0.tar.xz
org.eclipse.papyrus-64d78c04c79d7f790bb65439f8f880e4ef3265c0.zip
435478: [Model Import] Opening activity diagram in imported model throws
an exception https://bugs.eclipse.org/bugs/show_bug.cgi?id=435478
Diffstat (limited to 'plugins')
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/ForceValueHelper.java24
1 files changed, 13 insertions, 11 deletions
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/ForceValueHelper.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/ForceValueHelper.java
index 30e94dc3e1d..99ef9912f8b 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/ForceValueHelper.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/ForceValueHelper.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2012, 2013 CEA LIST.
- *
+ *
* 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) - support adapter instead of custom resource impl for CSS (CDO)
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.css.notation;
@@ -25,30 +25,30 @@ import org.eclipse.papyrus.infra.gmfdiag.css.resource.CSSNotationResource;
* This helper handles the EAnnotation used to distinguish between an EMF
* "unset" value and a "default value" (Which cannot be distinguished for
* mandatory values in the standard EMF implementation).
- *
+ *
* The CSS support is only activated for properties which don't have a value.
* The problem is that in GMF, some properties always have a value, which
* would prevent the CSS from working.
- *
+ *
* Thus, we distinguish three cases:
- *
+ *
* - The property has a value different from the default value: isSet = true
* - The property has a value equal to the default value: isSet = false
* - The property has a value equal to the default value, and the ForceValue
* annotation is defined: isSet = true
- *
+ *
* unsetValue(object, feature) always results in isSet(object, feature) = false
* (Which is not always the EMF behavior)
- *
+ *
* In order not to contaminate default GMF Models, these methods are only
* applied if the resource is a CSSNotationResource. Otherwise, the behavior
* is the standard EMF/GMF one.
- *
+ *
* @author Camille Letavernier
*/
//FIXME: The default behavior when undoing a setValue() is set(previous),
//which may result in set(null) or set(default), instead of unset()
-//Thus, undoing a modification on a View may result in unexpected behavior
+//Thus, undoing a modification on a View may result in unexpected behavior
//(e.g., GMF default appearance instead of CSS style)
//Workaround: Use the "reset style" button to retrieve the correct CSS style
public class ForceValueHelper {
@@ -77,8 +77,10 @@ public class ForceValueHelper {
}
private static boolean isCSSView(View view) {
- // return false;
- return view != null && CSSNotationResource.isCSSEnabled(view.eResource());
+ //Bug 435478: In some (invalid) cases, the view can be outside a diagram.
+ //In this case, we cannot use the CSS support. We should exclude the views
+ //which are not associated to a diagram
+ return view != null && view.getDiagram() != null && CSSNotationResource.isCSSEnabled(view.eResource());
}
private static boolean equals(Object value1, Object value2) {

Back to the top