Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2014-05-13 21:24:16 +0000
committerChristian W. Damus2014-05-13 21:25:51 +0000
commit024ff4619f9f11bbabf27707de66a16130a8dc64 (patch)
tree48f50b32dfa0affaf7594d49aa6d7fd39a46dc6c /plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel
parent12b9eb0b1a372b7d2044160f3a3a354a2a5e5447 (diff)
downloadorg.eclipse.papyrus-024ff4619f9f11bbabf27707de66a16130a8dc64.tar.gz
org.eclipse.papyrus-024ff4619f9f11bbabf27707de66a16130a8dc64.tar.xz
org.eclipse.papyrus-024ff4619f9f11bbabf27707de66a16130a8dc64.zip
434133: [ModelExplorer] ModelExplorer items should be IAdaptable
https://bugs.eclipse.org/bugs/show_bug.cgi?id=434133 Updates (mostly in test code) for change in Model Explorer tree elements no longer being EObjects.
Diffstat (limited to 'plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel')
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/internal/treeproxy/impl/EAttributeTreeElementImpl.java9
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/internal/treeproxy/impl/EReferenceTreeElementImpl.java9
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/internal/treeproxy/impl/EStructuralFeatureTreeElementImpl.java11
3 files changed, 24 insertions, 5 deletions
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/internal/treeproxy/impl/EAttributeTreeElementImpl.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/internal/treeproxy/impl/EAttributeTreeElementImpl.java
index ab7072e76d6..96da854b342 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/internal/treeproxy/impl/EAttributeTreeElementImpl.java
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/internal/treeproxy/impl/EAttributeTreeElementImpl.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2012 Mia-Software.
+ * Copyright (c) 2012, 2014 Mia-Software, CEA, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,10 +8,12 @@
* Contributors:
* Nicolas Bros (Mia-Software) - Bug 379683 - customizable Tree content provider
* Gregoire Dupe (Mia-Software) - Bug 386387 - [CustomizedTreeContentProvider] The TreeElements are not preserved between two calls to getElements()
+ * Christian W. Damus (CEA) - bug 434133
*/
package org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.impl;
import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.EAttributeTreeElement;
/**
@@ -45,5 +47,10 @@ public class EAttributeTreeElementImpl extends EStructuralFeatureTreeElementImpl
public void setEAttribute(EAttribute newEAttribute) {
eAttribute = newEAttribute;
}
+
+ @Override
+ protected EStructuralFeature getEStructuralFeature() {
+ return getEAttribute();
+ }
} //EAttributeTreeElementImpl
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/internal/treeproxy/impl/EReferenceTreeElementImpl.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/internal/treeproxy/impl/EReferenceTreeElementImpl.java
index f4cde724fb4..43b5c1d7be4 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/internal/treeproxy/impl/EReferenceTreeElementImpl.java
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/internal/treeproxy/impl/EReferenceTreeElementImpl.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2012 Mia-Software.
+ * Copyright (c) 2012, 2014 Mia-Software, CEA, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,11 +8,13 @@
* Contributors:
* Nicolas Bros (Mia-Software) - Bug 379683 - customizable Tree content provider
* Gregoire Dupe (Mia-Software) - Bug 386387 - [CustomizedTreeContentProvider] The TreeElements are not preserved between two calls to getElements()
+ * Christian W. Damus (CEA) - bug 434133
*/
package org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.impl;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.EObjectTreeElement;
import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.EReferenceTreeElement;
import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.TreeElement;
@@ -57,5 +59,10 @@ public class EReferenceTreeElementImpl extends EStructuralFeatureTreeElementImpl
public void setParent(EObjectTreeElement parent) {
super.setParent(parent);
}
+
+ @Override
+ protected EStructuralFeature getEStructuralFeature() {
+ return getEReference();
+ }
} //EReferenceTreeElementImpl
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/internal/treeproxy/impl/EStructuralFeatureTreeElementImpl.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/internal/treeproxy/impl/EStructuralFeatureTreeElementImpl.java
index 6d9d8dc11fa..3702493a8dc 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/internal/treeproxy/impl/EStructuralFeatureTreeElementImpl.java
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/internal/treeproxy/impl/EStructuralFeatureTreeElementImpl.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2012 Mia-Software.
+ * Copyright (c) 2012, 2014 Mia-Software, CEA, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
* Contributors:
* Nicolas Bros (Mia-Software) - Bug 379683 - customizable Tree content provider
* Gregoire Dupe (Mia-Software) - Bug 386387 - [CustomizedTreeContentProvider] The TreeElements are not preserved between two calls to getElements()
+ * Christian W. Damus (CEA) - bug 434133
*/
package org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.impl;
@@ -62,7 +63,7 @@ public class EStructuralFeatureTreeElementImpl extends TreeElementImpl implement
*/
public Object getAdapter(Class key) {
if(key == EStructuralFeature.Setting.class) { //Metamodel element
- EStructuralFeature.Setting result = new EStructuralFeature.Setting() {
+ return new EStructuralFeature.Setting() {
public void unset() {
getEObject().eUnset(getEStructuralFeature());
@@ -77,7 +78,7 @@ public class EStructuralFeatureTreeElementImpl extends TreeElementImpl implement
}
public EStructuralFeature getEStructuralFeature() {
- return getEStructuralFeature();
+ return EStructuralFeatureTreeElementImpl.this.getEStructuralFeature();
}
public EObject getEObject() {
@@ -102,6 +103,10 @@ public class EStructuralFeatureTreeElementImpl extends TreeElementImpl implement
return null;
}
+ protected EStructuralFeature getEStructuralFeature() {
+ throw new UnsupportedOperationException();
+ }
+
// The semantic EObject of a EReferenceTreeElement is the semantic EObject of it's parent (Which is an EObjectTreeElement)
protected EObject getEObject() {
TreeElement parent = getParent();

Back to the top