Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Lorenzo2017-05-29 10:56:12 -0400
committervincent lorenzo2017-05-30 09:54:56 -0400
commit39f7d2536cae09f7f878705ea79861d9bf8d7e2a (patch)
tree5808947c1a8238ab386bf1e1ade133d45e85896b
parent0e722ac356f164cd48e9bc19b2da0e0b4bcb9dfd (diff)
downloadorg.eclipse.papyrus-39f7d2536cae09f7f878705ea79861d9bf8d7e2a.tar.gz
org.eclipse.papyrus-39f7d2536cae09f7f878705ea79861d9bf8d7e2a.tar.xz
org.eclipse.papyrus-39f7d2536cae09f7f878705ea79861d9bf8d7e2a.zip
Bug 517377: [Table][Property View][Profile] Literal value defined for EEnumLiteral stereotype is not used by Papyrus LabelProvider
Change-Id: I033163f3fe74f31e7fc5ae1e8d44935dd979bf70 Signed-off-by: Vincent Lorenzo <vincent.lorenzo@cea.fr>
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.ui.emf/src/org/eclipse/papyrus/infra/ui/emf/providers/StandardEMFLabelProvider.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.ui.emf/src/org/eclipse/papyrus/infra/ui/emf/providers/StandardEMFLabelProvider.java b/plugins/infra/emf/org.eclipse.papyrus.infra.ui.emf/src/org/eclipse/papyrus/infra/ui/emf/providers/StandardEMFLabelProvider.java
index 62b12fa7200..6610b2a43d0 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.ui.emf/src/org/eclipse/papyrus/infra/ui/emf/providers/StandardEMFLabelProvider.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.ui.emf/src/org/eclipse/papyrus/infra/ui/emf/providers/StandardEMFLabelProvider.java
@@ -11,7 +11,7 @@
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Added support for enum literals
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Implementation of IDetailLabelProvider
* Christian W. Damus - bug 474467
- *
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr, bug 517377
*******************************************************************************/
package org.eclipse.papyrus.infra.ui.emf.providers;
@@ -79,8 +79,9 @@ public class StandardEMFLabelProvider extends AdapterFactoryLabelProvider implem
protected String getText(EObject element) {
String title = ""; //$NON-NLS-1$
- if (element instanceof Enumerator) {
- return ((Enumerator) element).getName();
+
+ if (element instanceof Enumerator) {//we must return the literal instead of the name when it is available, see bug 517377
+ return (((Enumerator) element).getLiteral()==null || ((Enumerator) element).getLiteral().isEmpty()) ? ((Enumerator) element).getName() : ((Enumerator) element).getLiteral();
}
EObject eObject = EMFHelper.getEObject(element);
IItemLabelProvider itemLabelProvider = getItemLabelProvider(eObject);

Back to the top