Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas FAUVERGUE2017-06-30 09:55:09 +0000
committervincent lorenzo2017-07-04 19:16:38 +0000
commit4c40dbecd5b626c30722f2f8ef2f6b2fc46c9a34 (patch)
treecccffe30714c41701bb7a777bf1ac4fb3969ad70 /plugins/uml/nattable
parent82fdc5268c87082a72cfa8c759a113893e45a849 (diff)
downloadorg.eclipse.papyrus-4c40dbecd5b626c30722f2f8ef2f6b2fc46c9a34.tar.gz
org.eclipse.papyrus-4c40dbecd5b626c30722f2f8ef2f6b2fc46c9a34.tar.xz
org.eclipse.papyrus-4c40dbecd5b626c30722f2f8ef2f6b2fc46c9a34.zip
Bug 516782: [Table] Rename Header dialog doesn't display the real name
of the column object for properties of stereotype https://bugs.eclipse.org/bugs/show_bug.cgi?id=516782 - Implement the 'getElementAxisName' for the stereotype properties column. Change-Id: I929e6ceca73e95b371839ac73c83042ef339dd20 Signed-off-by: Nicolas FAUVERGUE <nicolas.fauvergue@cea.fr>
Diffstat (limited to 'plugins/uml/nattable')
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLStereotypePropertyAxisManager.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLStereotypePropertyAxisManager.java b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLStereotypePropertyAxisManager.java
index 0338e5cb4ea..7bcacd3c15c 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLStereotypePropertyAxisManager.java
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLStereotypePropertyAxisManager.java
@@ -30,6 +30,7 @@ import org.eclipse.papyrus.infra.emf.gmf.command.GMFtoEMFCommandWrapper;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.infra.nattable.manager.axis.IIdAxisManager;
import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
+import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxis.FeatureIdAxis;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxis.IAxis;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxis.IdAxis;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxis.NattableaxisFactory;
@@ -38,6 +39,7 @@ import org.eclipse.papyrus.infra.nattable.utils.AxisUtils;
import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
import org.eclipse.papyrus.infra.widgets.providers.IRestrictedContentProvider;
+import org.eclipse.papyrus.uml.internationalization.utils.utils.UMLLabelInternationalization;
import org.eclipse.papyrus.uml.nattable.provider.UMLStereotypeRestrictedPropertyContentProvider;
import org.eclipse.papyrus.uml.nattable.utils.Constants;
import org.eclipse.papyrus.uml.nattable.utils.UMLTableUtils;
@@ -290,5 +292,28 @@ public class UMLStereotypePropertyAxisManager extends UMLFeatureAxisManager impl
}
return null;
}
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.infra.emf.nattable.manager.axis.EStructuralFeatureAxisManager#getElementAxisName(org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxis.IAxis)
+ */
+ @Override
+ public String getElementAxisName(final IAxis axis) {
+ String returnedValue = null; // $NON-NLS-1$
+ if (axis instanceof FeatureIdAxis) {
+ String elementId = ((FeatureIdAxis) axis).getElement();
+ final Object resolvedElement = resolvedPath(elementId);
+ if (resolvedElement instanceof NamedElement) {
+ returnedValue = UMLLabelInternationalization.getInstance().getLabel((NamedElement) resolvedElement);
+ } else {
+ elementId = elementId.replace(Constants.PROPERTY_OF_STEREOTYPE_PREFIX, ""); //$NON-NLS-1$
+ final String[] splitedElementId = elementId.split("::"); //$NON-NLS-1$
+ returnedValue = splitedElementId[splitedElementId.length - 1];
+ }
+
+ }
+ return null != returnedValue ? returnedValue : super.getElementAxisName(axis);
+ }
}

Back to the top