Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormgolubev2012-05-23 04:01:46 -0400
committermgolubev2012-05-23 04:01:46 -0400
commite5ada0ef9a604ab0e63a4d7638da7f6065d89665 (patch)
tree157140eed08ee5ad359e72532621cf5d3d7e41de
parenta835d75e5e5642020c4528f203442a1112856ee0 (diff)
downloadorg.eclipse.gmf-tooling-e5ada0ef9a604ab0e63a4d7638da7f6065d89665.tar.gz
org.eclipse.gmf-tooling-e5ada0ef9a604ab0e63a4d7638da7f6065d89665.tar.xz
org.eclipse.gmf-tooling-e5ada0ef9a604ab0e63a4d7638da7f6065d89665.zip
[380352] - fixed: UnuspportedOpertaionException due to
accidentally derived features
-rw-r--r--plugins/org.eclipse.gmf.codegen/models/gmfgen.ecore7
-rw-r--r--plugins/org.eclipse.gmf.codegen/models/gmfgen.emf4
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenCustomGeneratorExtension.java2
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenTemplateInvocationBase.java2
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenCustomGeneratorExtensionImpl.java48
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenEditorGeneratorImpl.java25
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenTemplateInvocationBaseImpl.java36
7 files changed, 98 insertions, 26 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/models/gmfgen.ecore b/plugins/org.eclipse.gmf.codegen/models/gmfgen.ecore
index 4a7426d07..1c6f7b6ee 100644
--- a/plugins/org.eclipse.gmf.codegen/models/gmfgen.ecore
+++ b/plugins/org.eclipse.gmf.codegen/models/gmfgen.ecore
@@ -2373,8 +2373,7 @@
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="GenCustomGeneratorExtension" eSuperTypes="#//GenCustomTemplateInput">
<eStructuralFeatures xsi:type="ecore:EReference" name="generator" lowerBound="1"
- eType="#//GenEditorGenerator" changeable="false" volatile="true" transient="true"
- derived="true" eOpposite="#//GenEditorGenerator/extensions"/>
+ eType="#//GenEditorGenerator" changeable="false" resolveProxies="false" eOpposite="#//GenEditorGenerator/extensions"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="User friendly name for this extension, used only in UI"/>
@@ -2404,8 +2403,8 @@
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="GenTemplateInvocationBase" abstract="true">
<eStructuralFeatures xsi:type="ecore:EReference" name="extension" lowerBound="1"
- eType="#//GenCustomGeneratorExtension" changeable="false" volatile="true"
- transient="true" derived="true" eOpposite="#//GenCustomGeneratorExtension/invocations"/>
+ eType="#//GenCustomGeneratorExtension" changeable="false" resolveProxies="false"
+ eOpposite="#//GenCustomGeneratorExtension/invocations"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="User friendly description for this invocation, used only in UI"/>
diff --git a/plugins/org.eclipse.gmf.codegen/models/gmfgen.emf b/plugins/org.eclipse.gmf.codegen/models/gmfgen.emf
index 9b3353180..9f963725d 100644
--- a/plugins/org.eclipse.gmf.codegen/models/gmfgen.emf
+++ b/plugins/org.eclipse.gmf.codegen/models/gmfgen.emf
@@ -1652,7 +1652,7 @@ class GenVisualEffect extends CustomBehaviour {
}
class GenCustomGeneratorExtension extends GenCustomTemplateInput {
- readonly volatile transient derived ref GenEditorGenerator[1]#extensions generator;
+ readonly !resolve ref GenEditorGenerator[1]#extensions generator;
@genmodel(documentation="User friendly name for this extension, used only in UI")
attr String name;
@@ -1671,7 +1671,7 @@ abstract interface GenCustomTemplateInput {
}
abstract class GenTemplateInvocationBase {
- readonly volatile transient derived ref GenCustomGeneratorExtension[1]#invocations extension;
+ readonly !resolve ref GenCustomGeneratorExtension[1]#invocations extension;
@genmodel(documentation="User friendly description for this invocation, used only in UI")
attr String description;
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenCustomGeneratorExtension.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenCustomGeneratorExtension.java
index 545efbfb5..925a93be1 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenCustomGeneratorExtension.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenCustomGeneratorExtension.java
@@ -39,7 +39,7 @@ public interface GenCustomGeneratorExtension extends GenCustomTemplateInput {
* @return the value of the '<em>Generator</em>' container reference.
* @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenCustomGeneratorExtension_Generator()
* @see org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator#getExtensions
- * @model opposite="extensions" required="true" changeable="false" volatile="true" derived="true"
+ * @model opposite="extensions" resolveProxies="false" required="true" transient="false" changeable="false"
* @generated
*/
GenEditorGenerator getGenerator();
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenTemplateInvocationBase.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenTemplateInvocationBase.java
index 7808f8570..1cb7358f1 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenTemplateInvocationBase.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenTemplateInvocationBase.java
@@ -35,7 +35,7 @@ public interface GenTemplateInvocationBase extends EObject {
* @return the value of the '<em>Extension</em>' container reference.
* @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenTemplateInvocationBase_Extension()
* @see org.eclipse.gmf.codegen.gmfgen.GenCustomGeneratorExtension#getInvocations
- * @model opposite="invocations" required="true" changeable="false" volatile="true" derived="true"
+ * @model opposite="invocations" resolveProxies="false" required="true" transient="false" changeable="false"
* @generated
*/
GenCustomGeneratorExtension getExtension();
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenCustomGeneratorExtensionImpl.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenCustomGeneratorExtensionImpl.java
index b6cc3cd8c..249b2a7ce 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenCustomGeneratorExtensionImpl.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenCustomGeneratorExtensionImpl.java
@@ -16,6 +16,7 @@ import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.gmf.codegen.gmfgen.GMFGenPackage;
@@ -113,6 +114,16 @@ public class GenCustomGeneratorExtensionImpl extends EObjectImpl implements GenC
protected EObject rootInput;
/**
+ * The cached value of the '{@link #getInvocations() <em>Invocations</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getInvocations()
+ * @generated
+ * @ordered
+ */
+ protected EList<GenTemplateInvocationBase> invocations;
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -158,9 +169,8 @@ public class GenCustomGeneratorExtensionImpl extends EObjectImpl implements GenC
* @generated
*/
public GenEditorGenerator getGenerator() {
- // TODO: implement this method to return the 'Generator' container reference
- // Ensure that you remove @generated or mark it @generated NOT
- throw new UnsupportedOperationException();
+ if (eContainerFeatureID() != GMFGenPackage.GEN_CUSTOM_GENERATOR_EXTENSION__GENERATOR) return null;
+ return (GenEditorGenerator)eContainer();
}
/**
@@ -249,11 +259,29 @@ public class GenCustomGeneratorExtensionImpl extends EObjectImpl implements GenC
* @generated
*/
public EList<GenTemplateInvocationBase> getInvocations() {
- // TODO: implement this method to return the 'Invocations' containment reference list
- // Ensure that you remove @generated or mark it @generated NOT
- // The list is expected to implement org.eclipse.emf.ecore.util.InternalEList and org.eclipse.emf.ecore.EStructuralFeature.Setting
- // so it's likely that an appropriate subclass of org.eclipse.emf.ecore.util.EcoreEList should be used.
- throw new UnsupportedOperationException();
+ if (invocations == null) {
+ invocations = new EObjectContainmentWithInverseEList<GenTemplateInvocationBase>(GenTemplateInvocationBase.class, this, GMFGenPackage.GEN_CUSTOM_GENERATOR_EXTENSION__INVOCATIONS, GMFGenPackage.GEN_TEMPLATE_INVOCATION_BASE__EXTENSION);
+ }
+ return invocations;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case GMFGenPackage.GEN_CUSTOM_GENERATOR_EXTENSION__GENERATOR:
+ if (eInternalContainer() != null)
+ msgs = eBasicRemoveFromContainer(msgs);
+ return eBasicSetContainer(otherEnd, GMFGenPackage.GEN_CUSTOM_GENERATOR_EXTENSION__GENERATOR, msgs);
+ case GMFGenPackage.GEN_CUSTOM_GENERATOR_EXTENSION__INVOCATIONS:
+ return ((InternalEList<InternalEObject>)(InternalEList<?>)getInvocations()).basicAdd(otherEnd, msgs);
+ }
+ return super.eInverseAdd(otherEnd, featureID, msgs);
}
/**
@@ -264,6 +292,8 @@ public class GenCustomGeneratorExtensionImpl extends EObjectImpl implements GenC
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
+ case GMFGenPackage.GEN_CUSTOM_GENERATOR_EXTENSION__GENERATOR:
+ return eBasicSetContainer(null, GMFGenPackage.GEN_CUSTOM_GENERATOR_EXTENSION__GENERATOR, msgs);
case GMFGenPackage.GEN_CUSTOM_GENERATOR_EXTENSION__INVOCATIONS:
return ((InternalEList<?>)getInvocations()).basicRemove(otherEnd, msgs);
}
@@ -384,7 +414,7 @@ public class GenCustomGeneratorExtensionImpl extends EObjectImpl implements GenC
case GMFGenPackage.GEN_CUSTOM_GENERATOR_EXTENSION__ROOT_INPUT:
return rootInput != null;
case GMFGenPackage.GEN_CUSTOM_GENERATOR_EXTENSION__INVOCATIONS:
- return !getInvocations().isEmpty();
+ return invocations != null && !invocations.isEmpty();
}
return super.eIsSet(featureID);
}
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenEditorGeneratorImpl.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenEditorGeneratorImpl.java
index 3d62e1d2e..b04078004 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenEditorGeneratorImpl.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenEditorGeneratorImpl.java
@@ -23,6 +23,7 @@ import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.gmf.codegen.gmfgen.DynamicModelAccess;
import org.eclipse.gmf.codegen.gmfgen.GMFGenPackage;
@@ -399,6 +400,16 @@ public class GenEditorGeneratorImpl extends EObjectImpl implements GenEditorGene
protected String pluginDirectory = PLUGIN_DIRECTORY_EDEFAULT;
/**
+ * The cached value of the '{@link #getExtensions() <em>Extensions</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getExtensions()
+ * @generated
+ * @ordered
+ */
+ protected EList<GenCustomGeneratorExtension> extensions;
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -1234,11 +1245,10 @@ public class GenEditorGeneratorImpl extends EObjectImpl implements GenEditorGene
* @generated
*/
public EList<GenCustomGeneratorExtension> getExtensions() {
- // TODO: implement this method to return the 'Extensions' containment reference list
- // Ensure that you remove @generated or mark it @generated NOT
- // The list is expected to implement org.eclipse.emf.ecore.util.InternalEList and org.eclipse.emf.ecore.EStructuralFeature.Setting
- // so it's likely that an appropriate subclass of org.eclipse.emf.ecore.util.EcoreEList should be used.
- throw new UnsupportedOperationException();
+ if (extensions == null) {
+ extensions = new EObjectContainmentWithInverseEList<GenCustomGeneratorExtension>(GenCustomGeneratorExtension.class, this, GMFGenPackage.GEN_EDITOR_GENERATOR__EXTENSIONS, GMFGenPackage.GEN_CUSTOM_GENERATOR_EXTENSION__GENERATOR);
+ }
+ return extensions;
}
public String getPluginDirectory() {
@@ -1295,6 +1305,7 @@ public class GenEditorGeneratorImpl extends EObjectImpl implements GenEditorGene
* <!-- end-user-doc -->
* @generated
*/
+ @SuppressWarnings("unchecked")
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
@@ -1346,6 +1357,8 @@ public class GenEditorGeneratorImpl extends EObjectImpl implements GenEditorGene
if (labelParsers != null)
msgs = ((InternalEObject)labelParsers).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GMFGenPackage.GEN_EDITOR_GENERATOR__LABEL_PARSERS, null, msgs);
return basicSetLabelParsers((GenParsers)otherEnd, msgs);
+ case GMFGenPackage.GEN_EDITOR_GENERATOR__EXTENSIONS:
+ return ((InternalEList<InternalEObject>)(InternalEList<?>)getExtensions()).basicAdd(otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
@@ -1677,7 +1690,7 @@ public class GenEditorGeneratorImpl extends EObjectImpl implements GenEditorGene
case GMFGenPackage.GEN_EDITOR_GENERATOR__PLUGIN_DIRECTORY:
return PLUGIN_DIRECTORY_EDEFAULT == null ? pluginDirectory != null : !PLUGIN_DIRECTORY_EDEFAULT.equals(pluginDirectory);
case GMFGenPackage.GEN_EDITOR_GENERATOR__EXTENSIONS:
- return !getExtensions().isEmpty();
+ return extensions != null && !extensions.isEmpty();
}
return super.eIsSet(featureID);
}
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenTemplateInvocationBaseImpl.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenTemplateInvocationBaseImpl.java
index 8f2c38c57..723342f36 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenTemplateInvocationBaseImpl.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenTemplateInvocationBaseImpl.java
@@ -7,6 +7,7 @@ import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
@@ -95,9 +96,8 @@ public abstract class GenTemplateInvocationBaseImpl extends EObjectImpl implemen
* @generated
*/
public GenCustomGeneratorExtension getExtension() {
- // TODO: implement this method to return the 'Extension' container reference
- // Ensure that you remove @generated or mark it @generated NOT
- throw new UnsupportedOperationException();
+ if (eContainerFeatureID() != GMFGenPackage.GEN_TEMPLATE_INVOCATION_BASE__EXTENSION) return null;
+ return (GenCustomGeneratorExtension)eContainer();
}
/**
@@ -148,6 +148,36 @@ public abstract class GenTemplateInvocationBaseImpl extends EObjectImpl implemen
* @generated
*/
@Override
+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case GMFGenPackage.GEN_TEMPLATE_INVOCATION_BASE__EXTENSION:
+ if (eInternalContainer() != null)
+ msgs = eBasicRemoveFromContainer(msgs);
+ return eBasicSetContainer(otherEnd, GMFGenPackage.GEN_TEMPLATE_INVOCATION_BASE__EXTENSION, msgs);
+ }
+ return super.eInverseAdd(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case GMFGenPackage.GEN_TEMPLATE_INVOCATION_BASE__EXTENSION:
+ return eBasicSetContainer(null, GMFGenPackage.GEN_TEMPLATE_INVOCATION_BASE__EXTENSION, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
switch (eContainerFeatureID()) {
case GMFGenPackage.GEN_TEMPLATE_INVOCATION_BASE__EXTENSION:

Back to the top