Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/NattablePropertyEditor.java')
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/NattablePropertyEditor.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/NattablePropertyEditor.java b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/NattablePropertyEditor.java
index 12827e3d84a..0b1ac32ff0c 100644
--- a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/NattablePropertyEditor.java
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/NattablePropertyEditor.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2015, 2016, 2017 CEA LIST, Christian W. Damus, and others.
+ * Copyright (c) 2015, 2016, 2017, 2021 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -12,7 +12,7 @@
* Nicolas FAUVERGUE (CEA LIST) nicolas.fauvergue@cea.fr - Initial API and implementation, Bug 502160, 494531
* Christian W. Damus - bugs 493858, 493853, 516310, 517313
* Vincent Lorenzo (CEA-LIST) vincent.lorenzo@cea.fr - bugs 494537, 504745
- *
+ * Asma SMAOUI (CEA LIST) - bug 573840, 573841
*****************************************************************************/
package org.eclipse.papyrus.uml.properties.widgets;
@@ -99,6 +99,8 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
import org.eclipse.ui.internal.views.properties.tabbed.view.TabbedPropertyComposite;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.util.UMLUtil;
/**
* The property editor for the nattable widget.
@@ -317,7 +319,14 @@ public class NattablePropertyEditor extends AbstractPropertyEditor {
sourceElement = eModelElement;
} else if (modelElement instanceof EMFModelElement) {
final EMFModelElement emfModelElement = (EMFModelElement) modelElement;
- sourceElement = emfModelElement.getSource();
+ EObject source = emfModelElement.getSource();
+ if (!(source instanceof Element)) {
+ final Element baseElement = UMLUtil.getBaseElement(source);
+ if (baseElement != null) {// in other case we will get an exeption somewhere
+ source = baseElement;
+ }
+ }
+ sourceElement = source;
feature = emfModelElement.getFeature(getLocalPropertyPath());
} else {
displayError("Invalid table context"); //$NON-NLS-1$
@@ -802,7 +811,8 @@ public class NattablePropertyEditor extends AbstractPropertyEditor {
}
table.setName(getLabel());
-
+ // for table used in property view, the kindId was null, because it is given by the AF. So we propose to use the type for kindId
+ table.setTableKindId(table.getTableConfiguration().getType());
AbstractAxisProvider rowProvider = tableConfiguration.getDefaultRowAxisProvider();
if (rowProvider == null) {
rowProvider = NattableaxisproviderFactory.eINSTANCE.createMasterObjectAxisProvider();

Back to the top