[369789] Ensure that setting the type is undoable
diff --git a/features/org.eclipse.emf.ecore.edit-feature/feature.xml b/features/org.eclipse.emf.ecore.edit-feature/feature.xml index 7054470..1708582 100644 --- a/features/org.eclipse.emf.ecore.edit-feature/feature.xml +++ b/features/org.eclipse.emf.ecore.edit-feature/feature.xml
@@ -1,52 +1,52 @@ -<?xml version="1.0" encoding="UTF-8"?> -<feature - id="org.eclipse.emf.ecore.edit" - label="%featureName" - version="2.7.0.qualifier" - provider-name="%providerName" - license-feature="org.eclipse.emf.license" - license-feature-version="2.7.0.qualifier"> - - <description> - %description - </description> - - <copyright url="http://www.eclipse.org/legal/epl-v10.html"> +<?xml version="1.0" encoding="UTF-8"?> +<feature + id="org.eclipse.emf.ecore.edit" + label="%featureName" + version="2.7.1.qualifier" + provider-name="%providerName" + license-feature="org.eclipse.emf.license" + license-feature-version="2.7.0.qualifier"> + + <description> + %description + </description> + + <copyright url="http://www.eclipse.org/legal/epl-v10.html"> Copyright (c) 2002-2011 IBM Corporation 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 -http://www.eclipse.org/legal/epl-v10.html - </copyright> - - <license url="%licenseURL"> - %license - </license> - - <url> - <update label="%ModelingUpdateSiteName" url="http://www.eclipse.org/modeling/updates/"/> - <discovery label="%ModelingUpdateSiteName" url="http://www.eclipse.org/modeling/updates/"/> - </url> - - <requires> - <import plugin="org.eclipse.core.runtime"/> - <import plugin="org.eclipse.emf.ecore"/> - <import plugin="org.eclipse.emf.edit"/> - <import plugin="org.eclipse.emf.ecore.change"/> - </requires> - - <plugin - id="org.eclipse.emf.ecore.edit" - download-size="0" - install-size="0" - version="0.0.0" - unpack="false"/> - - <plugin - id="org.eclipse.emf.ecore.change.edit" - download-size="0" - install-size="0" - version="0.0.0" - unpack="false"/> - -</feature> +http://www.eclipse.org/legal/epl-v10.html + </copyright> + + <license url="%licenseURL"> + %license + </license> + + <url> + <update label="%ModelingUpdateSiteName" url="http://www.eclipse.org/modeling/updates/"/> + <discovery label="%ModelingUpdateSiteName" url="http://www.eclipse.org/modeling/updates/"/> + </url> + + <requires> + <import plugin="org.eclipse.core.runtime"/> + <import plugin="org.eclipse.emf.ecore"/> + <import plugin="org.eclipse.emf.edit"/> + <import plugin="org.eclipse.emf.ecore.change"/> + </requires> + + <plugin + id="org.eclipse.emf.ecore.edit" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.emf.ecore.change.edit" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + +</feature>
diff --git a/features/org.eclipse.emf.gwt.ecore.edit-feature/feature.xml b/features/org.eclipse.emf.gwt.ecore.edit-feature/feature.xml index a49f214..4a90ab9 100644 --- a/features/org.eclipse.emf.gwt.ecore.edit-feature/feature.xml +++ b/features/org.eclipse.emf.gwt.ecore.edit-feature/feature.xml
@@ -1,44 +1,44 @@ -<?xml version="1.0" encoding="UTF-8"?> -<feature - id="org.eclipse.emf.gwt.ecore.edit" - label="%featureName" - version="2.7.0.qualifier" - provider-name="%providerName" - license-feature="org.eclipse.emf.license" - license-feature-version="2.7.0.qualifier"> - - <description> - %description - </description> - - <copyright url="http://www.eclipse.org/legal/epl-v10.html"> +<?xml version="1.0" encoding="UTF-8"?> +<feature + id="org.eclipse.emf.gwt.ecore.edit" + label="%featureName" + version="2.7.1.qualifier" + provider-name="%providerName" + license-feature="org.eclipse.emf.license" + license-feature-version="2.7.0.qualifier"> + + <description> + %description + </description> + + <copyright url="http://www.eclipse.org/legal/epl-v10.html"> Copyright (c) 2002-2011 IBM Corporation 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 -http://www.eclipse.org/legal/epl-v10.html - </copyright> - - <license url="%licenseURL"> - %license - </license> - - <url> - <update label="%ModelingUpdateSiteName" url="http://www.eclipse.org/modeling/updates/"/> - <discovery label="%ModelingUpdateSiteName" url="http://www.eclipse.org/modeling/updates/"/> - </url> - - <requires> - <import plugin="org.eclipse.emf.gwt.ecore"/> - <import plugin="org.eclipse.emf.gwt.edit"/> - <import plugin="org.eclipse.emf.gwt.ecore.change"/> - </requires> - - <plugin - id="org.eclipse.emf.gwt.ecore.edit" - download-size="0" - install-size="0" - version="0.0.0" - unpack="false"/> - -</feature> +http://www.eclipse.org/legal/epl-v10.html + </copyright> + + <license url="%licenseURL"> + %license + </license> + + <url> + <update label="%ModelingUpdateSiteName" url="http://www.eclipse.org/modeling/updates/"/> + <discovery label="%ModelingUpdateSiteName" url="http://www.eclipse.org/modeling/updates/"/> + </url> + + <requires> + <import plugin="org.eclipse.emf.gwt.ecore"/> + <import plugin="org.eclipse.emf.gwt.edit"/> + <import plugin="org.eclipse.emf.gwt.ecore.change"/> + </requires> + + <plugin + id="org.eclipse.emf.gwt.ecore.edit" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + +</feature>
diff --git a/plugins/org.eclipse.emf.ecore.edit/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.ecore.edit/META-INF/MANIFEST.MF index 9cbf641..9ed42ca 100644 --- a/plugins/org.eclipse.emf.ecore.edit/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.emf.ecore.edit/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.emf.ecore.edit; singleton:=true -Bundle-Version: 2.7.0.qualifier +Bundle-Version: 2.7.1.qualifier Bundle-ClassPath: . Bundle-Activator: org.eclipse.emf.ecore.provider.EcoreEditPlugin$Implementation Bundle-Vendor: %providerName
diff --git a/plugins/org.eclipse.emf.ecore.edit/src/org/eclipse/emf/ecore/provider/ETypedElementItemProvider.java b/plugins/org.eclipse.emf.ecore.edit/src/org/eclipse/emf/ecore/provider/ETypedElementItemProvider.java index 2d89fbf..138e615 100644 --- a/plugins/org.eclipse.emf.ecore.edit/src/org/eclipse/emf/ecore/provider/ETypedElementItemProvider.java +++ b/plugins/org.eclipse.emf.ecore.edit/src/org/eclipse/emf/ecore/provider/ETypedElementItemProvider.java
@@ -22,6 +22,7 @@ import java.util.Iterator; import java.util.List; +import org.eclipse.emf.common.command.Command; import org.eclipse.emf.common.notify.AdapterFactory; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EAttribute; @@ -499,6 +500,31 @@ }; } + @Override + protected Command createSetCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Object value) + { + if (feature == EcorePackage.Literals.ETYPED_ELEMENT__EGENERIC_TYPE) + { + return + new SetCommand(domain, owner, feature, value) + { + @Override + protected boolean prepare() + { + Object oldValue = ((ETypedElement)owner).getEGenericType(); + boolean result = super.prepare(); + this.oldValue = oldValue; + return result; + } + }; + + } + else + { + return super.createSetCommand(domain, owner, feature, value); + } + } + /** * This handles model notifications by calling {@link #updateChildren} to update any cached * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
diff --git a/plugins/org.eclipse.emf.gwt.ecore.edit/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.gwt.ecore.edit/META-INF/MANIFEST.MF index 4c18b75..8f8bac6 100644 --- a/plugins/org.eclipse.emf.gwt.ecore.edit/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.emf.gwt.ecore.edit/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.emf.gwt.ecore.edit;singleton:=true -Bundle-Version: 2.6.0.qualifier +Bundle-Version: 2.7.0.qualifier Bundle-ClassPath: . Bundle-Vendor: %providerName Bundle-Localization: plugin
diff --git a/plugins/org.eclipse.emf.gwt.ecore.edit/src/org/eclipse/emf/ecore/provider/ETypedElementItemProvider.java b/plugins/org.eclipse.emf.gwt.ecore.edit/src/org/eclipse/emf/ecore/provider/ETypedElementItemProvider.java index 72af9da..a0cafa9 100644 --- a/plugins/org.eclipse.emf.gwt.ecore.edit/src/org/eclipse/emf/ecore/provider/ETypedElementItemProvider.java +++ b/plugins/org.eclipse.emf.gwt.ecore.edit/src/org/eclipse/emf/ecore/provider/ETypedElementItemProvider.java
@@ -22,6 +22,7 @@ import java.util.Iterator; import java.util.List; +import org.eclipse.emf.common.command.Command; import org.eclipse.emf.common.notify.AdapterFactory; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EAttribute; @@ -499,6 +500,32 @@ }; } + + @Override + protected Command createSetCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Object value) + { + if (feature == EcorePackage.Literals.ETYPED_ELEMENT__EGENERIC_TYPE) + { + return + new SetCommand(domain, owner, feature, value) + { + @Override + protected boolean prepare() + { + Object oldValue = ((ETypedElement)owner).getEGenericType(); + boolean result = super.prepare(); + this.oldValue = oldValue; + return result; + } + }; + + } + else + { + return super.createSetCommand(domain, owner, feature, value); + } + } + /** * This handles model notifications by calling {@link #updateChildren} to update any cached * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.