Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas FAUVERGUE2016-08-02 17:22:36 -0400
committerGerrit Code Review @ Eclipse.org2016-08-04 05:18:33 -0400
commitbfbf11f4764aebdb4f5b645e9bbb2ba72fb83186 (patch)
tree90d14e170fddd28d07a2c1afc9d2fdccec3c5c4a
parent65c602cc1757bf8ffbd390ef91a196b8969df317 (diff)
downloadorg.eclipse.papyrus-bfbf11f4764aebdb4f5b645e9bbb2ba72fb83186.tar.gz
org.eclipse.papyrus-bfbf11f4764aebdb4f5b645e9bbb2ba72fb83186.tar.xz
org.eclipse.papyrus-bfbf11f4764aebdb4f5b645e9bbb2ba72fb83186.zip
Bug 499002: [Property][Table] Table context updated with View instead of
semantic element https://bugs.eclipse.org/bugs/show_bug.cgi?id=499002 Modify the object to get the correct table context: - Element of View for NattablePropertyEditor - View for StereotypeDisplayNattablePropertyEditor Change-Id: I9cbcf849f1f439be130cfb82577377761d16f9b8 Signed-off-by: Nicolas FAUVERGUE <nicolas.fauvergue@all4tec.net>
-rw-r--r--plugins/sysml/properties/org.eclipse.papyrus.sysml.properties/META-INF/MANIFEST.MF2
-rw-r--r--plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/META-INF/MANIFEST.MF2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.symbols.properties/META-INF/MANIFEST.MF2
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.core/META-INF/MANIFEST.MF2
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/META-INF/MANIFEST.MF2
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties/META-INF/MANIFEST.MF2
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties/pom.xml2
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/NattablePropertyEditor.java18
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/StereotypeDisplayNattablePropertyEditor.java10
9 files changed, 34 insertions, 8 deletions
diff --git a/plugins/sysml/properties/org.eclipse.papyrus.sysml.properties/META-INF/MANIFEST.MF b/plugins/sysml/properties/org.eclipse.papyrus.sysml.properties/META-INF/MANIFEST.MF
index 33e06a8e6a5..7b74c1442e2 100644
--- a/plugins/sysml/properties/org.eclipse.papyrus.sysml.properties/META-INF/MANIFEST.MF
+++ b/plugins/sysml/properties/org.eclipse.papyrus.sysml.properties/META-INF/MANIFEST.MF
@@ -1,6 +1,6 @@
Manifest-Version: 1.0
Require-Bundle: org.eclipse.papyrus.infra.properties.ui;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.papyrus.uml.properties;bundle-version="[2.0.0,3.0.0)"
+ org.eclipse.papyrus.uml.properties;bundle-version="[2.1.0,3.0.0)"
Bundle-Vendor: %Bundle-Vendor
Bundle-ActivationPolicy: lazy
Bundle-Version: 1.2.0.qualifier
diff --git a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/META-INF/MANIFEST.MF b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/META-INF/MANIFEST.MF
index 2f55ccec322..0ef585754b6 100644
--- a/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/META-INF/MANIFEST.MF
+++ b/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.properties/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Require-Bundle: org.eclipse.papyrus.infra.properties.ui;bundle-version="[1.2.0,2.0.0)";visibility:=reexport,
org.eclipse.papyrus.uml.tools.utils;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.papyrus.uml.properties;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
+ org.eclipse.papyrus.uml.properties;bundle-version="[2.1.0,3.0.0)";visibility:=reexport,
org.eclipse.papyrus.uml.decoratormodel.ui;bundle-version="[1.2.0,2.0.0)"
Export-Package: org.eclipse.papyrus.uml.decoratormodel.internal.properties.constraints;x-internal:=true,
org.eclipse.papyrus.uml.decoratormodel.properties,
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.symbols.properties/META-INF/MANIFEST.MF b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.symbols.properties/META-INF/MANIFEST.MF
index 2ad7015ca76..fc9e95ca18f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.symbols.properties/META-INF/MANIFEST.MF
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.symbols.properties/META-INF/MANIFEST.MF
@@ -1,5 +1,5 @@
Manifest-Version: 1.0
-Require-Bundle: org.eclipse.papyrus.uml.properties;bundle-version="[2.0.0,3.0.0)",
+Require-Bundle: org.eclipse.papyrus.uml.properties;bundle-version="[2.1.0,3.0.0)",
org.eclipse.papyrus.infra.properties.ui;bundle-version="[1.2.0,2.0.0)",
org.eclipse.papyrus.uml.diagram.symbols;bundle-version="[1.2.0,2.0.0)"
Bundle-Vendor: Eclipse Modeling Project
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.core/META-INF/MANIFEST.MF b/plugins/uml/org.eclipse.papyrus.uml.types.core/META-INF/MANIFEST.MF
index 9429dec52a5..83892859b1a 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.types.core/META-INF/MANIFEST.MF
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.core/META-INF/MANIFEST.MF
@@ -1,6 +1,6 @@
Manifest-Version: 1.0
Require-Bundle: org.eclipse.uml2.uml.edit;bundle-version="[5.1.0,6.0.0)";visibility:=reexport,
- org.eclipse.papyrus.uml.properties;bundle-version="[2.0.0,3.0.0)",
+ org.eclipse.papyrus.uml.properties;bundle-version="[2.1.0,3.0.0)",
org.eclipse.papyrus.views.properties;bundle-version="[2.0.0,3.0.0)",
org.eclipse.papyrus.infra.types.rulebased;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
org.eclipse.papyrus.infra.emf.types;bundle-version="[2.0.0,3.0.0)",
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/META-INF/MANIFEST.MF b/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/META-INF/MANIFEST.MF
index 4538870c738..262016e8e51 100644
--- a/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/META-INF/MANIFEST.MF
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/META-INF/MANIFEST.MF
@@ -1,5 +1,5 @@
Manifest-Version: 1.0
-Require-Bundle: org.eclipse.papyrus.uml.properties;bundle-version="[2.0.0,3.0.0)",
+Require-Bundle: org.eclipse.papyrus.uml.properties;bundle-version="[2.1.0,3.0.0)",
org.eclipse.papyrus.infra.properties.ui;bundle-version="[1.2.0,2.0.0)",
org.eclipse.papyrus.uml.textedit.valuespecification.xtext.ui;bundle-version="[1.2.0,2.0.0)"
Bundle-Vendor: %providerName
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/META-INF/MANIFEST.MF b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/META-INF/MANIFEST.MF
index db26f338ea6..68ef2d6e969 100644
--- a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/META-INF/MANIFEST.MF
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/META-INF/MANIFEST.MF
@@ -31,7 +31,7 @@ Require-Bundle: org.eclipse.papyrus.uml.profile;bundle-version="[2.0.0,3.0.0)";v
org.eclipse.papyrus.uml.ui;bundle-version="[1.2.0,2.0.0)"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy;exclude:="org.eclipse.papyrus.uml.properties.constraints"
-Bundle-Version: 2.0.0.qualifier
+Bundle-Version: 2.1.0.qualifier
Bundle-Name: %pluginName
Bundle-Localization: plugin
Bundle-Activator: org.eclipse.papyrus.uml.properties.Activator
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/pom.xml b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/pom.xml
index 6be821c61e6..ce96e327cf8 100644
--- a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/pom.xml
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/pom.xml
@@ -7,6 +7,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.uml.properties</artifactId>
- <version>2.0.0-SNAPSHOT</version>
+ <version>2.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
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 ea261e38433..1ea642efaa7 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
@@ -1072,7 +1072,7 @@ public class NattablePropertyEditor extends AbstractPropertyEditor {
// Get the model element
if (0 < contexts.size()) {
final ModelElement modelElement = dataSource.getModelElement(propertyPath);
- EObject sourceElement = EMFHelper.getEObject(contexts.get(0));
+ EObject sourceElement = getEObjectAsTableContext(EMFHelper.getEObject(contexts.get(0)));
EStructuralFeature feature = null;
if (modelElement instanceof CompositeModelElement) {
if (!((CompositeModelElement) modelElement).getSubElements().isEmpty()) {
@@ -1097,6 +1097,22 @@ public class NattablePropertyEditor extends AbstractPropertyEditor {
}
/**
+ * This allows to get the table context as EObject (and avoid View).
+ *
+ * @param element
+ * The initial source element.
+ * @return The source element defining Table context.
+ * @since 2.1
+ */
+ protected EObject getEObjectAsTableContext(final EObject element) {
+ EObject result = element;
+ if (result instanceof View) {
+ result = ((View) result).getElement();
+ }
+ return result;
+ }
+
+ /**
*
* @param domain
* the editing domain to use
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/StereotypeDisplayNattablePropertyEditor.java b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/StereotypeDisplayNattablePropertyEditor.java
index c0d51e833a8..40ef541ca15 100644
--- a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/StereotypeDisplayNattablePropertyEditor.java
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/StereotypeDisplayNattablePropertyEditor.java
@@ -88,4 +88,14 @@ public class StereotypeDisplayNattablePropertyEditor extends TreeNattablePropert
}
return natTable;
}
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.uml.properties.widgets.NattablePropertyEditor#getEObjectAsTableContext(org.eclipse.emf.ecore.EObject)
+ */
+ @Override
+ protected EObject getEObjectAsTableContext(EObject element) {
+ return element;
+ }
}

Back to the top