aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Elder2014-02-27 09:52:43 (EST)
committerPaul Elder2014-02-27 09:52:43 (EST)
commitfa22d71a8686bff9811e0b6985316f3c8cfea5ae (patch)
tree68ee14e5f8d8d51fba99f8a4a5aadffde996c141
parent26deae57d4f2b8ab3267ad84388da00a1ba2cc1e (diff)
downloadeclipse.platform.ui-fa22d71a8686bff9811e0b6985316f3c8cfea5ae.zip
eclipse.platform.ui-fa22d71a8686bff9811e0b6985316f3c8cfea5ae.tar.gz
eclipse.platform.ui-fa22d71a8686bff9811e0b6985316f3c8cfea5ae.tar.bz2
Bug 429225: Workbench UI state lost when starting with recent builds /I20140227-1100refs/changes/23/22623/1
master Create a temp 'EClass' for removed MOpaque*/MRendered* classess so that the migration code can work. Change-Id: I4c7e0633b8f47b45fc702780aaf6125d09f5c815
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/E4XMIResource.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/E4XMIResource.java b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/E4XMIResource.java
index d0c4bbe..d50dd84 100644
--- a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/E4XMIResource.java
+++ b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/E4XMIResource.java
@@ -20,9 +20,11 @@ import java.util.WeakHashMap;
import org.eclipse.e4.ui.model.application.MApplicationElement;
import org.eclipse.e4.ui.model.application.ui.menu.MMenuFactory;
import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EFactory;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EcoreFactory;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.xmi.XMLHelper;
import org.eclipse.emf.ecore.xmi.impl.XMIHelperImpl;
@@ -181,6 +183,25 @@ public class E4XMIResource extends XMIResourceImpl {
return super.createObject(eFactory, type);
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl#getType(org.eclipse.emf.ecore.EFactory,
+ * java.lang.String)
+ */
+ @Override
+ public EClassifier getType(EFactory eFactory, String typeName) {
+ if (deprecatedTypeMappings.containsKey(typeName)) {
+ // need a temp instance of the now removed EClass so that
+ // createObject, above, can do it's work.
+ final EClass tempEClass = EcoreFactory.eINSTANCE.createEClass();
+ tempEClass.setName(typeName);
+ return tempEClass;
+ }
+ return super.getType(eFactory, typeName);
+ }
+
};
}
}