Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptessier2015-01-22 07:48:32 -0500
committerptessier2015-01-22 07:48:32 -0500
commit010f76be4f0b0f9f91a737ecb7f6af22061be6c1 (patch)
treea1f0749f1efc65ee72e0942ae94c50fe294e1837 /plugins
parent25a25bc8046b4b81a23667d4f4b34b0e6a8d5de3 (diff)
downloadorg.eclipse.papyrus-010f76be4f0b0f9f91a737ecb7f6af22061be6c1.tar.gz
org.eclipse.papyrus-010f76be4f0b0f9f91a737ecb7f6af22061be6c1.tar.xz
org.eclipse.papyrus-010f76be4f0b0f9f91a737ecb7f6af22061be6c1.zip
458104: [Model explorer] icon of stereotype is not displayed
https://bugs.eclipse.org/bugs/show_bug.cgi?id=458104 fixe the bug Change-Id: I57eca7af92c9b106b8c7c0d81ab570409c848556
Diffstat (limited to 'plugins')
-rw-r--r--plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/META-INF/MANIFEST.MF3
-rw-r--r--plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetImageQuery.java41
2 files changed, 5 insertions, 39 deletions
diff --git a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/META-INF/MANIFEST.MF b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/META-INF/MANIFEST.MF
index e95042a0c62..443b6677fc8 100644
--- a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/META-INF/MANIFEST.MF
+++ b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/META-INF/MANIFEST.MF
@@ -33,7 +33,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.emf.facet.custom.ui;bundle-version="1.1.0",
org.eclipse.papyrus.uml.tools.utils;bundle-version="1.1.0",
org.eclipse.papyrus.emf.facet.custom.core;bundle-version="1.1.0",
- org.eclipse.papyrus.infra.newchild;bundle-version="1.1.0"
+ org.eclipse.papyrus.infra.newchild;bundle-version="1.1.0",
+ org.eclipse.emf.edit.ui;bundle-version="2.11.0"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .,
diff --git a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetImageQuery.java b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetImageQuery.java
index ee4b55eec6d..afafb78478c 100644
--- a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetImageQuery.java
+++ b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetImageQuery.java
@@ -12,58 +12,23 @@
/*****************************************************************************/
package org.eclipse.papyrus.uml.modelexplorer.queries;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.papyrus.emf.facet.custom.metamodel.custompt.IImage;
import org.eclipse.papyrus.emf.facet.custom.ui.ImageUtils;
-import org.eclipse.papyrus.emf.facet.custom.ui.internal.query.ImageQuery;
import org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager;
import org.eclipse.papyrus.emf.facet.efacet.core.exception.DerivedTypedElementException;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.ParameterValue;
import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2;
import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2;
-import org.eclipse.papyrus.uml.tools.utils.ElementUtil;
+import org.eclipse.papyrus.uml.tools.providers.UMLLabelProvider;
import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Stereotype;
/** Create a basic label based on element name */
public class GetImageQuery implements IJavaQuery2<Element, IImage> {
// public static final String sysml_plugin_path = "platform:/plugin/org.eclipse.papyrus.sysml/";
-
+ private static UMLLabelProvider umlLabelProvider = new UMLLabelProvider();
// @Override
public IImage evaluate(Element source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
- ParameterValue parameterValue = parameterValues.getParameterValueByName("eObject");
- if (parameterValue.getValue() instanceof EStructuralFeature) {
- return ImageQuery.getEObjectImage((EStructuralFeature) parameterValue.getValue());
- }
-
- String iconPath = "";
- if (!source.getAppliedStereotypes().isEmpty()) {
- Stereotype first_stereotype = source.getAppliedStereotypes().get(0);
-
- if (!first_stereotype.getIcons().isEmpty()) {
- org.eclipse.uml2.uml.Image icon = ElementUtil.getStereotypeImage(source, first_stereotype, "icon");
- if (icon != null) {
- iconPath = icon.getLocation();
- }
- }
- }
-
- String imagePath = "";
-
- if (iconPath != null && !"".equals(iconPath)) {
- URI iconURI = URI.createURI(iconPath);
- // if(iconURI.isRelative()) {
- // imagePath = sysml_plugin_path + iconPath;
- // } else {
- imagePath = iconURI.toString();
- // }
- }
- if ("".equals(imagePath)) {
- return ImageQuery.getEObjectImage(source);
- }
- return ImageUtils.wrap(imagePath);
+ return ImageUtils.wrap(umlLabelProvider.getImage(source));
}
}

Back to the top