Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Coutable2016-11-25 14:30:41 +0000
committerMaxime Porhel2016-12-22 11:22:34 +0000
commitb2ea5a03a120f8e71ae812f1e147c8fd7c2c19ee (patch)
tree2e64c534a4c37bbd0f7d1f0a75cc3a2d636f8de6
parenteaeb3d3ce14dd5d29d5916517bf8c302e3e93974 (diff)
downloadorg.eclipse.sirius-b2ea5a03a120f8e71ae812f1e147c8fd7c2c19ee.tar.gz
org.eclipse.sirius-b2ea5a03a120f8e71ae812f1e147c8fd7c2c19ee.tar.xz
org.eclipse.sirius-b2ea5a03a120f8e71ae812f1e147c8fd7c2c19ee.zip
[508191] Wrong image for representation containing dangling
The key for image cache is more precise by including the description class name Bug: 508191 Change-Id: I106dc3cf3dfc1b7ef8ebd420151ad6226c268bc6 Signed-off-by: Guillaume Coutable <guillaume.coutable@obeo.fr> Signed-off-by: Maxime Porhel <maxime.porhel@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/common/navigator/SiriusCommonLabelProvider.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/common/navigator/SiriusCommonLabelProvider.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/common/navigator/SiriusCommonLabelProvider.java
index 613d000430..28fb745a9e 100644
--- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/common/navigator/SiriusCommonLabelProvider.java
+++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/common/navigator/SiriusCommonLabelProvider.java
@@ -44,6 +44,7 @@ import org.eclipse.sirius.ui.tools.internal.views.common.SessionLabelProvider;
import org.eclipse.sirius.viewpoint.DRepresentation;
import org.eclipse.sirius.viewpoint.DRepresentationDescriptor;
import org.eclipse.sirius.viewpoint.DSemanticDecorator;
+import org.eclipse.sirius.viewpoint.description.RepresentationDescription;
import org.eclipse.sirius.viewpoint.provider.SiriusEditPlugin;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
@@ -97,8 +98,17 @@ public class SiriusCommonLabelProvider implements ICommonLabelProvider, IColorPr
// If the current element is a dangling representation, its icon
// is grayed. The grayed image is computed only once for each
// type of representation.
- if (img != null && isDanglingRepresentationDescriptor(element)) {
- String key = DRepresentationDescriptor.class.getName() + DISABLED_REPRESENTATION_SUFFIX;
+ DRepresentationDescriptor descRep = getRepresentationDescriptor(element);
+ if (img != null && descRep != null && isDanglingRepresentationDescriptor(descRep)) {
+ StringBuilder sB = new StringBuilder();
+ sB.append(descRep.getClass().getName());
+ RepresentationDescription description = descRep.getDescription();
+ if (description != null) {
+ sB.append('_');
+ sB.append(description.getClass().getName());
+ sB.append(DISABLED_REPRESENTATION_SUFFIX);
+ }
+ String key = sB.toString();
Image disabledImage = SiriusEditPlugin.getPlugin().getImageRegistry().get(key);
if (disabledImage == null) {
ImageDescriptor desc = ImageDescriptor.createFromImage(img);

Back to the top