Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/META-INF/MANIFEST.MF3
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFHelper.java20
2 files changed, 8 insertions, 15 deletions
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/META-INF/MANIFEST.MF b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/META-INF/MANIFEST.MF
index c47f94bfbcf..d973b997388 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/META-INF/MANIFEST.MF
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/META-INF/MANIFEST.MF
@@ -25,7 +25,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.infra.tools;bundle-version="0.9.0",
org.eclipse.emf.transaction;bundle-version="1.4.0",
org.eclipse.emf.ecore.xmi,
- org.eclipse.emf.facet.custom.metamodel;bundle-version="0.2.0"
+ org.eclipse.emf.facet.custom.metamodel;bundle-version="0.2.0",
+ org.eclipse.emf.facet.custom.ui;bundle-version="0.2.1"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.papyrus.infra.emf,
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFHelper.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFHelper.java
index de6ed68c372..da25b30f67c 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFHelper.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFHelper.java
@@ -39,9 +39,7 @@ import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.xmi.XMIResource;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.EAttributeTreeElement;
-import org.eclipse.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.EObjectTreeElement;
-import org.eclipse.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.EReferenceTreeElement;
+import org.eclipse.emf.facet.custom.ui.CustomizedContentProviderUtils;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers;
import org.eclipse.papyrus.infra.emf.Activator;
@@ -158,17 +156,11 @@ public class EMFHelper {
* if the EObject could not be resolved
*/
public static EObject getEObject(final Object source) {
- //Support for EMF 0.2 CustomizedTree: The TreeElements are EObjects, and do not implement IAdatapble.
- if(source instanceof EObjectTreeElement) {
- return ((EObjectTreeElement)source).getEObject();
- }
- if(source instanceof EAttributeTreeElement) {
- return ((EAttributeTreeElement)source).getEAttribute();
- }
-
- if(source instanceof EReferenceTreeElement) {
- return ((EReferenceTreeElement)source).getEReference();
+ //Support for EMF 0.2 CustomizedTree: The TreeElements are EObjects, and do not implement IAdatapble.
+ Object resolved = CustomizedContentProviderUtils.resolve(source);
+ if(resolved != source && resolved instanceof EObject) {
+ return (EObject)resolved;
}
//General case
@@ -176,7 +168,7 @@ public class EMFHelper {
return (EObject)source;
} else if(source instanceof IAdaptable) {
EObject eObject = (EObject)((IAdaptable)source).getAdapter(EObject.class);
- if(eObject == null) { //EMF Facet
+ if(eObject == null) { //EMF Facet 0.1
eObject = (EObject)((IAdaptable)source).getAdapter(EReference.class);
}
return eObject;

Back to the top