Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas FAUVERGUE2015-12-17 15:52:07 +0000
committerGerrit Code Review @ Eclipse.org2016-01-12 10:33:09 +0000
commitd66e1e7a7ea0b40e92e0cd8b229c838c4f3352fa (patch)
treebee98d0079ea4ca89d6f9c2f6354417ddd8d144a /plugins/uml
parentecc50be1e9ca87a131c4c85218a63aae99f3c8e0 (diff)
downloadorg.eclipse.papyrus-d66e1e7a7ea0b40e92e0cd8b229c838c4f3352fa.tar.gz
org.eclipse.papyrus-d66e1e7a7ea0b40e92e0cd8b229c838c4f3352fa.tar.xz
org.eclipse.papyrus-d66e1e7a7ea0b40e92e0cd8b229c838c4f3352fa.zip
Bug 484211: [Property View - Table] The table context is not correctly
refreshed https://bugs.eclipse.org/bugs/show_bug.cgi?id=484211 Manage the source element from the selection. Change-Id: I338f82401c7e98d4a335cbf63cab816675fb60c2 Signed-off-by: Nicolas FAUVERGUE <nicolas.fauvergue@all4tec.net>
Diffstat (limited to 'plugins/uml')
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/NattablePropertyEditor.java36
1 files changed, 16 insertions, 20 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 7ce47621ae6..4de832360c1 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
@@ -470,29 +470,25 @@ public class NattablePropertyEditor extends AbstractPropertyEditor {
}
// Get the model element
- final ModelElement modelElement = dataSource.getModelElement(propertyPath);
- EObject sourceElement = null;
- EStructuralFeature feature = null;
- if (modelElement instanceof CompositeModelElement) {
- if (!((CompositeModelElement) modelElement).getSubElements().isEmpty()) {
- if (((CompositeModelElement) modelElement).getSubElements().get(0) instanceof UMLNotationModelElement) {
- sourceElement = ((UMLNotationModelElement) ((CompositeModelElement) modelElement).getSubElements().get(0)).getEModelElement();
- } else if (((CompositeModelElement) modelElement).getSubElements().get(0) instanceof EMFModelElement) {
- final EMFModelElement emfModelElement = (EMFModelElement) ((CompositeModelElement) modelElement).getSubElements().get(0);
- sourceElement = emfModelElement.getSource();
- feature = emfModelElement.getFeature(getLocalPropertyPath());
+ if(0 < contexts.size()){
+ final ModelElement modelElement = dataSource.getModelElement(propertyPath);
+ EObject sourceElement = EMFHelper.getEObject(contexts.get(0));
+ EStructuralFeature feature = null;
+ if (modelElement instanceof CompositeModelElement) {
+ if (!((CompositeModelElement) modelElement).getSubElements().isEmpty()) {
+ if (((CompositeModelElement) modelElement).getSubElements().get(0) instanceof EMFModelElement) {
+ final EMFModelElement emfModelElement = (EMFModelElement) ((CompositeModelElement) modelElement).getSubElements().get(0);
+ feature = emfModelElement.getFeature(getLocalPropertyPath());
+ }
}
+ } else if (modelElement instanceof EMFModelElement) {
+ final EMFModelElement emfModelElement = (EMFModelElement) modelElement;
+ feature = emfModelElement.getFeature(getLocalPropertyPath());
}
- } else if (modelElement instanceof UMLNotationModelElement) {
- sourceElement = ((UMLNotationModelElement) modelElement).getEModelElement();
- } else if (modelElement instanceof EMFModelElement) {
- final EMFModelElement emfModelElement = (EMFModelElement) modelElement;
- sourceElement = emfModelElement.getSource();
- feature = emfModelElement.getFeature(getLocalPropertyPath());
- }
- // Recreate the table widget
- createTableWidget(sourceElement, feature, contexts);
+ // Recreate the table widget
+ createTableWidget(sourceElement, feature, contexts);
+ }
}
};
}

Back to the top